1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package people provides access to the People API. 8// 9// For product documentation, see: https://developers.google.com/people/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/people/v1" 16// ... 17// ctx := context.Background() 18// peopleService, err := people.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// peopleService, err := people.NewService(ctx, option.WithScopes(people.UserinfoProfileScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// peopleService, err := people.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// peopleService, err := people.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package people // import "google.golang.org/api/people/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 = "people:v1" 79const apiName = "people" 80const apiVersion = "v1" 81const basePath = "https://people.googleapis.com/" 82const mtlsBasePath = "https://people.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, download, and permanently delete your contacts 87 ContactsScope = "https://www.googleapis.com/auth/contacts" 88 89 // See and download contact info automatically saved in your "Other 90 // contacts" 91 ContactsOtherReadonlyScope = "https://www.googleapis.com/auth/contacts.other.readonly" 92 93 // See and download your contacts 94 ContactsReadonlyScope = "https://www.googleapis.com/auth/contacts.readonly" 95 96 // See and download your organization's GSuite directory 97 DirectoryReadonlyScope = "https://www.googleapis.com/auth/directory.readonly" 98 99 // View your street addresses 100 UserAddressesReadScope = "https://www.googleapis.com/auth/user.addresses.read" 101 102 // View your complete date of birth 103 UserBirthdayReadScope = "https://www.googleapis.com/auth/user.birthday.read" 104 105 // View your email addresses 106 UserEmailsReadScope = "https://www.googleapis.com/auth/user.emails.read" 107 108 // See your gender 109 UserGenderReadScope = "https://www.googleapis.com/auth/user.gender.read" 110 111 // See your education, work history and org info 112 UserOrganizationReadScope = "https://www.googleapis.com/auth/user.organization.read" 113 114 // View your phone numbers 115 UserPhonenumbersReadScope = "https://www.googleapis.com/auth/user.phonenumbers.read" 116 117 // View your email address 118 UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" 119 120 // See your personal info, including any personal info you've made 121 // publicly available 122 UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" 123) 124 125// NewService creates a new Service. 126func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 127 scopesOption := option.WithScopes( 128 "https://www.googleapis.com/auth/contacts", 129 "https://www.googleapis.com/auth/contacts.other.readonly", 130 "https://www.googleapis.com/auth/contacts.readonly", 131 "https://www.googleapis.com/auth/directory.readonly", 132 "https://www.googleapis.com/auth/user.addresses.read", 133 "https://www.googleapis.com/auth/user.birthday.read", 134 "https://www.googleapis.com/auth/user.emails.read", 135 "https://www.googleapis.com/auth/user.gender.read", 136 "https://www.googleapis.com/auth/user.organization.read", 137 "https://www.googleapis.com/auth/user.phonenumbers.read", 138 "https://www.googleapis.com/auth/userinfo.email", 139 "https://www.googleapis.com/auth/userinfo.profile", 140 ) 141 // NOTE: prepend, so we don't override user-specified scopes. 142 opts = append([]option.ClientOption{scopesOption}, opts...) 143 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 144 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 145 client, endpoint, err := htransport.NewClient(ctx, opts...) 146 if err != nil { 147 return nil, err 148 } 149 s, err := New(client) 150 if err != nil { 151 return nil, err 152 } 153 if endpoint != "" { 154 s.BasePath = endpoint 155 } 156 return s, nil 157} 158 159// New creates a new Service. It uses the provided http.Client for requests. 160// 161// Deprecated: please use NewService instead. 162// To provide a custom HTTP client, use option.WithHTTPClient. 163// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 164func New(client *http.Client) (*Service, error) { 165 if client == nil { 166 return nil, errors.New("client is nil") 167 } 168 s := &Service{client: client, BasePath: basePath} 169 s.ContactGroups = NewContactGroupsService(s) 170 s.OtherContacts = NewOtherContactsService(s) 171 s.People = NewPeopleService(s) 172 return s, nil 173} 174 175type Service struct { 176 client *http.Client 177 BasePath string // API endpoint base URL 178 UserAgent string // optional additional User-Agent fragment 179 180 ContactGroups *ContactGroupsService 181 182 OtherContacts *OtherContactsService 183 184 People *PeopleService 185} 186 187func (s *Service) userAgent() string { 188 if s.UserAgent == "" { 189 return googleapi.UserAgent 190 } 191 return googleapi.UserAgent + " " + s.UserAgent 192} 193 194func NewContactGroupsService(s *Service) *ContactGroupsService { 195 rs := &ContactGroupsService{s: s} 196 rs.Members = NewContactGroupsMembersService(s) 197 return rs 198} 199 200type ContactGroupsService struct { 201 s *Service 202 203 Members *ContactGroupsMembersService 204} 205 206func NewContactGroupsMembersService(s *Service) *ContactGroupsMembersService { 207 rs := &ContactGroupsMembersService{s: s} 208 return rs 209} 210 211type ContactGroupsMembersService struct { 212 s *Service 213} 214 215func NewOtherContactsService(s *Service) *OtherContactsService { 216 rs := &OtherContactsService{s: s} 217 return rs 218} 219 220type OtherContactsService struct { 221 s *Service 222} 223 224func NewPeopleService(s *Service) *PeopleService { 225 rs := &PeopleService{s: s} 226 rs.Connections = NewPeopleConnectionsService(s) 227 return rs 228} 229 230type PeopleService struct { 231 s *Service 232 233 Connections *PeopleConnectionsService 234} 235 236func NewPeopleConnectionsService(s *Service) *PeopleConnectionsService { 237 rs := &PeopleConnectionsService{s: s} 238 return rs 239} 240 241type PeopleConnectionsService struct { 242 s *Service 243} 244 245// Address: A person's physical address. May be a P.O. box or street 246// address. All fields 247// are optional. 248type Address struct { 249 // City: The city of the address. 250 City string `json:"city,omitempty"` 251 252 // Country: The country of the address. 253 Country string `json:"country,omitempty"` 254 255 // CountryCode: The [ISO 3166-1 256 // alpha-2](http://www.iso.org/iso/country_codes.htm) country 257 // code of the address. 258 CountryCode string `json:"countryCode,omitempty"` 259 260 // ExtendedAddress: The extended address of the address; for example, 261 // the apartment number. 262 ExtendedAddress string `json:"extendedAddress,omitempty"` 263 264 // FormattedType: Output only. The type of the address translated and 265 // formatted in the viewer's 266 // account locale or the `Accept-Language` HTTP header locale. 267 FormattedType string `json:"formattedType,omitempty"` 268 269 // FormattedValue: The unstructured value of the address. If this is not 270 // set by the user it 271 // will be automatically constructed from structured values. 272 FormattedValue string `json:"formattedValue,omitempty"` 273 274 // Metadata: Metadata about the address. 275 Metadata *FieldMetadata `json:"metadata,omitempty"` 276 277 // PoBox: The P.O. box of the address. 278 PoBox string `json:"poBox,omitempty"` 279 280 // PostalCode: The postal code of the address. 281 PostalCode string `json:"postalCode,omitempty"` 282 283 // Region: The region of the address; for example, the state or 284 // province. 285 Region string `json:"region,omitempty"` 286 287 // StreetAddress: The street address. 288 StreetAddress string `json:"streetAddress,omitempty"` 289 290 // Type: The type of the address. The type can be custom or one of these 291 // predefined 292 // values: 293 // 294 // * `home` 295 // * `work` 296 // * `other` 297 Type string `json:"type,omitempty"` 298 299 // ForceSendFields is a list of field names (e.g. "City") to 300 // unconditionally include in API requests. By default, fields with 301 // empty values are omitted from API requests. However, any non-pointer, 302 // non-interface field appearing in ForceSendFields will be sent to the 303 // server regardless of whether the field is empty or not. This may be 304 // used to include empty fields in Patch requests. 305 ForceSendFields []string `json:"-"` 306 307 // NullFields is a list of field names (e.g. "City") to include in API 308 // requests with the JSON null value. By default, fields with empty 309 // values are omitted from API requests. However, any field with an 310 // empty value appearing in NullFields will be sent to the server as 311 // null. It is an error if a field in this list has a non-empty value. 312 // This may be used to include null fields in Patch requests. 313 NullFields []string `json:"-"` 314} 315 316func (s *Address) MarshalJSON() ([]byte, error) { 317 type NoMethod Address 318 raw := NoMethod(*s) 319 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 320} 321 322// AgeRangeType: A person's age range. 323type AgeRangeType struct { 324 // AgeRange: The age range. 325 // 326 // Possible values: 327 // "AGE_RANGE_UNSPECIFIED" - Unspecified. 328 // "LESS_THAN_EIGHTEEN" - Younger than eighteen. 329 // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty. 330 // "TWENTY_ONE_OR_OLDER" - Twenty-one and older. 331 AgeRange string `json:"ageRange,omitempty"` 332 333 // Metadata: Metadata about the age range. 334 Metadata *FieldMetadata `json:"metadata,omitempty"` 335 336 // ForceSendFields is a list of field names (e.g. "AgeRange") to 337 // unconditionally include in API requests. By default, fields with 338 // empty values are omitted from API requests. However, any non-pointer, 339 // non-interface field appearing in ForceSendFields will be sent to the 340 // server regardless of whether the field is empty or not. This may be 341 // used to include empty fields in Patch requests. 342 ForceSendFields []string `json:"-"` 343 344 // NullFields is a list of field names (e.g. "AgeRange") to include in 345 // API requests with the JSON null value. By default, fields with empty 346 // values are omitted from API requests. However, any field with an 347 // empty value appearing in NullFields will be sent to the server as 348 // null. It is an error if a field in this list has a non-empty value. 349 // This may be used to include null fields in Patch requests. 350 NullFields []string `json:"-"` 351} 352 353func (s *AgeRangeType) MarshalJSON() ([]byte, error) { 354 type NoMethod AgeRangeType 355 raw := NoMethod(*s) 356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 357} 358 359// BatchGetContactGroupsResponse: The response to a batch get contact 360// groups request. 361type BatchGetContactGroupsResponse struct { 362 // Responses: The list of responses for each requested contact group 363 // resource. 364 Responses []*ContactGroupResponse `json:"responses,omitempty"` 365 366 // ServerResponse contains the HTTP response code and headers from the 367 // server. 368 googleapi.ServerResponse `json:"-"` 369 370 // ForceSendFields is a list of field names (e.g. "Responses") to 371 // unconditionally include in API requests. By default, fields with 372 // empty values are omitted from API requests. However, any non-pointer, 373 // non-interface field appearing in ForceSendFields will be sent to the 374 // server regardless of whether the field is empty or not. This may be 375 // used to include empty fields in Patch requests. 376 ForceSendFields []string `json:"-"` 377 378 // NullFields is a list of field names (e.g. "Responses") to include in 379 // API requests with the JSON null value. By default, fields with empty 380 // values are omitted from API requests. However, any field with an 381 // empty value appearing in NullFields will be sent to the server as 382 // null. It is an error if a field in this list has a non-empty value. 383 // This may be used to include null fields in Patch requests. 384 NullFields []string `json:"-"` 385} 386 387func (s *BatchGetContactGroupsResponse) MarshalJSON() ([]byte, error) { 388 type NoMethod BatchGetContactGroupsResponse 389 raw := NoMethod(*s) 390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 391} 392 393// Biography: A person's short biography. 394type Biography struct { 395 // ContentType: The content type of the biography. 396 // 397 // Possible values: 398 // "CONTENT_TYPE_UNSPECIFIED" - Unspecified. 399 // "TEXT_PLAIN" - Plain text. 400 // "TEXT_HTML" - HTML text. 401 ContentType string `json:"contentType,omitempty"` 402 403 // Metadata: Metadata about the biography. 404 Metadata *FieldMetadata `json:"metadata,omitempty"` 405 406 // Value: The short biography. 407 Value string `json:"value,omitempty"` 408 409 // ForceSendFields is a list of field names (e.g. "ContentType") to 410 // unconditionally include in API requests. By default, fields with 411 // empty values are omitted from API requests. However, any non-pointer, 412 // non-interface field appearing in ForceSendFields will be sent to the 413 // server regardless of whether the field is empty or not. This may be 414 // used to include empty fields in Patch requests. 415 ForceSendFields []string `json:"-"` 416 417 // NullFields is a list of field names (e.g. "ContentType") to include 418 // in API requests with the JSON null value. By default, fields with 419 // empty values are omitted from API requests. However, any field with 420 // an empty value appearing in NullFields will be sent to the server as 421 // null. It is an error if a field in this list has a non-empty value. 422 // This may be used to include null fields in Patch requests. 423 NullFields []string `json:"-"` 424} 425 426func (s *Biography) MarshalJSON() ([]byte, error) { 427 type NoMethod Biography 428 raw := NoMethod(*s) 429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 430} 431 432// Birthday: A person's birthday. At least one of the `date` and `text` 433// fields are 434// specified. The `date` and `text` fields typically represent the 435// same 436// date, but are not guaranteed to. 437type Birthday struct { 438 // Date: The date of the birthday. 439 Date *Date `json:"date,omitempty"` 440 441 // Metadata: Metadata about the birthday. 442 Metadata *FieldMetadata `json:"metadata,omitempty"` 443 444 // Text: A free-form string representing the user's birthday. 445 Text string `json:"text,omitempty"` 446 447 // ForceSendFields is a list of field names (e.g. "Date") to 448 // unconditionally include in API requests. By default, fields with 449 // empty values are omitted from API requests. However, any non-pointer, 450 // non-interface field appearing in ForceSendFields will be sent to the 451 // server regardless of whether the field is empty or not. This may be 452 // used to include empty fields in Patch requests. 453 ForceSendFields []string `json:"-"` 454 455 // NullFields is a list of field names (e.g. "Date") to include in API 456 // requests with the JSON null value. By default, fields with empty 457 // values are omitted from API requests. However, any field with an 458 // empty value appearing in NullFields will be sent to the server as 459 // null. It is an error if a field in this list has a non-empty value. 460 // This may be used to include null fields in Patch requests. 461 NullFields []string `json:"-"` 462} 463 464func (s *Birthday) MarshalJSON() ([]byte, error) { 465 type NoMethod Birthday 466 raw := NoMethod(*s) 467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 468} 469 470// BraggingRights: **DEPRECATED**: No data will be returned 471// A person's bragging rights. 472type BraggingRights struct { 473 // Metadata: Metadata about the bragging rights. 474 Metadata *FieldMetadata `json:"metadata,omitempty"` 475 476 // Value: The bragging rights; for example, `climbed mount everest`. 477 Value string `json:"value,omitempty"` 478 479 // ForceSendFields is a list of field names (e.g. "Metadata") to 480 // unconditionally include in API requests. By default, fields with 481 // empty values are omitted from API requests. However, any non-pointer, 482 // non-interface field appearing in ForceSendFields will be sent to the 483 // server regardless of whether the field is empty or not. This may be 484 // used to include empty fields in Patch requests. 485 ForceSendFields []string `json:"-"` 486 487 // NullFields is a list of field names (e.g. "Metadata") to include in 488 // API requests with the JSON null value. By default, fields with empty 489 // values are omitted from API requests. However, any field with an 490 // empty value appearing in NullFields will be sent to the server as 491 // null. It is an error if a field in this list has a non-empty value. 492 // This may be used to include null fields in Patch requests. 493 NullFields []string `json:"-"` 494} 495 496func (s *BraggingRights) MarshalJSON() ([]byte, error) { 497 type NoMethod BraggingRights 498 raw := NoMethod(*s) 499 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 500} 501 502// ContactGroup: A contact group. 503type ContactGroup struct { 504 // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) 505 // of the 506 // resource. Used for web cache validation. 507 Etag string `json:"etag,omitempty"` 508 509 // FormattedName: Output only. The name translated and formatted in the 510 // viewer's account locale 511 // or the `Accept-Language` HTTP header locale for system groups 512 // names. 513 // Group names set by the owner are the same as name. 514 FormattedName string `json:"formattedName,omitempty"` 515 516 // GroupType: Output only. The contact group type. 517 // 518 // Possible values: 519 // "GROUP_TYPE_UNSPECIFIED" - Unspecified. 520 // "USER_CONTACT_GROUP" - User defined contact group. 521 // "SYSTEM_CONTACT_GROUP" - System defined contact group. 522 GroupType string `json:"groupType,omitempty"` 523 524 // MemberCount: Output only. The total number of contacts in the group 525 // irrespective of max members in 526 // specified in the request. 527 MemberCount int64 `json:"memberCount,omitempty"` 528 529 // MemberResourceNames: Output only. The list of contact person resource 530 // names that are members of the contact 531 // group. The field is not populated for LIST requests and can only be 532 // updated 533 // through 534 // the 535 // [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/memb 536 // ers/modify). 537 MemberResourceNames []string `json:"memberResourceNames,omitempty"` 538 539 // Metadata: Output only. Metadata about the contact group. 540 Metadata *ContactGroupMetadata `json:"metadata,omitempty"` 541 542 // Name: The contact group name set by the group owner or a system 543 // provided name 544 // for system groups. 545 Name string `json:"name,omitempty"` 546 547 // ResourceName: The resource name for the contact group, assigned by 548 // the server. An ASCII 549 // string, in the form of `contactGroups/{contact_group_id}`. 550 ResourceName string `json:"resourceName,omitempty"` 551 552 // ServerResponse contains the HTTP response code and headers from the 553 // server. 554 googleapi.ServerResponse `json:"-"` 555 556 // ForceSendFields is a list of field names (e.g. "Etag") to 557 // unconditionally include in API requests. By default, fields with 558 // empty values are omitted from API requests. However, any non-pointer, 559 // non-interface field appearing in ForceSendFields will be sent to the 560 // server regardless of whether the field is empty or not. This may be 561 // used to include empty fields in Patch requests. 562 ForceSendFields []string `json:"-"` 563 564 // NullFields is a list of field names (e.g. "Etag") to include in API 565 // requests with the JSON null value. By default, fields with empty 566 // values are omitted from API requests. However, any field with an 567 // empty value appearing in NullFields will be sent to the server as 568 // null. It is an error if a field in this list has a non-empty value. 569 // This may be used to include null fields in Patch requests. 570 NullFields []string `json:"-"` 571} 572 573func (s *ContactGroup) MarshalJSON() ([]byte, error) { 574 type NoMethod ContactGroup 575 raw := NoMethod(*s) 576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 577} 578 579// ContactGroupMembership: A Google contact group membership. 580type ContactGroupMembership struct { 581 // ContactGroupId: Output only. The contact group ID for the contact 582 // group membership. 583 ContactGroupId string `json:"contactGroupId,omitempty"` 584 585 // ContactGroupResourceName: The resource name for the contact group, 586 // assigned by the server. An ASCII 587 // string, in the form of `contactGroups/{contact_group_id}`. 588 // Only contact_group_resource_name can be used for modifying 589 // memberships. 590 // Any contact group membership can be removed, but only user group 591 // or 592 // "myContacts" or "starred" system groups memberships can be added. 593 // A 594 // contact must always have at least one contact group membership. 595 ContactGroupResourceName string `json:"contactGroupResourceName,omitempty"` 596 597 // ForceSendFields is a list of field names (e.g. "ContactGroupId") to 598 // unconditionally include in API requests. By default, fields with 599 // empty values are omitted from API requests. However, any non-pointer, 600 // non-interface field appearing in ForceSendFields will be sent to the 601 // server regardless of whether the field is empty or not. This may be 602 // used to include empty fields in Patch requests. 603 ForceSendFields []string `json:"-"` 604 605 // NullFields is a list of field names (e.g. "ContactGroupId") to 606 // include in API requests with the JSON null value. By default, fields 607 // with empty values are omitted from API requests. However, any field 608 // with an empty value appearing in NullFields will be sent to the 609 // server as null. It is an error if a field in this list has a 610 // non-empty value. This may be used to include null fields in Patch 611 // requests. 612 NullFields []string `json:"-"` 613} 614 615func (s *ContactGroupMembership) MarshalJSON() ([]byte, error) { 616 type NoMethod ContactGroupMembership 617 raw := NoMethod(*s) 618 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 619} 620 621// ContactGroupMetadata: The metadata about a contact group. 622type ContactGroupMetadata struct { 623 // Deleted: Output only. True if the contact group resource has been 624 // deleted. Populated only 625 // for 626 // [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) 627 // requests 628 // that include a sync token. 629 Deleted bool `json:"deleted,omitempty"` 630 631 // UpdateTime: Output only. The time the group was last updated. 632 UpdateTime string `json:"updateTime,omitempty"` 633 634 // ForceSendFields is a list of field names (e.g. "Deleted") to 635 // unconditionally include in API requests. By default, fields with 636 // empty values are omitted from API requests. However, any non-pointer, 637 // non-interface field appearing in ForceSendFields will be sent to the 638 // server regardless of whether the field is empty or not. This may be 639 // used to include empty fields in Patch requests. 640 ForceSendFields []string `json:"-"` 641 642 // NullFields is a list of field names (e.g. "Deleted") to include in 643 // API requests with the JSON null value. By default, fields with empty 644 // values are omitted from API requests. However, any field with an 645 // empty value appearing in NullFields will be sent to the server as 646 // null. It is an error if a field in this list has a non-empty value. 647 // This may be used to include null fields in Patch requests. 648 NullFields []string `json:"-"` 649} 650 651func (s *ContactGroupMetadata) MarshalJSON() ([]byte, error) { 652 type NoMethod ContactGroupMetadata 653 raw := NoMethod(*s) 654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 655} 656 657// ContactGroupResponse: The response for a specific contact group. 658type ContactGroupResponse struct { 659 // ContactGroup: The contact group. 660 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 661 662 // RequestedResourceName: The original requested resource name. 663 RequestedResourceName string `json:"requestedResourceName,omitempty"` 664 665 // Status: The status of the response. 666 Status *Status `json:"status,omitempty"` 667 668 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 669 // unconditionally include in API requests. By default, fields with 670 // empty values are omitted from API requests. However, any non-pointer, 671 // non-interface field appearing in ForceSendFields will be sent to the 672 // server regardless of whether the field is empty or not. This may be 673 // used to include empty fields in Patch requests. 674 ForceSendFields []string `json:"-"` 675 676 // NullFields is a list of field names (e.g. "ContactGroup") to include 677 // in API requests with the JSON null value. By default, fields with 678 // empty values are omitted from API requests. However, any field with 679 // an empty value appearing in NullFields will be sent to the server as 680 // null. It is an error if a field in this list has a non-empty value. 681 // This may be used to include null fields in Patch requests. 682 NullFields []string `json:"-"` 683} 684 685func (s *ContactGroupResponse) MarshalJSON() ([]byte, error) { 686 type NoMethod ContactGroupResponse 687 raw := NoMethod(*s) 688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 689} 690 691// CopyOtherContactToMyContactsGroupRequest: A request to copy an "Other 692// contact" to my contacts group. 693type CopyOtherContactToMyContactsGroupRequest struct { 694 // CopyMask: Required. A field mask to restrict which fields are copied 695 // into the new contact. 696 // Valid values are: 697 // 698 // * emailAddresses 699 // * names 700 // * phoneNumbers 701 CopyMask string `json:"copyMask,omitempty"` 702 703 // ReadMask: Optional. A field mask to restrict which fields on the 704 // person are returned. Multiple 705 // fields can be specified by separating them with commas. Defaults to 706 // the 707 // copy mask with metadata and membership fields if not set. Valid 708 // values are: 709 // 710 // * addresses 711 // * ageRanges 712 // * biographies 713 // * birthdays 714 // * coverPhotos 715 // * emailAddresses 716 // * events 717 // * genders 718 // * imClients 719 // * interests 720 // * locales 721 // * memberships 722 // * metadata 723 // * names 724 // * nicknames 725 // * occupations 726 // * organizations 727 // * phoneNumbers 728 // * photos 729 // * relations 730 // * residences 731 // * sipAddresses 732 // * skills 733 // * urls 734 // * userDefined 735 ReadMask string `json:"readMask,omitempty"` 736 737 // Sources: Optional. A mask of what source types to return. Defaults 738 // to 739 // ReadSourceType.CONTACT and 740 // ReadSourceType.PROFILE if not 741 // set. 742 // 743 // Possible values: 744 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified. 745 // "READ_SOURCE_TYPE_PROFILE" - 746 // Returns 747 // SourceType.ACCOUNT, 748 // SourceType.DOMAIN_PROFILE, 749 // and 750 // SourceType. 751 // PROFILE. 752 // "READ_SOURCE_TYPE_CONTACT" - Returns 753 // SourceType.CONTACT. 754 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - 755 // Returns 756 // SourceType.DOMAIN_CONTACT. 757 Sources []string `json:"sources,omitempty"` 758 759 // ForceSendFields is a list of field names (e.g. "CopyMask") to 760 // unconditionally include in API requests. By default, fields with 761 // empty values are omitted from API requests. However, any non-pointer, 762 // non-interface field appearing in ForceSendFields will be sent to the 763 // server regardless of whether the field is empty or not. This may be 764 // used to include empty fields in Patch requests. 765 ForceSendFields []string `json:"-"` 766 767 // NullFields is a list of field names (e.g. "CopyMask") to include in 768 // API requests with the JSON null value. By default, fields with empty 769 // values are omitted from API requests. However, any field with an 770 // empty value appearing in NullFields will be sent to the server as 771 // null. It is an error if a field in this list has a non-empty value. 772 // This may be used to include null fields in Patch requests. 773 NullFields []string `json:"-"` 774} 775 776func (s *CopyOtherContactToMyContactsGroupRequest) MarshalJSON() ([]byte, error) { 777 type NoMethod CopyOtherContactToMyContactsGroupRequest 778 raw := NoMethod(*s) 779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 780} 781 782// CoverPhoto: A person's cover photo. A large image shown on the 783// person's 784// profile page that represents who they are or what they care about. 785type CoverPhoto struct { 786 // Default: True if the cover photo is the default cover photo; 787 // false if the cover photo is a user-provided cover photo. 788 Default bool `json:"default,omitempty"` 789 790 // Metadata: Metadata about the cover photo. 791 Metadata *FieldMetadata `json:"metadata,omitempty"` 792 793 // Url: The URL of the cover photo. 794 Url string `json:"url,omitempty"` 795 796 // ForceSendFields is a list of field names (e.g. "Default") to 797 // unconditionally include in API requests. By default, fields with 798 // empty values are omitted from API requests. However, any non-pointer, 799 // non-interface field appearing in ForceSendFields will be sent to the 800 // server regardless of whether the field is empty or not. This may be 801 // used to include empty fields in Patch requests. 802 ForceSendFields []string `json:"-"` 803 804 // NullFields is a list of field names (e.g. "Default") to include in 805 // API requests with the JSON null value. By default, fields with empty 806 // values are omitted from API requests. However, any field with an 807 // empty value appearing in NullFields will be sent to the server as 808 // null. It is an error if a field in this list has a non-empty value. 809 // This may be used to include null fields in Patch requests. 810 NullFields []string `json:"-"` 811} 812 813func (s *CoverPhoto) MarshalJSON() ([]byte, error) { 814 type NoMethod CoverPhoto 815 raw := NoMethod(*s) 816 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 817} 818 819// CreateContactGroupRequest: A request to create a new contact group. 820type CreateContactGroupRequest struct { 821 // ContactGroup: Required. The contact group to create. 822 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 823 824 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 825 // unconditionally include in API requests. By default, fields with 826 // empty values are omitted from API requests. However, any non-pointer, 827 // non-interface field appearing in ForceSendFields will be sent to the 828 // server regardless of whether the field is empty or not. This may be 829 // used to include empty fields in Patch requests. 830 ForceSendFields []string `json:"-"` 831 832 // NullFields is a list of field names (e.g. "ContactGroup") to include 833 // in API requests with the JSON null value. By default, fields with 834 // empty values are omitted from API requests. However, any field with 835 // an empty value appearing in NullFields will be sent to the server as 836 // null. It is an error if a field in this list has a non-empty value. 837 // This may be used to include null fields in Patch requests. 838 NullFields []string `json:"-"` 839} 840 841func (s *CreateContactGroupRequest) MarshalJSON() ([]byte, error) { 842 type NoMethod CreateContactGroupRequest 843 raw := NoMethod(*s) 844 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 845} 846 847// Date: Represents a whole or partial calendar date, e.g. a birthday. 848// The time of day 849// and time zone are either specified elsewhere or are not significant. 850// The date 851// is relative to the Proleptic Gregorian Calendar. This can 852// represent: 853// 854// * A full date, with non-zero year, month and day values 855// * A month and day value, with a zero year, e.g. an anniversary 856// * A year on its own, with zero month and day values 857// * A year and month value, with a zero day, e.g. a credit card 858// expiration date 859// 860// Related types are google.type.TimeOfDay and 861// `google.protobuf.Timestamp`. 862type Date struct { 863 // Day: Day of month. Must be from 1 to 31 and valid for the year and 864 // month, or 0 865 // if specifying a year by itself or a year and month where the day is 866 // not 867 // significant. 868 Day int64 `json:"day,omitempty"` 869 870 // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year 871 // without a 872 // month and day. 873 Month int64 `json:"month,omitempty"` 874 875 // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date 876 // without 877 // a year. 878 Year int64 `json:"year,omitempty"` 879 880 // ForceSendFields is a list of field names (e.g. "Day") to 881 // unconditionally include in API requests. By default, fields with 882 // empty values are omitted from API requests. However, any non-pointer, 883 // non-interface field appearing in ForceSendFields will be sent to the 884 // server regardless of whether the field is empty or not. This may be 885 // used to include empty fields in Patch requests. 886 ForceSendFields []string `json:"-"` 887 888 // NullFields is a list of field names (e.g. "Day") to include in API 889 // requests with the JSON null value. By default, fields with empty 890 // values are omitted from API requests. However, any field with an 891 // empty value appearing in NullFields will be sent to the server as 892 // null. It is an error if a field in this list has a non-empty value. 893 // This may be used to include null fields in Patch requests. 894 NullFields []string `json:"-"` 895} 896 897func (s *Date) MarshalJSON() ([]byte, error) { 898 type NoMethod Date 899 raw := NoMethod(*s) 900 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 901} 902 903// DeleteContactPhotoResponse: The response for deleteing a contact's 904// photo. 905type DeleteContactPhotoResponse struct { 906 // Person: The updated person, if person_fields is set in 907 // the 908 // DeleteContactPhotoRequest; otherwise this will be unset. 909 Person *Person `json:"person,omitempty"` 910 911 // ServerResponse contains the HTTP response code and headers from the 912 // server. 913 googleapi.ServerResponse `json:"-"` 914 915 // ForceSendFields is a list of field names (e.g. "Person") to 916 // unconditionally include in API requests. By default, fields with 917 // empty values are omitted from API requests. However, any non-pointer, 918 // non-interface field appearing in ForceSendFields will be sent to the 919 // server regardless of whether the field is empty or not. This may be 920 // used to include empty fields in Patch requests. 921 ForceSendFields []string `json:"-"` 922 923 // NullFields is a list of field names (e.g. "Person") to include in API 924 // 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 *DeleteContactPhotoResponse) MarshalJSON() ([]byte, error) { 933 type NoMethod DeleteContactPhotoResponse 934 raw := NoMethod(*s) 935 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 936} 937 938// DomainMembership: A G Suite Domain membership. 939type DomainMembership struct { 940 // InViewerDomain: True if the person is in the viewer's G Suite domain. 941 InViewerDomain bool `json:"inViewerDomain,omitempty"` 942 943 // ForceSendFields is a list of field names (e.g. "InViewerDomain") to 944 // unconditionally include in API requests. By default, fields with 945 // empty values are omitted from API requests. However, any non-pointer, 946 // non-interface field appearing in ForceSendFields will be sent to the 947 // server regardless of whether the field is empty or not. This may be 948 // used to include empty fields in Patch requests. 949 ForceSendFields []string `json:"-"` 950 951 // NullFields is a list of field names (e.g. "InViewerDomain") to 952 // include in API requests with the JSON null value. By default, fields 953 // with empty values are omitted from API requests. However, any field 954 // with an empty value appearing in NullFields will be sent to the 955 // server as null. It is an error if a field in this list has a 956 // non-empty value. This may be used to include null fields in Patch 957 // requests. 958 NullFields []string `json:"-"` 959} 960 961func (s *DomainMembership) MarshalJSON() ([]byte, error) { 962 type NoMethod DomainMembership 963 raw := NoMethod(*s) 964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 965} 966 967// EmailAddress: A person's email address. 968type EmailAddress struct { 969 // DisplayName: The display name of the email. 970 DisplayName string `json:"displayName,omitempty"` 971 972 // FormattedType: Output only. The type of the email address translated 973 // and formatted in the 974 // viewer's account locale or the `Accept-Language` HTTP header locale. 975 FormattedType string `json:"formattedType,omitempty"` 976 977 // Metadata: Metadata about the email address. 978 Metadata *FieldMetadata `json:"metadata,omitempty"` 979 980 // Type: The type of the email address. The type can be custom or one of 981 // these 982 // predefined values: 983 // 984 // * `home` 985 // * `work` 986 // * `other` 987 Type string `json:"type,omitempty"` 988 989 // Value: The email address. 990 Value string `json:"value,omitempty"` 991 992 // ForceSendFields is a list of field names (e.g. "DisplayName") to 993 // unconditionally include in API requests. By default, fields with 994 // empty values are omitted from API requests. However, any non-pointer, 995 // non-interface field appearing in ForceSendFields will be sent to the 996 // server regardless of whether the field is empty or not. This may be 997 // used to include empty fields in Patch requests. 998 ForceSendFields []string `json:"-"` 999 1000 // NullFields is a list of field names (e.g. "DisplayName") to include 1001 // in API requests with the JSON null value. By default, fields with 1002 // empty values are omitted from API requests. However, any field with 1003 // an empty value appearing in NullFields will be sent to the server as 1004 // null. It is an error if a field in this list has a non-empty value. 1005 // This may be used to include null fields in Patch requests. 1006 NullFields []string `json:"-"` 1007} 1008 1009func (s *EmailAddress) MarshalJSON() ([]byte, error) { 1010 type NoMethod EmailAddress 1011 raw := NoMethod(*s) 1012 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1013} 1014 1015// Empty: A generic empty message that you can re-use to avoid defining 1016// duplicated 1017// empty messages in your APIs. A typical example is to use it as the 1018// request 1019// or the response type of an API method. For instance: 1020// 1021// service Foo { 1022// rpc Bar(google.protobuf.Empty) returns 1023// (google.protobuf.Empty); 1024// } 1025// 1026// The JSON representation for `Empty` is empty JSON object `{}`. 1027type Empty struct { 1028 // ServerResponse contains the HTTP response code and headers from the 1029 // server. 1030 googleapi.ServerResponse `json:"-"` 1031} 1032 1033// Event: An event related to the person. 1034type Event struct { 1035 // Date: The date of the event. 1036 Date *Date `json:"date,omitempty"` 1037 1038 // FormattedType: Output only. The type of the event translated and 1039 // formatted in the 1040 // viewer's account locale or the `Accept-Language` HTTP header locale. 1041 FormattedType string `json:"formattedType,omitempty"` 1042 1043 // Metadata: Metadata about the event. 1044 Metadata *FieldMetadata `json:"metadata,omitempty"` 1045 1046 // Type: The type of the event. The type can be custom or one of these 1047 // predefined 1048 // values: 1049 // 1050 // * `anniversary` 1051 // * `other` 1052 Type string `json:"type,omitempty"` 1053 1054 // ForceSendFields is a list of field names (e.g. "Date") to 1055 // unconditionally include in API requests. By default, fields with 1056 // empty values are omitted from API requests. However, any non-pointer, 1057 // non-interface field appearing in ForceSendFields will be sent to the 1058 // server regardless of whether the field is empty or not. This may be 1059 // used to include empty fields in Patch requests. 1060 ForceSendFields []string `json:"-"` 1061 1062 // NullFields is a list of field names (e.g. "Date") to include in API 1063 // requests with the JSON null value. By default, fields with empty 1064 // values are omitted from API requests. However, any field with an 1065 // empty value appearing in NullFields will be sent to the server as 1066 // null. It is an error if a field in this list has a non-empty value. 1067 // This may be used to include null fields in Patch requests. 1068 NullFields []string `json:"-"` 1069} 1070 1071func (s *Event) MarshalJSON() ([]byte, error) { 1072 type NoMethod Event 1073 raw := NoMethod(*s) 1074 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1075} 1076 1077// FieldMetadata: Metadata about a field. 1078type FieldMetadata struct { 1079 // Primary: True if the field is the primary field; false if the field 1080 // is a secondary 1081 // field. 1082 Primary bool `json:"primary,omitempty"` 1083 1084 // Source: The source of the field. 1085 Source *Source `json:"source,omitempty"` 1086 1087 // Verified: Output only. True if the field is verified; false if the 1088 // field is unverified. A 1089 // verified field is typically a name, email address, phone number, 1090 // or 1091 // website that has been confirmed to be owned by the person. 1092 Verified bool `json:"verified,omitempty"` 1093 1094 // ForceSendFields is a list of field names (e.g. "Primary") to 1095 // unconditionally include in API requests. By default, fields with 1096 // empty values are omitted from API requests. However, any non-pointer, 1097 // non-interface field appearing in ForceSendFields will be sent to the 1098 // server regardless of whether the field is empty or not. This may be 1099 // used to include empty fields in Patch requests. 1100 ForceSendFields []string `json:"-"` 1101 1102 // NullFields is a list of field names (e.g. "Primary") to include in 1103 // API requests with the JSON null value. By default, fields with empty 1104 // values are omitted from API requests. However, any field with an 1105 // empty value appearing in NullFields will be sent to the server as 1106 // null. It is an error if a field in this list has a non-empty value. 1107 // This may be used to include null fields in Patch requests. 1108 NullFields []string `json:"-"` 1109} 1110 1111func (s *FieldMetadata) MarshalJSON() ([]byte, error) { 1112 type NoMethod FieldMetadata 1113 raw := NoMethod(*s) 1114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1115} 1116 1117// FileAs: The name that should be used to sort the person in a list. 1118type FileAs struct { 1119 // Metadata: Metadata about the file-as. 1120 Metadata *FieldMetadata `json:"metadata,omitempty"` 1121 1122 // Value: The file-as value 1123 Value string `json:"value,omitempty"` 1124 1125 // ForceSendFields is a list of field names (e.g. "Metadata") to 1126 // unconditionally include in API requests. By default, fields with 1127 // empty values are omitted from API requests. However, any non-pointer, 1128 // non-interface field appearing in ForceSendFields will be sent to the 1129 // server regardless of whether the field is empty or not. This may be 1130 // used to include empty fields in Patch requests. 1131 ForceSendFields []string `json:"-"` 1132 1133 // NullFields is a list of field names (e.g. "Metadata") to include in 1134 // API requests with the JSON null value. By default, fields with empty 1135 // values are omitted from API requests. However, any field with an 1136 // empty value appearing in NullFields will be sent to the server as 1137 // null. It is an error if a field in this list has a non-empty value. 1138 // This may be used to include null fields in Patch requests. 1139 NullFields []string `json:"-"` 1140} 1141 1142func (s *FileAs) MarshalJSON() ([]byte, error) { 1143 type NoMethod FileAs 1144 raw := NoMethod(*s) 1145 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1146} 1147 1148// Gender: A person's gender. 1149type Gender struct { 1150 // AddressMeAs: The type of pronouns that should be used to address the 1151 // person. The value 1152 // can be custom or one of these predefined values: 1153 // 1154 // * `male` 1155 // * `female` 1156 // * `other` 1157 AddressMeAs string `json:"addressMeAs,omitempty"` 1158 1159 // FormattedValue: Output only. The value of the gender translated and 1160 // formatted in the viewer's account 1161 // locale or the `Accept-Language` HTTP header locale. Unspecified or 1162 // custom 1163 // value are not localized. 1164 FormattedValue string `json:"formattedValue,omitempty"` 1165 1166 // Metadata: Metadata about the gender. 1167 Metadata *FieldMetadata `json:"metadata,omitempty"` 1168 1169 // Value: The gender for the person. The gender can be custom or one of 1170 // these 1171 // predefined values: 1172 // 1173 // * `male` 1174 // * `female` 1175 // * `unspecified` 1176 Value string `json:"value,omitempty"` 1177 1178 // ForceSendFields is a list of field names (e.g. "AddressMeAs") to 1179 // unconditionally include in API requests. By default, fields with 1180 // empty values are omitted from API requests. However, any non-pointer, 1181 // non-interface field appearing in ForceSendFields will be sent to the 1182 // server regardless of whether the field is empty or not. This may be 1183 // used to include empty fields in Patch requests. 1184 ForceSendFields []string `json:"-"` 1185 1186 // NullFields is a list of field names (e.g. "AddressMeAs") to include 1187 // in API requests with the JSON null value. By default, fields with 1188 // empty values are omitted from API requests. However, any field with 1189 // an empty value appearing in NullFields will be sent to the server as 1190 // null. It is an error if a field in this list has a non-empty value. 1191 // This may be used to include null fields in Patch requests. 1192 NullFields []string `json:"-"` 1193} 1194 1195func (s *Gender) MarshalJSON() ([]byte, error) { 1196 type NoMethod Gender 1197 raw := NoMethod(*s) 1198 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1199} 1200 1201// GetPeopleResponse: The response to a get request for a list of people 1202// by resource name. 1203type GetPeopleResponse struct { 1204 // Responses: The response for each requested resource name. 1205 Responses []*PersonResponse `json:"responses,omitempty"` 1206 1207 // ServerResponse contains the HTTP response code and headers from the 1208 // server. 1209 googleapi.ServerResponse `json:"-"` 1210 1211 // ForceSendFields is a list of field names (e.g. "Responses") to 1212 // unconditionally include in API requests. By default, fields with 1213 // empty values are omitted from API requests. However, any non-pointer, 1214 // non-interface field appearing in ForceSendFields will be sent to the 1215 // server regardless of whether the field is empty or not. This may be 1216 // used to include empty fields in Patch requests. 1217 ForceSendFields []string `json:"-"` 1218 1219 // NullFields is a list of field names (e.g. "Responses") to include in 1220 // API requests with the JSON null value. By default, fields with empty 1221 // values are omitted from API requests. However, any field with an 1222 // empty value appearing in NullFields will be sent to the server as 1223 // null. It is an error if a field in this list has a non-empty value. 1224 // This may be used to include null fields in Patch requests. 1225 NullFields []string `json:"-"` 1226} 1227 1228func (s *GetPeopleResponse) MarshalJSON() ([]byte, error) { 1229 type NoMethod GetPeopleResponse 1230 raw := NoMethod(*s) 1231 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1232} 1233 1234// ImClient: A person's instant messaging client. 1235type ImClient struct { 1236 // FormattedProtocol: Output only. The protocol of the IM client 1237 // formatted in the viewer's account 1238 // locale or the `Accept-Language` HTTP header locale. 1239 FormattedProtocol string `json:"formattedProtocol,omitempty"` 1240 1241 // FormattedType: Output only. The type of the IM client translated and 1242 // formatted in the 1243 // viewer's account locale or the `Accept-Language` HTTP header locale. 1244 FormattedType string `json:"formattedType,omitempty"` 1245 1246 // Metadata: Metadata about the IM client. 1247 Metadata *FieldMetadata `json:"metadata,omitempty"` 1248 1249 // Protocol: The protocol of the IM client. The protocol can be custom 1250 // or one of these 1251 // predefined values: 1252 // 1253 // * `aim` 1254 // * `msn` 1255 // * `yahoo` 1256 // * `skype` 1257 // * `qq` 1258 // * `googleTalk` 1259 // * `icq` 1260 // * `jabber` 1261 // * `netMeeting` 1262 Protocol string `json:"protocol,omitempty"` 1263 1264 // Type: The type of the IM client. The type can be custom or one of 1265 // these 1266 // predefined values: 1267 // 1268 // * `home` 1269 // * `work` 1270 // * `other` 1271 Type string `json:"type,omitempty"` 1272 1273 // Username: The user name used in the IM client. 1274 Username string `json:"username,omitempty"` 1275 1276 // ForceSendFields is a list of field names (e.g. "FormattedProtocol") 1277 // to unconditionally include in API requests. By default, fields with 1278 // empty values are omitted from API requests. However, any non-pointer, 1279 // non-interface field appearing in ForceSendFields will be sent to the 1280 // server regardless of whether the field is empty or not. This may be 1281 // used to include empty fields in Patch requests. 1282 ForceSendFields []string `json:"-"` 1283 1284 // NullFields is a list of field names (e.g. "FormattedProtocol") to 1285 // include in API requests with the JSON null value. By default, fields 1286 // with empty values are omitted from API requests. However, any field 1287 // with an empty value appearing in NullFields will be sent to the 1288 // server as null. It is an error if a field in this list has a 1289 // non-empty value. This may be used to include null fields in Patch 1290 // requests. 1291 NullFields []string `json:"-"` 1292} 1293 1294func (s *ImClient) MarshalJSON() ([]byte, error) { 1295 type NoMethod ImClient 1296 raw := NoMethod(*s) 1297 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1298} 1299 1300// Interest: One of the person's interests. 1301type Interest struct { 1302 // Metadata: Metadata about the interest. 1303 Metadata *FieldMetadata `json:"metadata,omitempty"` 1304 1305 // Value: The interest; for example, `stargazing`. 1306 Value string `json:"value,omitempty"` 1307 1308 // ForceSendFields is a list of field names (e.g. "Metadata") to 1309 // unconditionally include in API requests. By default, fields with 1310 // empty values are omitted from API requests. However, any non-pointer, 1311 // non-interface field appearing in ForceSendFields will be sent to the 1312 // server regardless of whether the field is empty or not. This may be 1313 // used to include empty fields in Patch requests. 1314 ForceSendFields []string `json:"-"` 1315 1316 // NullFields is a list of field names (e.g. "Metadata") to include in 1317 // API requests with the JSON null value. By default, fields with empty 1318 // values are omitted from API requests. However, any field with an 1319 // empty value appearing in NullFields will be sent to the server as 1320 // null. It is an error if a field in this list has a non-empty value. 1321 // This may be used to include null fields in Patch requests. 1322 NullFields []string `json:"-"` 1323} 1324 1325func (s *Interest) MarshalJSON() ([]byte, error) { 1326 type NoMethod Interest 1327 raw := NoMethod(*s) 1328 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1329} 1330 1331// ListConnectionsResponse: The response to a request for the 1332// authenticated user's connections. 1333type ListConnectionsResponse struct { 1334 // Connections: The list of people that the requestor is connected to. 1335 Connections []*Person `json:"connections,omitempty"` 1336 1337 // NextPageToken: A token, which can be sent as `page_token` to retrieve 1338 // the next page. 1339 // If this field is omitted, there are no subsequent pages. 1340 NextPageToken string `json:"nextPageToken,omitempty"` 1341 1342 // NextSyncToken: A token, which can be sent as `sync_token` to retrieve 1343 // changes since the 1344 // last request. Request must set `request_sync_token` to return the 1345 // sync 1346 // token. 1347 NextSyncToken string `json:"nextSyncToken,omitempty"` 1348 1349 // TotalItems: The total number of items in the list without pagination. 1350 TotalItems int64 `json:"totalItems,omitempty"` 1351 1352 // TotalPeople: **DEPRECATED** (Please use totalItems) 1353 // The total number of people in the list without pagination. 1354 TotalPeople int64 `json:"totalPeople,omitempty"` 1355 1356 // ServerResponse contains the HTTP response code and headers from the 1357 // server. 1358 googleapi.ServerResponse `json:"-"` 1359 1360 // ForceSendFields is a list of field names (e.g. "Connections") to 1361 // unconditionally include in API requests. By default, fields with 1362 // empty values are omitted from API requests. However, any non-pointer, 1363 // non-interface field appearing in ForceSendFields will be sent to the 1364 // server regardless of whether the field is empty or not. This may be 1365 // used to include empty fields in Patch requests. 1366 ForceSendFields []string `json:"-"` 1367 1368 // NullFields is a list of field names (e.g. "Connections") to include 1369 // in API requests with the JSON null value. By default, fields with 1370 // empty values are omitted from API requests. However, any field with 1371 // an empty value appearing in NullFields will be sent to the server as 1372 // null. It is an error if a field in this list has a non-empty value. 1373 // This may be used to include null fields in Patch requests. 1374 NullFields []string `json:"-"` 1375} 1376 1377func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) { 1378 type NoMethod ListConnectionsResponse 1379 raw := NoMethod(*s) 1380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1381} 1382 1383// ListContactGroupsResponse: The response to a list contact groups 1384// request. 1385type ListContactGroupsResponse struct { 1386 // ContactGroups: The list of contact groups. Members of the contact 1387 // groups are not 1388 // populated. 1389 ContactGroups []*ContactGroup `json:"contactGroups,omitempty"` 1390 1391 // NextPageToken: The token that can be used to retrieve the next page 1392 // of results. 1393 NextPageToken string `json:"nextPageToken,omitempty"` 1394 1395 // NextSyncToken: The token that can be used to retrieve changes since 1396 // the last request. 1397 NextSyncToken string `json:"nextSyncToken,omitempty"` 1398 1399 // TotalItems: The total number of items in the list without pagination. 1400 TotalItems int64 `json:"totalItems,omitempty"` 1401 1402 // ServerResponse contains the HTTP response code and headers from the 1403 // server. 1404 googleapi.ServerResponse `json:"-"` 1405 1406 // ForceSendFields is a list of field names (e.g. "ContactGroups") to 1407 // unconditionally include in API requests. By default, fields with 1408 // empty values are omitted from API requests. However, any non-pointer, 1409 // non-interface field appearing in ForceSendFields will be sent to the 1410 // server regardless of whether the field is empty or not. This may be 1411 // used to include empty fields in Patch requests. 1412 ForceSendFields []string `json:"-"` 1413 1414 // NullFields is a list of field names (e.g. "ContactGroups") to include 1415 // in API requests with the JSON null value. By default, fields with 1416 // empty values are omitted from API requests. However, any field with 1417 // an empty value appearing in NullFields will be sent to the server as 1418 // null. It is an error if a field in this list has a non-empty value. 1419 // This may be used to include null fields in Patch requests. 1420 NullFields []string `json:"-"` 1421} 1422 1423func (s *ListContactGroupsResponse) MarshalJSON() ([]byte, error) { 1424 type NoMethod ListContactGroupsResponse 1425 raw := NoMethod(*s) 1426 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1427} 1428 1429// ListDirectoryPeopleResponse: The response to a request for the 1430// authenticated user's domain directory. 1431type ListDirectoryPeopleResponse struct { 1432 // NextPageToken: A token, which can be sent as `page_token` to retrieve 1433 // the next page. 1434 // If this field is omitted, there are no subsequent pages. 1435 NextPageToken string `json:"nextPageToken,omitempty"` 1436 1437 // NextSyncToken: A token, which can be sent as `sync_token` to retrieve 1438 // changes since the 1439 // last request. Request must set `request_sync_token` to return the 1440 // sync 1441 // token. 1442 NextSyncToken string `json:"nextSyncToken,omitempty"` 1443 1444 // People: The list of people in the domain directory. 1445 People []*Person `json:"people,omitempty"` 1446 1447 // ServerResponse contains the HTTP response code and headers from the 1448 // server. 1449 googleapi.ServerResponse `json:"-"` 1450 1451 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1452 // unconditionally include in API requests. By default, fields with 1453 // empty values are omitted from API requests. However, any non-pointer, 1454 // non-interface field appearing in ForceSendFields will be sent to the 1455 // server regardless of whether the field is empty or not. This may be 1456 // used to include empty fields in Patch requests. 1457 ForceSendFields []string `json:"-"` 1458 1459 // NullFields is a list of field names (e.g. "NextPageToken") to include 1460 // in API requests with the JSON null value. By default, fields with 1461 // empty values are omitted from API requests. However, any field with 1462 // an empty value appearing in NullFields will be sent to the server as 1463 // null. It is an error if a field in this list has a non-empty value. 1464 // This may be used to include null fields in Patch requests. 1465 NullFields []string `json:"-"` 1466} 1467 1468func (s *ListDirectoryPeopleResponse) MarshalJSON() ([]byte, error) { 1469 type NoMethod ListDirectoryPeopleResponse 1470 raw := NoMethod(*s) 1471 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1472} 1473 1474// ListOtherContactsResponse: The response to a request for the 1475// authenticated user's "Other contacts". 1476type ListOtherContactsResponse struct { 1477 // NextPageToken: A token, which can be sent as `page_token` to retrieve 1478 // the next page. 1479 // If this field is omitted, there are no subsequent pages. 1480 NextPageToken string `json:"nextPageToken,omitempty"` 1481 1482 // NextSyncToken: A token, which can be sent as `sync_token` to retrieve 1483 // changes since the 1484 // last request. Request must set `request_sync_token` to return the 1485 // sync 1486 // token. 1487 NextSyncToken string `json:"nextSyncToken,omitempty"` 1488 1489 // OtherContacts: The list of "Other contacts" returned as Person 1490 // resources. "Other contacts" 1491 // support a limited subset of fields. 1492 // See 1493 // ListOtherContactsRequest.request_mask for more detailed information. 1494 OtherContacts []*Person `json:"otherContacts,omitempty"` 1495 1496 // ServerResponse contains the HTTP response code and headers from the 1497 // server. 1498 googleapi.ServerResponse `json:"-"` 1499 1500 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1501 // unconditionally include in API requests. By default, fields with 1502 // empty values are omitted from API requests. However, any non-pointer, 1503 // non-interface field appearing in ForceSendFields will be sent to the 1504 // server regardless of whether the field is empty or not. This may be 1505 // used to include empty fields in Patch requests. 1506 ForceSendFields []string `json:"-"` 1507 1508 // NullFields is a list of field names (e.g. "NextPageToken") to include 1509 // in API requests with the JSON null value. By default, fields with 1510 // empty values are omitted from API requests. However, any field with 1511 // an empty value appearing in NullFields will be sent to the server as 1512 // null. It is an error if a field in this list has a non-empty value. 1513 // This may be used to include null fields in Patch requests. 1514 NullFields []string `json:"-"` 1515} 1516 1517func (s *ListOtherContactsResponse) MarshalJSON() ([]byte, error) { 1518 type NoMethod ListOtherContactsResponse 1519 raw := NoMethod(*s) 1520 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1521} 1522 1523// Locale: A person's locale preference. 1524type Locale struct { 1525 // Metadata: Metadata about the locale. 1526 Metadata *FieldMetadata `json:"metadata,omitempty"` 1527 1528 // Value: The well-formed [IETF BCP 1529 // 47](https://tools.ietf.org/html/bcp47) 1530 // language tag representing the locale. 1531 Value string `json:"value,omitempty"` 1532 1533 // ForceSendFields is a list of field names (e.g. "Metadata") to 1534 // unconditionally include in API requests. By default, fields with 1535 // empty values are omitted from API requests. However, any non-pointer, 1536 // non-interface field appearing in ForceSendFields will be sent to the 1537 // server regardless of whether the field is empty or not. This may be 1538 // used to include empty fields in Patch requests. 1539 ForceSendFields []string `json:"-"` 1540 1541 // NullFields is a list of field names (e.g. "Metadata") to include in 1542 // API requests with the JSON null value. By default, fields with empty 1543 // values are omitted from API requests. However, any field with an 1544 // empty value appearing in NullFields will be sent to the server as 1545 // null. It is an error if a field in this list has a non-empty value. 1546 // This may be used to include null fields in Patch requests. 1547 NullFields []string `json:"-"` 1548} 1549 1550func (s *Locale) MarshalJSON() ([]byte, error) { 1551 type NoMethod Locale 1552 raw := NoMethod(*s) 1553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1554} 1555 1556// Membership: A person's membership in a group. Only contact group 1557// memberships can be 1558// modified. 1559type Membership struct { 1560 // ContactGroupMembership: The contact group membership. 1561 ContactGroupMembership *ContactGroupMembership `json:"contactGroupMembership,omitempty"` 1562 1563 // DomainMembership: Output only. The domain membership. 1564 DomainMembership *DomainMembership `json:"domainMembership,omitempty"` 1565 1566 // Metadata: Metadata about the membership. 1567 Metadata *FieldMetadata `json:"metadata,omitempty"` 1568 1569 // ForceSendFields is a list of field names (e.g. 1570 // "ContactGroupMembership") to unconditionally include in API requests. 1571 // By default, fields with empty values are omitted from API requests. 1572 // However, any non-pointer, non-interface field appearing in 1573 // ForceSendFields will be sent to the server regardless of whether the 1574 // field is empty or not. This may be used to include empty fields in 1575 // Patch requests. 1576 ForceSendFields []string `json:"-"` 1577 1578 // NullFields is a list of field names (e.g. "ContactGroupMembership") 1579 // to include in API requests with the JSON null value. By default, 1580 // fields with empty values are omitted from API requests. However, any 1581 // field with an empty value appearing in NullFields will be sent to the 1582 // server as null. It is an error if a field in this list has a 1583 // non-empty value. This may be used to include null fields in Patch 1584 // requests. 1585 NullFields []string `json:"-"` 1586} 1587 1588func (s *Membership) MarshalJSON() ([]byte, error) { 1589 type NoMethod Membership 1590 raw := NoMethod(*s) 1591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1592} 1593 1594// ModifyContactGroupMembersRequest: A request to modify an existing 1595// contact group's members. Contacts can be 1596// removed from any group but they can only be added to a user group 1597// or 1598// "myContacts" or "starred" system groups. 1599type ModifyContactGroupMembersRequest struct { 1600 // ResourceNamesToAdd: Optional. The resource names of the contact 1601 // people to add in the form of 1602 // `people/{person_id}`. 1603 ResourceNamesToAdd []string `json:"resourceNamesToAdd,omitempty"` 1604 1605 // ResourceNamesToRemove: Optional. The resource names of the contact 1606 // people to remove in the form of 1607 // `people/{person_id}`. 1608 ResourceNamesToRemove []string `json:"resourceNamesToRemove,omitempty"` 1609 1610 // ForceSendFields is a list of field names (e.g. "ResourceNamesToAdd") 1611 // to unconditionally include in API requests. By default, fields with 1612 // empty values are omitted from API requests. However, any non-pointer, 1613 // non-interface field appearing in ForceSendFields will be sent to the 1614 // server regardless of whether the field is empty or not. This may be 1615 // used to include empty fields in Patch requests. 1616 ForceSendFields []string `json:"-"` 1617 1618 // NullFields is a list of field names (e.g. "ResourceNamesToAdd") to 1619 // include in API requests with the JSON null value. By default, fields 1620 // with empty values are omitted from API requests. However, any field 1621 // with an empty value appearing in NullFields will be sent to the 1622 // server as null. It is an error if a field in this list has a 1623 // non-empty value. This may be used to include null fields in Patch 1624 // requests. 1625 NullFields []string `json:"-"` 1626} 1627 1628func (s *ModifyContactGroupMembersRequest) MarshalJSON() ([]byte, error) { 1629 type NoMethod ModifyContactGroupMembersRequest 1630 raw := NoMethod(*s) 1631 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1632} 1633 1634// ModifyContactGroupMembersResponse: The response to a modify contact 1635// group members request. 1636type ModifyContactGroupMembersResponse struct { 1637 // CanNotRemoveLastContactGroupResourceNames: The contact people 1638 // resource names that cannot be removed from their 1639 // last contact group. 1640 CanNotRemoveLastContactGroupResourceNames []string `json:"canNotRemoveLastContactGroupResourceNames,omitempty"` 1641 1642 // NotFoundResourceNames: The contact people resource names that were 1643 // not found. 1644 NotFoundResourceNames []string `json:"notFoundResourceNames,omitempty"` 1645 1646 // ServerResponse contains the HTTP response code and headers from the 1647 // server. 1648 googleapi.ServerResponse `json:"-"` 1649 1650 // ForceSendFields is a list of field names (e.g. 1651 // "CanNotRemoveLastContactGroupResourceNames") to unconditionally 1652 // include in API requests. By default, fields with empty values are 1653 // omitted from API requests. However, any non-pointer, non-interface 1654 // field appearing in ForceSendFields will be sent to the server 1655 // regardless of whether the field is empty or not. This may be used to 1656 // include empty fields in Patch requests. 1657 ForceSendFields []string `json:"-"` 1658 1659 // NullFields is a list of field names (e.g. 1660 // "CanNotRemoveLastContactGroupResourceNames") to include in API 1661 // requests with the JSON null value. By default, fields with empty 1662 // values are omitted from API requests. However, any field with an 1663 // empty value appearing in NullFields will be sent to the server as 1664 // null. It is an error if a field in this list has a non-empty value. 1665 // This may be used to include null fields in Patch requests. 1666 NullFields []string `json:"-"` 1667} 1668 1669func (s *ModifyContactGroupMembersResponse) MarshalJSON() ([]byte, error) { 1670 type NoMethod ModifyContactGroupMembersResponse 1671 raw := NoMethod(*s) 1672 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1673} 1674 1675// Name: A person's name. If the name is a mononym, the family name is 1676// empty. 1677type Name struct { 1678 // DisplayName: Output only. The display name formatted according to the 1679 // locale specified by 1680 // the viewer's account or the `Accept-Language` HTTP header. 1681 DisplayName string `json:"displayName,omitempty"` 1682 1683 // DisplayNameLastFirst: Output only. The display name with the last 1684 // name first formatted according to 1685 // the locale specified by the viewer's account or the 1686 // `Accept-Language` HTTP header. 1687 DisplayNameLastFirst string `json:"displayNameLastFirst,omitempty"` 1688 1689 // FamilyName: The family name. 1690 FamilyName string `json:"familyName,omitempty"` 1691 1692 // GivenName: The given name. 1693 GivenName string `json:"givenName,omitempty"` 1694 1695 // HonorificPrefix: The honorific prefixes, such as `Mrs.` or `Dr.` 1696 HonorificPrefix string `json:"honorificPrefix,omitempty"` 1697 1698 // HonorificSuffix: The honorific suffixes, such as `Jr.` 1699 HonorificSuffix string `json:"honorificSuffix,omitempty"` 1700 1701 // Metadata: Metadata about the name. 1702 Metadata *FieldMetadata `json:"metadata,omitempty"` 1703 1704 // MiddleName: The middle name(s). 1705 MiddleName string `json:"middleName,omitempty"` 1706 1707 // PhoneticFamilyName: The family name spelled as it sounds. 1708 PhoneticFamilyName string `json:"phoneticFamilyName,omitempty"` 1709 1710 // PhoneticFullName: The full name spelled as it sounds. 1711 PhoneticFullName string `json:"phoneticFullName,omitempty"` 1712 1713 // PhoneticGivenName: The given name spelled as it sounds. 1714 PhoneticGivenName string `json:"phoneticGivenName,omitempty"` 1715 1716 // PhoneticHonorificPrefix: The honorific prefixes spelled as they 1717 // sound. 1718 PhoneticHonorificPrefix string `json:"phoneticHonorificPrefix,omitempty"` 1719 1720 // PhoneticHonorificSuffix: The honorific suffixes spelled as they 1721 // sound. 1722 PhoneticHonorificSuffix string `json:"phoneticHonorificSuffix,omitempty"` 1723 1724 // PhoneticMiddleName: The middle name(s) spelled as they sound. 1725 PhoneticMiddleName string `json:"phoneticMiddleName,omitempty"` 1726 1727 // UnstructuredName: The free form name value. 1728 UnstructuredName string `json:"unstructuredName,omitempty"` 1729 1730 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1731 // unconditionally include in API requests. By default, fields with 1732 // empty values are omitted from API requests. However, any non-pointer, 1733 // non-interface field appearing in ForceSendFields will be sent to the 1734 // server regardless of whether the field is empty or not. This may be 1735 // used to include empty fields in Patch requests. 1736 ForceSendFields []string `json:"-"` 1737 1738 // NullFields is a list of field names (e.g. "DisplayName") to include 1739 // in API requests with the JSON null value. By default, fields with 1740 // empty values are omitted from API requests. However, any field with 1741 // an empty value appearing in NullFields will be sent to the server as 1742 // null. It is an error if a field in this list has a non-empty value. 1743 // This may be used to include null fields in Patch requests. 1744 NullFields []string `json:"-"` 1745} 1746 1747func (s *Name) MarshalJSON() ([]byte, error) { 1748 type NoMethod Name 1749 raw := NoMethod(*s) 1750 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1751} 1752 1753// Nickname: A person's nickname. 1754type Nickname struct { 1755 // Metadata: Metadata about the nickname. 1756 Metadata *FieldMetadata `json:"metadata,omitempty"` 1757 1758 // Type: The type of the nickname. 1759 // 1760 // Possible values: 1761 // "DEFAULT" - Generic nickname. 1762 // "MAIDEN_NAME" - Maiden name or birth family name. Used when the 1763 // person's family name has 1764 // changed as a result of marriage. 1765 // "INITIALS" - Initials. 1766 // "GPLUS" - Google+ profile nickname. 1767 // "OTHER_NAME" - A professional affiliation or other name; for 1768 // example, `Dr. Smith.` 1769 // "ALTERNATE_NAME" - Alternate name person is known by. 1770 // "SHORT_NAME" - A shorter version of the person's name. 1771 Type string `json:"type,omitempty"` 1772 1773 // Value: The nickname. 1774 Value string `json:"value,omitempty"` 1775 1776 // ForceSendFields is a list of field names (e.g. "Metadata") to 1777 // unconditionally include in API requests. By default, fields with 1778 // empty values are omitted from API requests. However, any non-pointer, 1779 // non-interface field appearing in ForceSendFields will be sent to the 1780 // server regardless of whether the field is empty or not. This may be 1781 // used to include empty fields in Patch requests. 1782 ForceSendFields []string `json:"-"` 1783 1784 // NullFields is a list of field names (e.g. "Metadata") to include in 1785 // API requests with the JSON null value. By default, fields with empty 1786 // values are omitted from API requests. However, any field with an 1787 // empty value appearing in NullFields will be sent to the server as 1788 // null. It is an error if a field in this list has a non-empty value. 1789 // This may be used to include null fields in Patch requests. 1790 NullFields []string `json:"-"` 1791} 1792 1793func (s *Nickname) MarshalJSON() ([]byte, error) { 1794 type NoMethod Nickname 1795 raw := NoMethod(*s) 1796 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1797} 1798 1799// Occupation: A person's occupation. 1800type Occupation struct { 1801 // Metadata: Metadata about the occupation. 1802 Metadata *FieldMetadata `json:"metadata,omitempty"` 1803 1804 // Value: The occupation; for example, `carpenter`. 1805 Value string `json:"value,omitempty"` 1806 1807 // ForceSendFields is a list of field names (e.g. "Metadata") to 1808 // unconditionally include in API requests. By default, fields with 1809 // empty values are omitted from API requests. However, any non-pointer, 1810 // non-interface field appearing in ForceSendFields will be sent to the 1811 // server regardless of whether the field is empty or not. This may be 1812 // used to include empty fields in Patch requests. 1813 ForceSendFields []string `json:"-"` 1814 1815 // NullFields is a list of field names (e.g. "Metadata") to include in 1816 // API requests with the JSON null value. By default, fields with empty 1817 // values are omitted from API requests. However, any field with an 1818 // empty value appearing in NullFields will be sent to the server as 1819 // null. It is an error if a field in this list has a non-empty value. 1820 // This may be used to include null fields in Patch requests. 1821 NullFields []string `json:"-"` 1822} 1823 1824func (s *Occupation) MarshalJSON() ([]byte, error) { 1825 type NoMethod Occupation 1826 raw := NoMethod(*s) 1827 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1828} 1829 1830// Organization: A person's past or current organization. Overlapping 1831// date ranges are 1832// permitted. 1833type Organization struct { 1834 // Current: True if the organization is the person's current 1835 // organization; 1836 // false if the organization is a past organization. 1837 Current bool `json:"current,omitempty"` 1838 1839 // Department: The person's department at the organization. 1840 Department string `json:"department,omitempty"` 1841 1842 // Domain: The domain name associated with the organization; for 1843 // example, 1844 // `google.com`. 1845 Domain string `json:"domain,omitempty"` 1846 1847 // EndDate: The end date when the person left the organization. 1848 EndDate *Date `json:"endDate,omitempty"` 1849 1850 // FormattedType: Output only. The type of the organization translated 1851 // and formatted in the 1852 // viewer's account locale or the `Accept-Language` HTTP header locale. 1853 FormattedType string `json:"formattedType,omitempty"` 1854 1855 // JobDescription: The person's job description at the organization. 1856 JobDescription string `json:"jobDescription,omitempty"` 1857 1858 // Location: The location of the organization office the person works 1859 // at. 1860 Location string `json:"location,omitempty"` 1861 1862 // Metadata: Metadata about the organization. 1863 Metadata *FieldMetadata `json:"metadata,omitempty"` 1864 1865 // Name: The name of the organization. 1866 Name string `json:"name,omitempty"` 1867 1868 // PhoneticName: The phonetic name of the organization. 1869 PhoneticName string `json:"phoneticName,omitempty"` 1870 1871 // StartDate: The start date when the person joined the organization. 1872 StartDate *Date `json:"startDate,omitempty"` 1873 1874 // Symbol: The symbol associated with the organization; for example, a 1875 // stock ticker 1876 // symbol, abbreviation, or acronym. 1877 Symbol string `json:"symbol,omitempty"` 1878 1879 // Title: The person's job title at the organization. 1880 Title string `json:"title,omitempty"` 1881 1882 // Type: The type of the organization. The type can be custom or one of 1883 // these 1884 // predefined values: 1885 // 1886 // * `work` 1887 // * `school` 1888 Type string `json:"type,omitempty"` 1889 1890 // ForceSendFields is a list of field names (e.g. "Current") to 1891 // unconditionally include in API requests. By default, fields with 1892 // empty values are omitted from API requests. However, any non-pointer, 1893 // non-interface field appearing in ForceSendFields will be sent to the 1894 // server regardless of whether the field is empty or not. This may be 1895 // used to include empty fields in Patch requests. 1896 ForceSendFields []string `json:"-"` 1897 1898 // NullFields is a list of field names (e.g. "Current") to include in 1899 // API requests with the JSON null value. By default, fields with empty 1900 // values are omitted from API requests. However, any field with an 1901 // empty value appearing in NullFields will be sent to the server as 1902 // null. It is an error if a field in this list has a non-empty value. 1903 // This may be used to include null fields in Patch requests. 1904 NullFields []string `json:"-"` 1905} 1906 1907func (s *Organization) MarshalJSON() ([]byte, error) { 1908 type NoMethod Organization 1909 raw := NoMethod(*s) 1910 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1911} 1912 1913// Person: Information about a person merged from various data sources 1914// such as the 1915// authenticated user's contacts and profile data. 1916// 1917// Most fields can have multiple items. The items in a field have no 1918// guaranteed 1919// order, but each non-empty field is guaranteed to have exactly one 1920// field with 1921// `metadata.primary` set to true. 1922type Person struct { 1923 // Addresses: The person's street addresses. 1924 Addresses []*Address `json:"addresses,omitempty"` 1925 1926 // AgeRange: Output only. **DEPRECATED** (Please use `person.ageRanges` 1927 // instead) 1928 // 1929 // The person's age range. 1930 // 1931 // Possible values: 1932 // "AGE_RANGE_UNSPECIFIED" - Unspecified. 1933 // "LESS_THAN_EIGHTEEN" - Younger than eighteen. 1934 // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty. 1935 // "TWENTY_ONE_OR_OLDER" - Twenty-one and older. 1936 AgeRange string `json:"ageRange,omitempty"` 1937 1938 // AgeRanges: Output only. The person's age ranges. 1939 AgeRanges []*AgeRangeType `json:"ageRanges,omitempty"` 1940 1941 // Biographies: The person's biographies. 1942 Biographies []*Biography `json:"biographies,omitempty"` 1943 1944 // Birthdays: The person's birthdays. 1945 Birthdays []*Birthday `json:"birthdays,omitempty"` 1946 1947 // BraggingRights: **DEPRECATED**: No data will be returned 1948 // The person's bragging rights. 1949 BraggingRights []*BraggingRights `json:"braggingRights,omitempty"` 1950 1951 // CoverPhotos: Output only. The person's cover photos. 1952 CoverPhotos []*CoverPhoto `json:"coverPhotos,omitempty"` 1953 1954 // EmailAddresses: The person's email addresses. 1955 EmailAddresses []*EmailAddress `json:"emailAddresses,omitempty"` 1956 1957 // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) 1958 // of the 1959 // resource. Used for web cache validation. 1960 Etag string `json:"etag,omitempty"` 1961 1962 // Events: The person's events. 1963 Events []*Event `json:"events,omitempty"` 1964 1965 // FileAses: The person's file-ases. 1966 FileAses []*FileAs `json:"fileAses,omitempty"` 1967 1968 // Genders: The person's genders. 1969 Genders []*Gender `json:"genders,omitempty"` 1970 1971 // ImClients: The person's instant messaging clients. 1972 ImClients []*ImClient `json:"imClients,omitempty"` 1973 1974 // Interests: The person's interests. 1975 Interests []*Interest `json:"interests,omitempty"` 1976 1977 // Locales: The person's locale preferences. 1978 Locales []*Locale `json:"locales,omitempty"` 1979 1980 // Memberships: The person's group memberships. 1981 Memberships []*Membership `json:"memberships,omitempty"` 1982 1983 // Metadata: Output only. Metadata about the person. 1984 Metadata *PersonMetadata `json:"metadata,omitempty"` 1985 1986 // Names: The person's names. 1987 Names []*Name `json:"names,omitempty"` 1988 1989 // Nicknames: The person's nicknames. 1990 Nicknames []*Nickname `json:"nicknames,omitempty"` 1991 1992 // Occupations: The person's occupations. 1993 Occupations []*Occupation `json:"occupations,omitempty"` 1994 1995 // Organizations: The person's past or current organizations. 1996 Organizations []*Organization `json:"organizations,omitempty"` 1997 1998 // PhoneNumbers: The person's phone numbers. 1999 PhoneNumbers []*PhoneNumber `json:"phoneNumbers,omitempty"` 2000 2001 // Photos: Output only. The person's photos. 2002 Photos []*Photo `json:"photos,omitempty"` 2003 2004 // Relations: The person's relations. 2005 Relations []*Relation `json:"relations,omitempty"` 2006 2007 // RelationshipInterests: Output only. **DEPRECATED**: No data will be 2008 // returned 2009 // The person's relationship interests. 2010 RelationshipInterests []*RelationshipInterest `json:"relationshipInterests,omitempty"` 2011 2012 // RelationshipStatuses: Output only. **DEPRECATED**: No data will be 2013 // returned 2014 // The person's relationship statuses. 2015 RelationshipStatuses []*RelationshipStatus `json:"relationshipStatuses,omitempty"` 2016 2017 // Residences: The person's residences. 2018 Residences []*Residence `json:"residences,omitempty"` 2019 2020 // ResourceName: The resource name for the person, assigned by the 2021 // server. An ASCII string 2022 // with a max length of 27 characters, in the form 2023 // of 2024 // `people/{person_id}`. 2025 ResourceName string `json:"resourceName,omitempty"` 2026 2027 // SipAddresses: The person's SIP addresses. 2028 SipAddresses []*SipAddress `json:"sipAddresses,omitempty"` 2029 2030 // Skills: The person's skills. 2031 Skills []*Skill `json:"skills,omitempty"` 2032 2033 // Taglines: Output only. **DEPRECATED**: No data will be returned 2034 // The person's taglines. 2035 Taglines []*Tagline `json:"taglines,omitempty"` 2036 2037 // Urls: The person's associated URLs. 2038 Urls []*Url `json:"urls,omitempty"` 2039 2040 // UserDefined: The person's user defined data. 2041 UserDefined []*UserDefined `json:"userDefined,omitempty"` 2042 2043 // ServerResponse contains the HTTP response code and headers from the 2044 // server. 2045 googleapi.ServerResponse `json:"-"` 2046 2047 // ForceSendFields is a list of field names (e.g. "Addresses") to 2048 // unconditionally include in API requests. By default, fields with 2049 // empty values are omitted from API requests. However, any non-pointer, 2050 // non-interface field appearing in ForceSendFields will be sent to the 2051 // server regardless of whether the field is empty or not. This may be 2052 // used to include empty fields in Patch requests. 2053 ForceSendFields []string `json:"-"` 2054 2055 // NullFields is a list of field names (e.g. "Addresses") to include in 2056 // API requests with the JSON null value. By default, fields with empty 2057 // values are omitted from API requests. However, any field with an 2058 // empty value appearing in NullFields will be sent to the server as 2059 // null. It is an error if a field in this list has a non-empty value. 2060 // This may be used to include null fields in Patch requests. 2061 NullFields []string `json:"-"` 2062} 2063 2064func (s *Person) MarshalJSON() ([]byte, error) { 2065 type NoMethod Person 2066 raw := NoMethod(*s) 2067 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2068} 2069 2070// PersonMetadata: The metadata about a person. 2071type PersonMetadata struct { 2072 // Deleted: Output only. True if the person resource has been deleted. 2073 // Populated only 2074 // for 2075 // [`connections.list`](/people/api/rest/v1/people.connections/list) 2076 // requests 2077 // that include a sync token. 2078 Deleted bool `json:"deleted,omitempty"` 2079 2080 // LinkedPeopleResourceNames: Output only. Resource names of people 2081 // linked to this resource. 2082 LinkedPeopleResourceNames []string `json:"linkedPeopleResourceNames,omitempty"` 2083 2084 // ObjectType: Output only. **DEPRECATED** (Please 2085 // use 2086 // `person.metadata.sources.profileMetadata.objectType` instead) 2087 // 2088 // The type of the person object. 2089 // 2090 // Possible values: 2091 // "OBJECT_TYPE_UNSPECIFIED" - Unspecified. 2092 // "PERSON" - Person. 2093 // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/) 2094 ObjectType string `json:"objectType,omitempty"` 2095 2096 // PreviousResourceNames: Output only. Any former resource names this 2097 // person has had. Populated only 2098 // for 2099 // [`connections.list`](/people/api/rest/v1/people.connections/list) 2100 // requests 2101 // that include a sync token. 2102 // 2103 // The resource name may change when adding or removing fields that link 2104 // a 2105 // contact and profile such as a verified email, verified phone number, 2106 // or 2107 // profile URL. 2108 PreviousResourceNames []string `json:"previousResourceNames,omitempty"` 2109 2110 // Sources: The sources of data for the person. 2111 Sources []*Source `json:"sources,omitempty"` 2112 2113 // ForceSendFields is a list of field names (e.g. "Deleted") to 2114 // unconditionally include in API requests. By default, fields with 2115 // empty values are omitted from API requests. However, any non-pointer, 2116 // non-interface field appearing in ForceSendFields will be sent to the 2117 // server regardless of whether the field is empty or not. This may be 2118 // used to include empty fields in Patch requests. 2119 ForceSendFields []string `json:"-"` 2120 2121 // NullFields is a list of field names (e.g. "Deleted") to include in 2122 // API requests with the JSON null value. By default, fields with empty 2123 // values are omitted from API requests. However, any field with an 2124 // empty value appearing in NullFields will be sent to the server as 2125 // null. It is an error if a field in this list has a non-empty value. 2126 // This may be used to include null fields in Patch requests. 2127 NullFields []string `json:"-"` 2128} 2129 2130func (s *PersonMetadata) MarshalJSON() ([]byte, error) { 2131 type NoMethod PersonMetadata 2132 raw := NoMethod(*s) 2133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2134} 2135 2136// PersonResponse: The response for a single person 2137type PersonResponse struct { 2138 // HttpStatusCode: **DEPRECATED** (Please use status instead) 2139 // 2140 // [HTTP 1.1 status 2141 // code] 2142 // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). 2143 HttpStatusCode int64 `json:"httpStatusCode,omitempty"` 2144 2145 // Person: The person. 2146 Person *Person `json:"person,omitempty"` 2147 2148 // RequestedResourceName: The original requested resource name. May be 2149 // different than the resource 2150 // name on the returned person. 2151 // 2152 // The resource name can change when adding or removing fields that link 2153 // a 2154 // contact and profile such as a verified email, verified phone number, 2155 // or a 2156 // profile URL. 2157 RequestedResourceName string `json:"requestedResourceName,omitempty"` 2158 2159 // Status: The status of the response. 2160 Status *Status `json:"status,omitempty"` 2161 2162 // ForceSendFields is a list of field names (e.g. "HttpStatusCode") to 2163 // unconditionally include in API requests. By default, fields with 2164 // empty values are omitted from API requests. However, any non-pointer, 2165 // non-interface field appearing in ForceSendFields will be sent to the 2166 // server regardless of whether the field is empty or not. This may be 2167 // used to include empty fields in Patch requests. 2168 ForceSendFields []string `json:"-"` 2169 2170 // NullFields is a list of field names (e.g. "HttpStatusCode") to 2171 // include in API requests with the JSON null value. By default, fields 2172 // with empty values are omitted from API requests. However, any field 2173 // with an empty value appearing in NullFields will be sent to the 2174 // server as null. It is an error if a field in this list has a 2175 // non-empty value. This may be used to include null fields in Patch 2176 // requests. 2177 NullFields []string `json:"-"` 2178} 2179 2180func (s *PersonResponse) MarshalJSON() ([]byte, error) { 2181 type NoMethod PersonResponse 2182 raw := NoMethod(*s) 2183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2184} 2185 2186// PhoneNumber: A person's phone number. 2187type PhoneNumber struct { 2188 // CanonicalForm: Output only. The canonicalized 2189 // [ITU-T 2190 // E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164. 2191 // 1.2008.pdf) 2192 // form of the phone number. 2193 CanonicalForm string `json:"canonicalForm,omitempty"` 2194 2195 // FormattedType: Output only. The type of the phone number translated 2196 // and formatted in the 2197 // viewer's account locale or the `Accept-Language` HTTP header locale. 2198 FormattedType string `json:"formattedType,omitempty"` 2199 2200 // Metadata: Metadata about the phone number. 2201 Metadata *FieldMetadata `json:"metadata,omitempty"` 2202 2203 // Type: The type of the phone number. The type can be custom or one of 2204 // these 2205 // predefined values: 2206 // 2207 // * `home` 2208 // * `work` 2209 // * `mobile` 2210 // * `homeFax` 2211 // * `workFax` 2212 // * `otherFax` 2213 // * `pager` 2214 // * `workMobile` 2215 // * `workPager` 2216 // * `main` 2217 // * `googleVoice` 2218 // * `other` 2219 Type string `json:"type,omitempty"` 2220 2221 // Value: The phone number. 2222 Value string `json:"value,omitempty"` 2223 2224 // ForceSendFields is a list of field names (e.g. "CanonicalForm") to 2225 // unconditionally include in API requests. By default, fields with 2226 // empty values are omitted from API requests. However, any non-pointer, 2227 // non-interface field appearing in ForceSendFields will be sent to the 2228 // server regardless of whether the field is empty or not. This may be 2229 // used to include empty fields in Patch requests. 2230 ForceSendFields []string `json:"-"` 2231 2232 // NullFields is a list of field names (e.g. "CanonicalForm") to include 2233 // in API requests with the JSON null value. By default, fields with 2234 // empty values are omitted from API requests. However, any field with 2235 // an empty value appearing in NullFields will be sent to the server as 2236 // null. It is an error if a field in this list has a non-empty value. 2237 // This may be used to include null fields in Patch requests. 2238 NullFields []string `json:"-"` 2239} 2240 2241func (s *PhoneNumber) MarshalJSON() ([]byte, error) { 2242 type NoMethod PhoneNumber 2243 raw := NoMethod(*s) 2244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2245} 2246 2247// Photo: A person's photo. A picture shown next to the person's name 2248// to 2249// help others recognize the person. 2250type Photo struct { 2251 // Default: True if the photo is a default photo; 2252 // false if the photo is a user-provided photo. 2253 Default bool `json:"default,omitempty"` 2254 2255 // Metadata: Metadata about the photo. 2256 Metadata *FieldMetadata `json:"metadata,omitempty"` 2257 2258 // Url: The URL of the photo. You can change the desired size by 2259 // appending a query 2260 // parameter `sz={size}` at the end of the url, where {size} is the size 2261 // in 2262 // pixels. 2263 // Example: 2264 // https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AA 2265 // AAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50 2266 Url string `json:"url,omitempty"` 2267 2268 // ForceSendFields is a list of field names (e.g. "Default") to 2269 // unconditionally include in API requests. By default, fields with 2270 // empty values are omitted from API requests. However, any non-pointer, 2271 // non-interface field appearing in ForceSendFields will be sent to the 2272 // server regardless of whether the field is empty or not. This may be 2273 // used to include empty fields in Patch requests. 2274 ForceSendFields []string `json:"-"` 2275 2276 // NullFields is a list of field names (e.g. "Default") to include in 2277 // API requests with the JSON null value. By default, fields with empty 2278 // values are omitted from API requests. However, any field with an 2279 // empty value appearing in NullFields will be sent to the server as 2280 // null. It is an error if a field in this list has a non-empty value. 2281 // This may be used to include null fields in Patch requests. 2282 NullFields []string `json:"-"` 2283} 2284 2285func (s *Photo) MarshalJSON() ([]byte, error) { 2286 type NoMethod Photo 2287 raw := NoMethod(*s) 2288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2289} 2290 2291// ProfileMetadata: The metadata about a profile. 2292type ProfileMetadata struct { 2293 // ObjectType: Output only. The profile object type. 2294 // 2295 // Possible values: 2296 // "OBJECT_TYPE_UNSPECIFIED" - Unspecified. 2297 // "PERSON" - Person. 2298 // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/) 2299 ObjectType string `json:"objectType,omitempty"` 2300 2301 // UserTypes: Output only. The user types. 2302 // 2303 // Possible values: 2304 // "USER_TYPE_UNKNOWN" - The user type is not known. 2305 // "GOOGLE_USER" - The user is a Google user. 2306 // "GPLUS_USER" - The user is a Google+ user. 2307 // "GOOGLE_APPS_USER" - The user is a G Suite user. 2308 UserTypes []string `json:"userTypes,omitempty"` 2309 2310 // ForceSendFields is a list of field names (e.g. "ObjectType") to 2311 // unconditionally include in API requests. By default, fields with 2312 // empty values are omitted from API requests. However, any non-pointer, 2313 // non-interface field appearing in ForceSendFields will be sent to the 2314 // server regardless of whether the field is empty or not. This may be 2315 // used to include empty fields in Patch requests. 2316 ForceSendFields []string `json:"-"` 2317 2318 // NullFields is a list of field names (e.g. "ObjectType") to include in 2319 // API requests with the JSON null value. By default, fields with empty 2320 // values are omitted from API requests. However, any field with an 2321 // empty value appearing in NullFields will be sent to the server as 2322 // null. It is an error if a field in this list has a non-empty value. 2323 // This may be used to include null fields in Patch requests. 2324 NullFields []string `json:"-"` 2325} 2326 2327func (s *ProfileMetadata) MarshalJSON() ([]byte, error) { 2328 type NoMethod ProfileMetadata 2329 raw := NoMethod(*s) 2330 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2331} 2332 2333// Relation: A person's relation to another person. 2334type Relation struct { 2335 // FormattedType: Output only. The type of the relation translated and 2336 // formatted in the viewer's 2337 // account locale or the locale specified in the Accept-Language HTTP 2338 // header. 2339 FormattedType string `json:"formattedType,omitempty"` 2340 2341 // Metadata: Metadata about the relation. 2342 Metadata *FieldMetadata `json:"metadata,omitempty"` 2343 2344 // Person: The name of the other person this relation refers to. 2345 Person string `json:"person,omitempty"` 2346 2347 // Type: The person's relation to the other person. The type can be 2348 // custom or one of 2349 // these predefined values: 2350 // 2351 // * `spouse` 2352 // * `child` 2353 // * `mother` 2354 // * `father` 2355 // * `parent` 2356 // * `brother` 2357 // * `sister` 2358 // * `friend` 2359 // * `relative` 2360 // * `domesticPartner` 2361 // * `manager` 2362 // * `assistant` 2363 // * `referredBy` 2364 // * `partner` 2365 Type string `json:"type,omitempty"` 2366 2367 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2368 // unconditionally include in API requests. By default, fields with 2369 // empty values are omitted from API requests. However, any non-pointer, 2370 // non-interface field appearing in ForceSendFields will be sent to the 2371 // server regardless of whether the field is empty or not. This may be 2372 // used to include empty fields in Patch requests. 2373 ForceSendFields []string `json:"-"` 2374 2375 // NullFields is a list of field names (e.g. "FormattedType") to include 2376 // in API requests with the JSON null value. By default, fields with 2377 // empty values are omitted from API requests. However, any field with 2378 // an empty value appearing in NullFields will be sent to the server as 2379 // null. It is an error if a field in this list has a non-empty value. 2380 // This may be used to include null fields in Patch requests. 2381 NullFields []string `json:"-"` 2382} 2383 2384func (s *Relation) MarshalJSON() ([]byte, error) { 2385 type NoMethod Relation 2386 raw := NoMethod(*s) 2387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2388} 2389 2390// RelationshipInterest: **DEPRECATED**: No data will be returned 2391// A person's relationship interest . 2392type RelationshipInterest struct { 2393 // FormattedValue: Output only. The value of the relationship interest 2394 // translated and formatted 2395 // in the viewer's account locale or the locale specified in 2396 // the 2397 // Accept-Language HTTP header. 2398 FormattedValue string `json:"formattedValue,omitempty"` 2399 2400 // Metadata: Metadata about the relationship interest. 2401 Metadata *FieldMetadata `json:"metadata,omitempty"` 2402 2403 // Value: The kind of relationship the person is looking for. The value 2404 // can be custom 2405 // or one of these predefined values: 2406 // 2407 // * `friend` 2408 // * `date` 2409 // * `relationship` 2410 // * `networking` 2411 Value string `json:"value,omitempty"` 2412 2413 // ForceSendFields is a list of field names (e.g. "FormattedValue") to 2414 // unconditionally include in API requests. By default, fields with 2415 // empty values are omitted from API requests. However, any non-pointer, 2416 // non-interface field appearing in ForceSendFields will be sent to the 2417 // server regardless of whether the field is empty or not. This may be 2418 // used to include empty fields in Patch requests. 2419 ForceSendFields []string `json:"-"` 2420 2421 // NullFields is a list of field names (e.g. "FormattedValue") to 2422 // include in API requests with the JSON null value. By default, fields 2423 // with empty values are omitted from API requests. However, any field 2424 // with an empty value appearing in NullFields will be sent to the 2425 // server as null. It is an error if a field in this list has a 2426 // non-empty value. This may be used to include null fields in Patch 2427 // requests. 2428 NullFields []string `json:"-"` 2429} 2430 2431func (s *RelationshipInterest) MarshalJSON() ([]byte, error) { 2432 type NoMethod RelationshipInterest 2433 raw := NoMethod(*s) 2434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2435} 2436 2437// RelationshipStatus: **DEPRECATED**: No data will be returned 2438// A person's relationship status. 2439type RelationshipStatus struct { 2440 // FormattedValue: Output only. The value of the relationship status 2441 // translated and formatted in 2442 // the viewer's account locale or the `Accept-Language` HTTP header 2443 // locale. 2444 FormattedValue string `json:"formattedValue,omitempty"` 2445 2446 // Metadata: Metadata about the relationship status. 2447 Metadata *FieldMetadata `json:"metadata,omitempty"` 2448 2449 // Value: The relationship status. The value can be custom or one of 2450 // these 2451 // predefined values: 2452 // 2453 // * `single` 2454 // * `inARelationship` 2455 // * `engaged` 2456 // * `married` 2457 // * `itsComplicated` 2458 // * `openRelationship` 2459 // * `widowed` 2460 // * `inDomesticPartnership` 2461 // * `inCivilUnion` 2462 Value string `json:"value,omitempty"` 2463 2464 // ForceSendFields is a list of field names (e.g. "FormattedValue") to 2465 // unconditionally include in API requests. By default, fields with 2466 // empty values are omitted from API requests. However, any non-pointer, 2467 // non-interface field appearing in ForceSendFields will be sent to the 2468 // server regardless of whether the field is empty or not. This may be 2469 // used to include empty fields in Patch requests. 2470 ForceSendFields []string `json:"-"` 2471 2472 // NullFields is a list of field names (e.g. "FormattedValue") to 2473 // include in API requests with the JSON null value. By default, fields 2474 // with empty values are omitted from API requests. However, any field 2475 // with an empty value appearing in NullFields will be sent to the 2476 // server as null. It is an error if a field in this list has a 2477 // non-empty value. This may be used to include null fields in Patch 2478 // requests. 2479 NullFields []string `json:"-"` 2480} 2481 2482func (s *RelationshipStatus) MarshalJSON() ([]byte, error) { 2483 type NoMethod RelationshipStatus 2484 raw := NoMethod(*s) 2485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2486} 2487 2488// Residence: A person's past or current residence. 2489type Residence struct { 2490 // Current: True if the residence is the person's current 2491 // residence; 2492 // false if the residence is a past residence. 2493 Current bool `json:"current,omitempty"` 2494 2495 // Metadata: Metadata about the residence. 2496 Metadata *FieldMetadata `json:"metadata,omitempty"` 2497 2498 // Value: The address of the residence. 2499 Value string `json:"value,omitempty"` 2500 2501 // ForceSendFields is a list of field names (e.g. "Current") to 2502 // unconditionally include in API requests. By default, fields with 2503 // empty values are omitted from API requests. However, any non-pointer, 2504 // non-interface field appearing in ForceSendFields will be sent to the 2505 // server regardless of whether the field is empty or not. This may be 2506 // used to include empty fields in Patch requests. 2507 ForceSendFields []string `json:"-"` 2508 2509 // NullFields is a list of field names (e.g. "Current") to include in 2510 // API requests with the JSON null value. By default, fields with empty 2511 // values are omitted from API requests. However, any field with an 2512 // empty value appearing in NullFields will be sent to the server as 2513 // null. It is an error if a field in this list has a non-empty value. 2514 // This may be used to include null fields in Patch requests. 2515 NullFields []string `json:"-"` 2516} 2517 2518func (s *Residence) MarshalJSON() ([]byte, error) { 2519 type NoMethod Residence 2520 raw := NoMethod(*s) 2521 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2522} 2523 2524// SearchDirectoryPeopleResponse: The response to a request for people 2525// in the authenticated user's domain 2526// directory that match the specified query. 2527type SearchDirectoryPeopleResponse struct { 2528 // NextPageToken: A token, which can be sent as `page_token` to retrieve 2529 // the next page. 2530 // If this field is omitted, there are no subsequent pages. 2531 NextPageToken string `json:"nextPageToken,omitempty"` 2532 2533 // People: The list of people in the domain directory that match the 2534 // query. 2535 People []*Person `json:"people,omitempty"` 2536 2537 // TotalSize: The total number of items in the list without pagination. 2538 TotalSize int64 `json:"totalSize,omitempty"` 2539 2540 // ServerResponse contains the HTTP response code and headers from the 2541 // server. 2542 googleapi.ServerResponse `json:"-"` 2543 2544 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2545 // unconditionally include in API requests. By default, fields with 2546 // empty values are omitted from API requests. However, any non-pointer, 2547 // non-interface field appearing in ForceSendFields will be sent to the 2548 // server regardless of whether the field is empty or not. This may be 2549 // used to include empty fields in Patch requests. 2550 ForceSendFields []string `json:"-"` 2551 2552 // NullFields is a list of field names (e.g. "NextPageToken") to include 2553 // in API requests with the JSON null value. By default, fields with 2554 // empty values are omitted from API requests. However, any field with 2555 // an empty value appearing in NullFields will be sent to the server as 2556 // null. It is an error if a field in this list has a non-empty value. 2557 // This may be used to include null fields in Patch requests. 2558 NullFields []string `json:"-"` 2559} 2560 2561func (s *SearchDirectoryPeopleResponse) MarshalJSON() ([]byte, error) { 2562 type NoMethod SearchDirectoryPeopleResponse 2563 raw := NoMethod(*s) 2564 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2565} 2566 2567// SipAddress: A person's SIP address. Session Initial Protocol 2568// addresses are used for VoIP 2569// communications to make voice or video calls over the internet. 2570type SipAddress struct { 2571 // FormattedType: Output only. The type of the SIP address translated 2572 // and formatted in the 2573 // viewer's account locale or the `Accept-Language` HTTP header locale. 2574 FormattedType string `json:"formattedType,omitempty"` 2575 2576 // Metadata: Metadata about the SIP address. 2577 Metadata *FieldMetadata `json:"metadata,omitempty"` 2578 2579 // Type: The type of the SIP address. The type can be custom or or one 2580 // of these 2581 // predefined values: 2582 // 2583 // * `home` 2584 // * `work` 2585 // * `mobile` 2586 // * `other` 2587 Type string `json:"type,omitempty"` 2588 2589 // Value: The SIP address in the 2590 // [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP 2591 // URI 2592 // format. 2593 Value string `json:"value,omitempty"` 2594 2595 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2596 // unconditionally include in API requests. By default, fields with 2597 // empty values are omitted from API requests. However, any non-pointer, 2598 // non-interface field appearing in ForceSendFields will be sent to the 2599 // server regardless of whether the field is empty or not. This may be 2600 // used to include empty fields in Patch requests. 2601 ForceSendFields []string `json:"-"` 2602 2603 // NullFields is a list of field names (e.g. "FormattedType") to include 2604 // in API requests with the JSON null value. By default, fields with 2605 // empty values are omitted from API requests. However, any field with 2606 // an empty value appearing in NullFields will be sent to the server as 2607 // null. It is an error if a field in this list has a non-empty value. 2608 // This may be used to include null fields in Patch requests. 2609 NullFields []string `json:"-"` 2610} 2611 2612func (s *SipAddress) MarshalJSON() ([]byte, error) { 2613 type NoMethod SipAddress 2614 raw := NoMethod(*s) 2615 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2616} 2617 2618// Skill: A skill that the person has. 2619type Skill struct { 2620 // Metadata: Metadata about the skill. 2621 Metadata *FieldMetadata `json:"metadata,omitempty"` 2622 2623 // Value: The skill; for example, `underwater basket weaving`. 2624 Value string `json:"value,omitempty"` 2625 2626 // ForceSendFields is a list of field names (e.g. "Metadata") to 2627 // unconditionally include in API requests. By default, fields with 2628 // empty values are omitted from API requests. However, any non-pointer, 2629 // non-interface field appearing in ForceSendFields will be sent to the 2630 // server regardless of whether the field is empty or not. This may be 2631 // used to include empty fields in Patch requests. 2632 ForceSendFields []string `json:"-"` 2633 2634 // NullFields is a list of field names (e.g. "Metadata") to include in 2635 // API requests with the JSON null value. By default, fields with empty 2636 // values are omitted from API requests. However, any field with an 2637 // empty value appearing in NullFields will be sent to the server as 2638 // null. It is an error if a field in this list has a non-empty value. 2639 // This may be used to include null fields in Patch requests. 2640 NullFields []string `json:"-"` 2641} 2642 2643func (s *Skill) MarshalJSON() ([]byte, error) { 2644 type NoMethod Skill 2645 raw := NoMethod(*s) 2646 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2647} 2648 2649// Source: The source of a field. 2650type Source struct { 2651 // Etag: **Only populated in `person.metadata.sources`.** 2652 // 2653 // The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of 2654 // the 2655 // source. Used for web cache validation. 2656 Etag string `json:"etag,omitempty"` 2657 2658 // Id: The unique identifier within the source type generated by the 2659 // server. 2660 Id string `json:"id,omitempty"` 2661 2662 // ProfileMetadata: Output only. **Only populated in 2663 // `person.metadata.sources`.** 2664 // 2665 // Metadata about a source of type PROFILE. 2666 ProfileMetadata *ProfileMetadata `json:"profileMetadata,omitempty"` 2667 2668 // Type: The source type. 2669 // 2670 // Possible values: 2671 // "SOURCE_TYPE_UNSPECIFIED" - Unspecified. 2672 // "ACCOUNT" - [Google Account](https://accounts.google.com). 2673 // "PROFILE" - [Google profile](https://profiles.google.com). You can 2674 // view the 2675 // profile 2676 // at 2677 // [https://profiles.google.com/](https://profiles.google.com/){id}, 2678 // where 2679 // {id} is the source id. 2680 // "DOMAIN_PROFILE" - [G Suite domain 2681 // profile](https://support.google.com/a/answer/1628008). 2682 // "CONTACT" - [Google contact](https://contacts.google.com). You can 2683 // view the 2684 // contact 2685 // at 2686 // [https://contact.google.com/](https://contact.google.com/){id}, 2687 // where 2688 // {id} is the source id. 2689 // "OTHER_CONTACT" - [Google "Other 2690 // contact"](https://contacts.google.com/other). 2691 // "DOMAIN_CONTACT" - [G Suite domain 2692 // shared 2693 // contact](https://support.google.com/a/answer/9281635). 2694 Type string `json:"type,omitempty"` 2695 2696 // UpdateTime: Output only. **Only populated in 2697 // `person.metadata.sources`.** 2698 // 2699 // Last update timestamp of this source. 2700 UpdateTime string `json:"updateTime,omitempty"` 2701 2702 // ForceSendFields is a list of field names (e.g. "Etag") to 2703 // unconditionally include in API requests. By default, fields with 2704 // empty values are omitted from API requests. However, any non-pointer, 2705 // non-interface field appearing in ForceSendFields will be sent to the 2706 // server regardless of whether the field is empty or not. This may be 2707 // used to include empty fields in Patch requests. 2708 ForceSendFields []string `json:"-"` 2709 2710 // NullFields is a list of field names (e.g. "Etag") to include in API 2711 // requests with the JSON null value. By default, fields with empty 2712 // values are omitted from API requests. However, any field with an 2713 // empty value appearing in NullFields will be sent to the server as 2714 // null. It is an error if a field in this list has a non-empty value. 2715 // This may be used to include null fields in Patch requests. 2716 NullFields []string `json:"-"` 2717} 2718 2719func (s *Source) MarshalJSON() ([]byte, error) { 2720 type NoMethod Source 2721 raw := NoMethod(*s) 2722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2723} 2724 2725// Status: The `Status` type defines a logical error model that is 2726// suitable for 2727// different programming environments, including REST APIs and RPC APIs. 2728// It is 2729// used by [gRPC](https://github.com/grpc). Each `Status` message 2730// contains 2731// three pieces of data: error code, error message, and error 2732// details. 2733// 2734// You can find out more about this error model and how to work with it 2735// in the 2736// [API Design Guide](https://cloud.google.com/apis/design/errors). 2737type Status struct { 2738 // Code: The status code, which should be an enum value of 2739 // google.rpc.Code. 2740 Code int64 `json:"code,omitempty"` 2741 2742 // Details: A list of messages that carry the error details. There is a 2743 // common set of 2744 // message types for APIs to use. 2745 Details []googleapi.RawMessage `json:"details,omitempty"` 2746 2747 // Message: A developer-facing error message, which should be in 2748 // English. Any 2749 // user-facing error message should be localized and sent in 2750 // the 2751 // google.rpc.Status.details field, or localized by the client. 2752 Message string `json:"message,omitempty"` 2753 2754 // ForceSendFields is a list of field names (e.g. "Code") to 2755 // unconditionally include in API requests. By default, fields with 2756 // empty values are omitted from API requests. However, any non-pointer, 2757 // non-interface field appearing in ForceSendFields will be sent to the 2758 // server regardless of whether the field is empty or not. This may be 2759 // used to include empty fields in Patch requests. 2760 ForceSendFields []string `json:"-"` 2761 2762 // NullFields is a list of field names (e.g. "Code") to include in API 2763 // requests with the JSON null value. By default, fields with empty 2764 // values are omitted from API requests. However, any field with an 2765 // empty value appearing in NullFields will be sent to the server as 2766 // null. It is an error if a field in this list has a non-empty value. 2767 // This may be used to include null fields in Patch requests. 2768 NullFields []string `json:"-"` 2769} 2770 2771func (s *Status) MarshalJSON() ([]byte, error) { 2772 type NoMethod Status 2773 raw := NoMethod(*s) 2774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2775} 2776 2777// Tagline: **DEPRECATED**: No data will be returned 2778// A brief one-line description of the person. 2779type Tagline struct { 2780 // Metadata: Metadata about the tagline. 2781 Metadata *FieldMetadata `json:"metadata,omitempty"` 2782 2783 // Value: The tagline. 2784 Value string `json:"value,omitempty"` 2785 2786 // ForceSendFields is a list of field names (e.g. "Metadata") to 2787 // unconditionally include in API requests. By default, fields with 2788 // empty values are omitted from API requests. However, any non-pointer, 2789 // non-interface field appearing in ForceSendFields will be sent to the 2790 // server regardless of whether the field is empty or not. This may be 2791 // used to include empty fields in Patch requests. 2792 ForceSendFields []string `json:"-"` 2793 2794 // NullFields is a list of field names (e.g. "Metadata") to include in 2795 // API requests with the JSON null value. By default, fields with empty 2796 // values are omitted from API requests. However, any field with an 2797 // empty value appearing in NullFields will be sent to the server as 2798 // null. It is an error if a field in this list has a non-empty value. 2799 // This may be used to include null fields in Patch requests. 2800 NullFields []string `json:"-"` 2801} 2802 2803func (s *Tagline) MarshalJSON() ([]byte, error) { 2804 type NoMethod Tagline 2805 raw := NoMethod(*s) 2806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2807} 2808 2809// UpdateContactGroupRequest: A request to update an existing user 2810// contact group. All updated fields will 2811// be replaced. 2812type UpdateContactGroupRequest struct { 2813 // ContactGroup: Required. The contact group to update. 2814 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 2815 2816 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 2817 // unconditionally include in API requests. By default, fields with 2818 // empty values are omitted from API requests. However, any non-pointer, 2819 // non-interface field appearing in ForceSendFields will be sent to the 2820 // server regardless of whether the field is empty or not. This may be 2821 // used to include empty fields in Patch requests. 2822 ForceSendFields []string `json:"-"` 2823 2824 // NullFields is a list of field names (e.g. "ContactGroup") to include 2825 // in API requests with the JSON null value. By default, fields with 2826 // empty values are omitted from API requests. However, any field with 2827 // an 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 *UpdateContactGroupRequest) MarshalJSON() ([]byte, error) { 2834 type NoMethod UpdateContactGroupRequest 2835 raw := NoMethod(*s) 2836 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2837} 2838 2839// UpdateContactPhotoRequest: A request to update an existing contact's 2840// photo. 2841// All requests must have a valid photo format: JPEG or PNG. 2842type UpdateContactPhotoRequest struct { 2843 // PersonFields: Optional. A field mask to restrict which fields on the 2844 // person are returned. Multiple 2845 // fields can be specified by separating them with commas. Defaults to 2846 // empty 2847 // if not set, which will skip the post mutate get. Valid values are: 2848 // 2849 // * addresses 2850 // * ageRanges 2851 // * biographies 2852 // * birthdays 2853 // * coverPhotos 2854 // * emailAddresses 2855 // * events 2856 // * genders 2857 // * imClients 2858 // * interests 2859 // * locales 2860 // * memberships 2861 // * metadata 2862 // * names 2863 // * nicknames 2864 // * occupations 2865 // * organizations 2866 // * phoneNumbers 2867 // * photos 2868 // * relations 2869 // * residences 2870 // * sipAddresses 2871 // * skills 2872 // * urls 2873 // * userDefined 2874 PersonFields string `json:"personFields,omitempty"` 2875 2876 // PhotoBytes: Required. Raw photo bytes 2877 PhotoBytes string `json:"photoBytes,omitempty"` 2878 2879 // Sources: Optional. A mask of what source types to return. Defaults 2880 // to 2881 // ReadSourceType.CONTACT and 2882 // ReadSourceType.PROFILE if not 2883 // set. 2884 // 2885 // Possible values: 2886 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified. 2887 // "READ_SOURCE_TYPE_PROFILE" - 2888 // Returns 2889 // SourceType.ACCOUNT, 2890 // SourceType.DOMAIN_PROFILE, 2891 // and 2892 // SourceType. 2893 // PROFILE. 2894 // "READ_SOURCE_TYPE_CONTACT" - Returns 2895 // SourceType.CONTACT. 2896 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - 2897 // Returns 2898 // SourceType.DOMAIN_CONTACT. 2899 Sources []string `json:"sources,omitempty"` 2900 2901 // ForceSendFields is a list of field names (e.g. "PersonFields") to 2902 // unconditionally include in API requests. By default, fields with 2903 // empty values are omitted from API requests. However, any non-pointer, 2904 // non-interface field appearing in ForceSendFields will be sent to the 2905 // server regardless of whether the field is empty or not. This may be 2906 // used to include empty fields in Patch requests. 2907 ForceSendFields []string `json:"-"` 2908 2909 // NullFields is a list of field names (e.g. "PersonFields") to include 2910 // in API requests with the JSON null value. By default, fields with 2911 // empty values are omitted from API requests. However, any field with 2912 // an empty value appearing in NullFields will be sent to the server as 2913 // null. It is an error if a field in this list has a non-empty value. 2914 // This may be used to include null fields in Patch requests. 2915 NullFields []string `json:"-"` 2916} 2917 2918func (s *UpdateContactPhotoRequest) MarshalJSON() ([]byte, error) { 2919 type NoMethod UpdateContactPhotoRequest 2920 raw := NoMethod(*s) 2921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2922} 2923 2924// UpdateContactPhotoResponse: The response for updating a contact's 2925// photo. 2926type UpdateContactPhotoResponse struct { 2927 // Person: The updated person, if person_fields is set in 2928 // the 2929 // UpdateContactPhotoRequest; otherwise this will be unset. 2930 Person *Person `json:"person,omitempty"` 2931 2932 // ServerResponse contains the HTTP response code and headers from the 2933 // server. 2934 googleapi.ServerResponse `json:"-"` 2935 2936 // ForceSendFields is a list of field names (e.g. "Person") to 2937 // unconditionally include in API requests. By default, fields with 2938 // empty values are omitted from API requests. However, any non-pointer, 2939 // non-interface field appearing in ForceSendFields will be sent to the 2940 // server regardless of whether the field is empty or not. This may be 2941 // used to include empty fields in Patch requests. 2942 ForceSendFields []string `json:"-"` 2943 2944 // NullFields is a list of field names (e.g. "Person") to include in API 2945 // requests with the JSON null value. By default, fields with empty 2946 // values are omitted from API requests. However, any field with an 2947 // empty value appearing in NullFields will be sent to the server as 2948 // null. It is an error if a field in this list has a non-empty value. 2949 // This may be used to include null fields in Patch requests. 2950 NullFields []string `json:"-"` 2951} 2952 2953func (s *UpdateContactPhotoResponse) MarshalJSON() ([]byte, error) { 2954 type NoMethod UpdateContactPhotoResponse 2955 raw := NoMethod(*s) 2956 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2957} 2958 2959// Url: A person's associated URLs. 2960type Url struct { 2961 // FormattedType: Output only. The type of the URL translated and 2962 // formatted in the viewer's 2963 // account locale or the `Accept-Language` HTTP header locale. 2964 FormattedType string `json:"formattedType,omitempty"` 2965 2966 // Metadata: Metadata about the URL. 2967 Metadata *FieldMetadata `json:"metadata,omitempty"` 2968 2969 // Type: The type of the URL. The type can be custom or one of these 2970 // predefined 2971 // values: 2972 // 2973 // * `home` 2974 // * `work` 2975 // * `blog` 2976 // * `profile` 2977 // * `homePage` 2978 // * `ftp` 2979 // * `reservations` 2980 // * `appInstallPage`: website for a Google+ application. 2981 // * `other` 2982 Type string `json:"type,omitempty"` 2983 2984 // Value: The URL. 2985 Value string `json:"value,omitempty"` 2986 2987 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2988 // unconditionally include in API requests. By default, fields with 2989 // empty values are omitted from API requests. However, any non-pointer, 2990 // non-interface field appearing in ForceSendFields will be sent to the 2991 // server regardless of whether the field is empty or not. This may be 2992 // used to include empty fields in Patch requests. 2993 ForceSendFields []string `json:"-"` 2994 2995 // NullFields is a list of field names (e.g. "FormattedType") to include 2996 // in API requests with the JSON null value. By default, fields with 2997 // empty values are omitted from API requests. However, any field with 2998 // an empty value appearing in NullFields will be sent to the server as 2999 // null. It is an error if a field in this list has a non-empty value. 3000 // This may be used to include null fields in Patch requests. 3001 NullFields []string `json:"-"` 3002} 3003 3004func (s *Url) MarshalJSON() ([]byte, error) { 3005 type NoMethod Url 3006 raw := NoMethod(*s) 3007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3008} 3009 3010// UserDefined: Arbitrary user data that is populated by the end users. 3011type UserDefined struct { 3012 // Key: The end user specified key of the user defined data. 3013 Key string `json:"key,omitempty"` 3014 3015 // Metadata: Metadata about the user defined data. 3016 Metadata *FieldMetadata `json:"metadata,omitempty"` 3017 3018 // Value: The end user specified value of the user defined data. 3019 Value string `json:"value,omitempty"` 3020 3021 // ForceSendFields is a list of field names (e.g. "Key") to 3022 // unconditionally include in API requests. By default, fields with 3023 // empty values are omitted from API requests. However, any non-pointer, 3024 // non-interface field appearing in ForceSendFields will be sent to the 3025 // server regardless of whether the field is empty or not. This may be 3026 // used to include empty fields in Patch requests. 3027 ForceSendFields []string `json:"-"` 3028 3029 // NullFields is a list of field names (e.g. "Key") to include in API 3030 // requests with the JSON null value. By default, fields with empty 3031 // values are omitted from API requests. However, any field with an 3032 // empty value appearing in NullFields will be sent to the server as 3033 // null. It is an error if a field in this list has a non-empty value. 3034 // This may be used to include null fields in Patch requests. 3035 NullFields []string `json:"-"` 3036} 3037 3038func (s *UserDefined) MarshalJSON() ([]byte, error) { 3039 type NoMethod UserDefined 3040 raw := NoMethod(*s) 3041 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3042} 3043 3044// method id "people.contactGroups.batchGet": 3045 3046type ContactGroupsBatchGetCall struct { 3047 s *Service 3048 urlParams_ gensupport.URLParams 3049 ifNoneMatch_ string 3050 ctx_ context.Context 3051 header_ http.Header 3052} 3053 3054// BatchGet: Get a list of contact groups owned by the authenticated 3055// user by specifying 3056// a list of contact group resource names. 3057func (r *ContactGroupsService) BatchGet() *ContactGroupsBatchGetCall { 3058 c := &ContactGroupsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3059 return c 3060} 3061 3062// MaxMembers sets the optional parameter "maxMembers": Specifies the 3063// maximum number of members to return for each group. Defaults 3064// to 0 if not set, which will return zero members. 3065func (c *ContactGroupsBatchGetCall) MaxMembers(maxMembers int64) *ContactGroupsBatchGetCall { 3066 c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers)) 3067 return c 3068} 3069 3070// ResourceNames sets the optional parameter "resourceNames": Required. 3071// The resource names of the contact groups to get. 3072func (c *ContactGroupsBatchGetCall) ResourceNames(resourceNames ...string) *ContactGroupsBatchGetCall { 3073 c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) 3074 return c 3075} 3076 3077// Fields allows partial responses to be retrieved. See 3078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3079// for more information. 3080func (c *ContactGroupsBatchGetCall) Fields(s ...googleapi.Field) *ContactGroupsBatchGetCall { 3081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3082 return c 3083} 3084 3085// IfNoneMatch sets the optional parameter which makes the operation 3086// fail if the object's ETag matches the given value. This is useful for 3087// getting updates only after the object has changed since the last 3088// request. Use googleapi.IsNotModified to check whether the response 3089// error from Do is the result of In-None-Match. 3090func (c *ContactGroupsBatchGetCall) IfNoneMatch(entityTag string) *ContactGroupsBatchGetCall { 3091 c.ifNoneMatch_ = entityTag 3092 return c 3093} 3094 3095// Context sets the context to be used in this call's Do method. Any 3096// pending HTTP request will be aborted if the provided context is 3097// canceled. 3098func (c *ContactGroupsBatchGetCall) Context(ctx context.Context) *ContactGroupsBatchGetCall { 3099 c.ctx_ = ctx 3100 return c 3101} 3102 3103// Header returns an http.Header that can be modified by the caller to 3104// add HTTP headers to the request. 3105func (c *ContactGroupsBatchGetCall) Header() http.Header { 3106 if c.header_ == nil { 3107 c.header_ = make(http.Header) 3108 } 3109 return c.header_ 3110} 3111 3112func (c *ContactGroupsBatchGetCall) doRequest(alt string) (*http.Response, error) { 3113 reqHeaders := make(http.Header) 3114 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3115 for k, v := range c.header_ { 3116 reqHeaders[k] = v 3117 } 3118 reqHeaders.Set("User-Agent", c.s.userAgent()) 3119 if c.ifNoneMatch_ != "" { 3120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3121 } 3122 var body io.Reader = nil 3123 c.urlParams_.Set("alt", alt) 3124 c.urlParams_.Set("prettyPrint", "false") 3125 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups:batchGet") 3126 urls += "?" + c.urlParams_.Encode() 3127 req, err := http.NewRequest("GET", urls, body) 3128 if err != nil { 3129 return nil, err 3130 } 3131 req.Header = reqHeaders 3132 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3133} 3134 3135// Do executes the "people.contactGroups.batchGet" call. 3136// Exactly one of *BatchGetContactGroupsResponse or error will be 3137// non-nil. Any non-2xx status code is an error. Response headers are in 3138// either *BatchGetContactGroupsResponse.ServerResponse.Header or (if a 3139// response was returned at all) in error.(*googleapi.Error).Header. Use 3140// googleapi.IsNotModified to check whether the returned error was 3141// because http.StatusNotModified was returned. 3142func (c *ContactGroupsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetContactGroupsResponse, error) { 3143 gensupport.SetOptions(c.urlParams_, opts...) 3144 res, err := c.doRequest("json") 3145 if res != nil && res.StatusCode == http.StatusNotModified { 3146 if res.Body != nil { 3147 res.Body.Close() 3148 } 3149 return nil, &googleapi.Error{ 3150 Code: res.StatusCode, 3151 Header: res.Header, 3152 } 3153 } 3154 if err != nil { 3155 return nil, err 3156 } 3157 defer googleapi.CloseBody(res) 3158 if err := googleapi.CheckResponse(res); err != nil { 3159 return nil, err 3160 } 3161 ret := &BatchGetContactGroupsResponse{ 3162 ServerResponse: googleapi.ServerResponse{ 3163 Header: res.Header, 3164 HTTPStatusCode: res.StatusCode, 3165 }, 3166 } 3167 target := &ret 3168 if err := gensupport.DecodeResponse(target, res); err != nil { 3169 return nil, err 3170 } 3171 return ret, nil 3172 // { 3173 // "description": "Get a list of contact groups owned by the authenticated user by specifying\na list of contact group resource names.", 3174 // "flatPath": "v1/contactGroups:batchGet", 3175 // "httpMethod": "GET", 3176 // "id": "people.contactGroups.batchGet", 3177 // "parameterOrder": [], 3178 // "parameters": { 3179 // "maxMembers": { 3180 // "description": "Optional. Specifies the maximum number of members to return for each group. Defaults\nto 0 if not set, which will return zero members.", 3181 // "format": "int32", 3182 // "location": "query", 3183 // "type": "integer" 3184 // }, 3185 // "resourceNames": { 3186 // "description": "Required. The resource names of the contact groups to get.", 3187 // "location": "query", 3188 // "repeated": true, 3189 // "type": "string" 3190 // } 3191 // }, 3192 // "path": "v1/contactGroups:batchGet", 3193 // "response": { 3194 // "$ref": "BatchGetContactGroupsResponse" 3195 // }, 3196 // "scopes": [ 3197 // "https://www.googleapis.com/auth/contacts", 3198 // "https://www.googleapis.com/auth/contacts.readonly" 3199 // ] 3200 // } 3201 3202} 3203 3204// method id "people.contactGroups.create": 3205 3206type ContactGroupsCreateCall struct { 3207 s *Service 3208 createcontactgrouprequest *CreateContactGroupRequest 3209 urlParams_ gensupport.URLParams 3210 ctx_ context.Context 3211 header_ http.Header 3212} 3213 3214// Create: Create a new contact group owned by the authenticated user. 3215func (r *ContactGroupsService) Create(createcontactgrouprequest *CreateContactGroupRequest) *ContactGroupsCreateCall { 3216 c := &ContactGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3217 c.createcontactgrouprequest = createcontactgrouprequest 3218 return c 3219} 3220 3221// Fields allows partial responses to be retrieved. See 3222// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3223// for more information. 3224func (c *ContactGroupsCreateCall) Fields(s ...googleapi.Field) *ContactGroupsCreateCall { 3225 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3226 return c 3227} 3228 3229// Context sets the context to be used in this call's Do method. Any 3230// pending HTTP request will be aborted if the provided context is 3231// canceled. 3232func (c *ContactGroupsCreateCall) Context(ctx context.Context) *ContactGroupsCreateCall { 3233 c.ctx_ = ctx 3234 return c 3235} 3236 3237// Header returns an http.Header that can be modified by the caller to 3238// add HTTP headers to the request. 3239func (c *ContactGroupsCreateCall) Header() http.Header { 3240 if c.header_ == nil { 3241 c.header_ = make(http.Header) 3242 } 3243 return c.header_ 3244} 3245 3246func (c *ContactGroupsCreateCall) doRequest(alt string) (*http.Response, error) { 3247 reqHeaders := make(http.Header) 3248 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3249 for k, v := range c.header_ { 3250 reqHeaders[k] = v 3251 } 3252 reqHeaders.Set("User-Agent", c.s.userAgent()) 3253 var body io.Reader = nil 3254 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontactgrouprequest) 3255 if err != nil { 3256 return nil, err 3257 } 3258 reqHeaders.Set("Content-Type", "application/json") 3259 c.urlParams_.Set("alt", alt) 3260 c.urlParams_.Set("prettyPrint", "false") 3261 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups") 3262 urls += "?" + c.urlParams_.Encode() 3263 req, err := http.NewRequest("POST", urls, body) 3264 if err != nil { 3265 return nil, err 3266 } 3267 req.Header = reqHeaders 3268 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3269} 3270 3271// Do executes the "people.contactGroups.create" call. 3272// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 3273// status code is an error. Response headers are in either 3274// *ContactGroup.ServerResponse.Header or (if a response was returned at 3275// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3276// to check whether the returned error was because 3277// http.StatusNotModified was returned. 3278func (c *ContactGroupsCreateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 3279 gensupport.SetOptions(c.urlParams_, opts...) 3280 res, err := c.doRequest("json") 3281 if res != nil && res.StatusCode == http.StatusNotModified { 3282 if res.Body != nil { 3283 res.Body.Close() 3284 } 3285 return nil, &googleapi.Error{ 3286 Code: res.StatusCode, 3287 Header: res.Header, 3288 } 3289 } 3290 if err != nil { 3291 return nil, err 3292 } 3293 defer googleapi.CloseBody(res) 3294 if err := googleapi.CheckResponse(res); err != nil { 3295 return nil, err 3296 } 3297 ret := &ContactGroup{ 3298 ServerResponse: googleapi.ServerResponse{ 3299 Header: res.Header, 3300 HTTPStatusCode: res.StatusCode, 3301 }, 3302 } 3303 target := &ret 3304 if err := gensupport.DecodeResponse(target, res); err != nil { 3305 return nil, err 3306 } 3307 return ret, nil 3308 // { 3309 // "description": "Create a new contact group owned by the authenticated user.", 3310 // "flatPath": "v1/contactGroups", 3311 // "httpMethod": "POST", 3312 // "id": "people.contactGroups.create", 3313 // "parameterOrder": [], 3314 // "parameters": {}, 3315 // "path": "v1/contactGroups", 3316 // "request": { 3317 // "$ref": "CreateContactGroupRequest" 3318 // }, 3319 // "response": { 3320 // "$ref": "ContactGroup" 3321 // }, 3322 // "scopes": [ 3323 // "https://www.googleapis.com/auth/contacts" 3324 // ] 3325 // } 3326 3327} 3328 3329// method id "people.contactGroups.delete": 3330 3331type ContactGroupsDeleteCall struct { 3332 s *Service 3333 resourceName string 3334 urlParams_ gensupport.URLParams 3335 ctx_ context.Context 3336 header_ http.Header 3337} 3338 3339// Delete: Delete an existing contact group owned by the authenticated 3340// user by 3341// specifying a contact group resource name. 3342func (r *ContactGroupsService) Delete(resourceName string) *ContactGroupsDeleteCall { 3343 c := &ContactGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3344 c.resourceName = resourceName 3345 return c 3346} 3347 3348// DeleteContacts sets the optional parameter "deleteContacts": Set to 3349// true to also delete the contacts in the specified group. 3350func (c *ContactGroupsDeleteCall) DeleteContacts(deleteContacts bool) *ContactGroupsDeleteCall { 3351 c.urlParams_.Set("deleteContacts", fmt.Sprint(deleteContacts)) 3352 return c 3353} 3354 3355// Fields allows partial responses to be retrieved. See 3356// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3357// for more information. 3358func (c *ContactGroupsDeleteCall) Fields(s ...googleapi.Field) *ContactGroupsDeleteCall { 3359 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3360 return c 3361} 3362 3363// Context sets the context to be used in this call's Do method. Any 3364// pending HTTP request will be aborted if the provided context is 3365// canceled. 3366func (c *ContactGroupsDeleteCall) Context(ctx context.Context) *ContactGroupsDeleteCall { 3367 c.ctx_ = ctx 3368 return c 3369} 3370 3371// Header returns an http.Header that can be modified by the caller to 3372// add HTTP headers to the request. 3373func (c *ContactGroupsDeleteCall) Header() http.Header { 3374 if c.header_ == nil { 3375 c.header_ = make(http.Header) 3376 } 3377 return c.header_ 3378} 3379 3380func (c *ContactGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 3381 reqHeaders := make(http.Header) 3382 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3383 for k, v := range c.header_ { 3384 reqHeaders[k] = v 3385 } 3386 reqHeaders.Set("User-Agent", c.s.userAgent()) 3387 var body io.Reader = nil 3388 c.urlParams_.Set("alt", alt) 3389 c.urlParams_.Set("prettyPrint", "false") 3390 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3391 urls += "?" + c.urlParams_.Encode() 3392 req, err := http.NewRequest("DELETE", urls, body) 3393 if err != nil { 3394 return nil, err 3395 } 3396 req.Header = reqHeaders 3397 googleapi.Expand(req.URL, map[string]string{ 3398 "resourceName": c.resourceName, 3399 }) 3400 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3401} 3402 3403// Do executes the "people.contactGroups.delete" call. 3404// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3405// code is an error. Response headers are in either 3406// *Empty.ServerResponse.Header or (if a response was returned at all) 3407// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3408// check whether the returned error was because http.StatusNotModified 3409// was returned. 3410func (c *ContactGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3411 gensupport.SetOptions(c.urlParams_, opts...) 3412 res, err := c.doRequest("json") 3413 if res != nil && res.StatusCode == http.StatusNotModified { 3414 if res.Body != nil { 3415 res.Body.Close() 3416 } 3417 return nil, &googleapi.Error{ 3418 Code: res.StatusCode, 3419 Header: res.Header, 3420 } 3421 } 3422 if err != nil { 3423 return nil, err 3424 } 3425 defer googleapi.CloseBody(res) 3426 if err := googleapi.CheckResponse(res); err != nil { 3427 return nil, err 3428 } 3429 ret := &Empty{ 3430 ServerResponse: googleapi.ServerResponse{ 3431 Header: res.Header, 3432 HTTPStatusCode: res.StatusCode, 3433 }, 3434 } 3435 target := &ret 3436 if err := gensupport.DecodeResponse(target, res); err != nil { 3437 return nil, err 3438 } 3439 return ret, nil 3440 // { 3441 // "description": "Delete an existing contact group owned by the authenticated user by\nspecifying a contact group resource name.", 3442 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3443 // "httpMethod": "DELETE", 3444 // "id": "people.contactGroups.delete", 3445 // "parameterOrder": [ 3446 // "resourceName" 3447 // ], 3448 // "parameters": { 3449 // "deleteContacts": { 3450 // "description": "Optional. Set to true to also delete the contacts in the specified group.", 3451 // "location": "query", 3452 // "type": "boolean" 3453 // }, 3454 // "resourceName": { 3455 // "description": "Required. The resource name of the contact group to delete.", 3456 // "location": "path", 3457 // "pattern": "^contactGroups/[^/]+$", 3458 // "required": true, 3459 // "type": "string" 3460 // } 3461 // }, 3462 // "path": "v1/{+resourceName}", 3463 // "response": { 3464 // "$ref": "Empty" 3465 // }, 3466 // "scopes": [ 3467 // "https://www.googleapis.com/auth/contacts" 3468 // ] 3469 // } 3470 3471} 3472 3473// method id "people.contactGroups.get": 3474 3475type ContactGroupsGetCall struct { 3476 s *Service 3477 resourceName string 3478 urlParams_ gensupport.URLParams 3479 ifNoneMatch_ string 3480 ctx_ context.Context 3481 header_ http.Header 3482} 3483 3484// Get: Get a specific contact group owned by the authenticated user by 3485// specifying 3486// a contact group resource name. 3487func (r *ContactGroupsService) Get(resourceName string) *ContactGroupsGetCall { 3488 c := &ContactGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3489 c.resourceName = resourceName 3490 return c 3491} 3492 3493// MaxMembers sets the optional parameter "maxMembers": Specifies the 3494// maximum number of members to return. Defaults to 0 if not 3495// set, which will return zero members. 3496func (c *ContactGroupsGetCall) MaxMembers(maxMembers int64) *ContactGroupsGetCall { 3497 c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers)) 3498 return c 3499} 3500 3501// Fields allows partial responses to be retrieved. See 3502// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3503// for more information. 3504func (c *ContactGroupsGetCall) Fields(s ...googleapi.Field) *ContactGroupsGetCall { 3505 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3506 return c 3507} 3508 3509// IfNoneMatch sets the optional parameter which makes the operation 3510// fail if the object's ETag matches the given value. This is useful for 3511// getting updates only after the object has changed since the last 3512// request. Use googleapi.IsNotModified to check whether the response 3513// error from Do is the result of In-None-Match. 3514func (c *ContactGroupsGetCall) IfNoneMatch(entityTag string) *ContactGroupsGetCall { 3515 c.ifNoneMatch_ = entityTag 3516 return c 3517} 3518 3519// Context sets the context to be used in this call's Do method. Any 3520// pending HTTP request will be aborted if the provided context is 3521// canceled. 3522func (c *ContactGroupsGetCall) Context(ctx context.Context) *ContactGroupsGetCall { 3523 c.ctx_ = ctx 3524 return c 3525} 3526 3527// Header returns an http.Header that can be modified by the caller to 3528// add HTTP headers to the request. 3529func (c *ContactGroupsGetCall) Header() http.Header { 3530 if c.header_ == nil { 3531 c.header_ = make(http.Header) 3532 } 3533 return c.header_ 3534} 3535 3536func (c *ContactGroupsGetCall) doRequest(alt string) (*http.Response, error) { 3537 reqHeaders := make(http.Header) 3538 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3539 for k, v := range c.header_ { 3540 reqHeaders[k] = v 3541 } 3542 reqHeaders.Set("User-Agent", c.s.userAgent()) 3543 if c.ifNoneMatch_ != "" { 3544 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3545 } 3546 var body io.Reader = nil 3547 c.urlParams_.Set("alt", alt) 3548 c.urlParams_.Set("prettyPrint", "false") 3549 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3550 urls += "?" + c.urlParams_.Encode() 3551 req, err := http.NewRequest("GET", urls, body) 3552 if err != nil { 3553 return nil, err 3554 } 3555 req.Header = reqHeaders 3556 googleapi.Expand(req.URL, map[string]string{ 3557 "resourceName": c.resourceName, 3558 }) 3559 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3560} 3561 3562// Do executes the "people.contactGroups.get" call. 3563// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 3564// status code is an error. Response headers are in either 3565// *ContactGroup.ServerResponse.Header or (if a response was returned at 3566// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3567// to check whether the returned error was because 3568// http.StatusNotModified was returned. 3569func (c *ContactGroupsGetCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 3570 gensupport.SetOptions(c.urlParams_, opts...) 3571 res, err := c.doRequest("json") 3572 if res != nil && res.StatusCode == http.StatusNotModified { 3573 if res.Body != nil { 3574 res.Body.Close() 3575 } 3576 return nil, &googleapi.Error{ 3577 Code: res.StatusCode, 3578 Header: res.Header, 3579 } 3580 } 3581 if err != nil { 3582 return nil, err 3583 } 3584 defer googleapi.CloseBody(res) 3585 if err := googleapi.CheckResponse(res); err != nil { 3586 return nil, err 3587 } 3588 ret := &ContactGroup{ 3589 ServerResponse: googleapi.ServerResponse{ 3590 Header: res.Header, 3591 HTTPStatusCode: res.StatusCode, 3592 }, 3593 } 3594 target := &ret 3595 if err := gensupport.DecodeResponse(target, res); err != nil { 3596 return nil, err 3597 } 3598 return ret, nil 3599 // { 3600 // "description": "Get a specific contact group owned by the authenticated user by specifying\na contact group resource name.", 3601 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3602 // "httpMethod": "GET", 3603 // "id": "people.contactGroups.get", 3604 // "parameterOrder": [ 3605 // "resourceName" 3606 // ], 3607 // "parameters": { 3608 // "maxMembers": { 3609 // "description": "Optional. Specifies the maximum number of members to return. Defaults to 0 if not\nset, which will return zero members.", 3610 // "format": "int32", 3611 // "location": "query", 3612 // "type": "integer" 3613 // }, 3614 // "resourceName": { 3615 // "description": "Required. The resource name of the contact group to get.", 3616 // "location": "path", 3617 // "pattern": "^contactGroups/[^/]+$", 3618 // "required": true, 3619 // "type": "string" 3620 // } 3621 // }, 3622 // "path": "v1/{+resourceName}", 3623 // "response": { 3624 // "$ref": "ContactGroup" 3625 // }, 3626 // "scopes": [ 3627 // "https://www.googleapis.com/auth/contacts", 3628 // "https://www.googleapis.com/auth/contacts.readonly" 3629 // ] 3630 // } 3631 3632} 3633 3634// method id "people.contactGroups.list": 3635 3636type ContactGroupsListCall struct { 3637 s *Service 3638 urlParams_ gensupport.URLParams 3639 ifNoneMatch_ string 3640 ctx_ context.Context 3641 header_ http.Header 3642} 3643 3644// List: List all contact groups owned by the authenticated user. 3645// Members of the 3646// contact groups are not populated. 3647func (r *ContactGroupsService) List() *ContactGroupsListCall { 3648 c := &ContactGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3649 return c 3650} 3651 3652// PageSize sets the optional parameter "pageSize": The maximum number 3653// of resources to return. Valid values are between 1 and 3654// 1000, inclusive. Defaults to 30 if not set or set to 0. 3655func (c *ContactGroupsListCall) PageSize(pageSize int64) *ContactGroupsListCall { 3656 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3657 return c 3658} 3659 3660// PageToken sets the optional parameter "pageToken": The 3661// next_page_token value returned from a previous call 3662// to 3663// [ListContactGroups](/people/api/rest/v1/contactgroups/list). 3664// Reques 3665// ts the next page of resources. 3666func (c *ContactGroupsListCall) PageToken(pageToken string) *ContactGroupsListCall { 3667 c.urlParams_.Set("pageToken", pageToken) 3668 return c 3669} 3670 3671// SyncToken sets the optional parameter "syncToken": A sync token, 3672// returned by a previous call to `contactgroups.list`. 3673// Only resources changed since the sync token was created will be 3674// returned. 3675func (c *ContactGroupsListCall) SyncToken(syncToken string) *ContactGroupsListCall { 3676 c.urlParams_.Set("syncToken", syncToken) 3677 return c 3678} 3679 3680// Fields allows partial responses to be retrieved. See 3681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3682// for more information. 3683func (c *ContactGroupsListCall) Fields(s ...googleapi.Field) *ContactGroupsListCall { 3684 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3685 return c 3686} 3687 3688// IfNoneMatch sets the optional parameter which makes the operation 3689// fail if the object's ETag matches the given value. This is useful for 3690// getting updates only after the object has changed since the last 3691// request. Use googleapi.IsNotModified to check whether the response 3692// error from Do is the result of In-None-Match. 3693func (c *ContactGroupsListCall) IfNoneMatch(entityTag string) *ContactGroupsListCall { 3694 c.ifNoneMatch_ = entityTag 3695 return c 3696} 3697 3698// Context sets the context to be used in this call's Do method. Any 3699// pending HTTP request will be aborted if the provided context is 3700// canceled. 3701func (c *ContactGroupsListCall) Context(ctx context.Context) *ContactGroupsListCall { 3702 c.ctx_ = ctx 3703 return c 3704} 3705 3706// Header returns an http.Header that can be modified by the caller to 3707// add HTTP headers to the request. 3708func (c *ContactGroupsListCall) Header() http.Header { 3709 if c.header_ == nil { 3710 c.header_ = make(http.Header) 3711 } 3712 return c.header_ 3713} 3714 3715func (c *ContactGroupsListCall) doRequest(alt string) (*http.Response, error) { 3716 reqHeaders := make(http.Header) 3717 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3718 for k, v := range c.header_ { 3719 reqHeaders[k] = v 3720 } 3721 reqHeaders.Set("User-Agent", c.s.userAgent()) 3722 if c.ifNoneMatch_ != "" { 3723 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3724 } 3725 var body io.Reader = nil 3726 c.urlParams_.Set("alt", alt) 3727 c.urlParams_.Set("prettyPrint", "false") 3728 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups") 3729 urls += "?" + c.urlParams_.Encode() 3730 req, err := http.NewRequest("GET", urls, body) 3731 if err != nil { 3732 return nil, err 3733 } 3734 req.Header = reqHeaders 3735 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3736} 3737 3738// Do executes the "people.contactGroups.list" call. 3739// Exactly one of *ListContactGroupsResponse or error will be non-nil. 3740// Any non-2xx status code is an error. Response headers are in either 3741// *ListContactGroupsResponse.ServerResponse.Header or (if a response 3742// was returned at all) in error.(*googleapi.Error).Header. Use 3743// googleapi.IsNotModified to check whether the returned error was 3744// because http.StatusNotModified was returned. 3745func (c *ContactGroupsListCall) Do(opts ...googleapi.CallOption) (*ListContactGroupsResponse, error) { 3746 gensupport.SetOptions(c.urlParams_, opts...) 3747 res, err := c.doRequest("json") 3748 if res != nil && res.StatusCode == http.StatusNotModified { 3749 if res.Body != nil { 3750 res.Body.Close() 3751 } 3752 return nil, &googleapi.Error{ 3753 Code: res.StatusCode, 3754 Header: res.Header, 3755 } 3756 } 3757 if err != nil { 3758 return nil, err 3759 } 3760 defer googleapi.CloseBody(res) 3761 if err := googleapi.CheckResponse(res); err != nil { 3762 return nil, err 3763 } 3764 ret := &ListContactGroupsResponse{ 3765 ServerResponse: googleapi.ServerResponse{ 3766 Header: res.Header, 3767 HTTPStatusCode: res.StatusCode, 3768 }, 3769 } 3770 target := &ret 3771 if err := gensupport.DecodeResponse(target, res); err != nil { 3772 return nil, err 3773 } 3774 return ret, nil 3775 // { 3776 // "description": "List all contact groups owned by the authenticated user. Members of the\ncontact groups are not populated.", 3777 // "flatPath": "v1/contactGroups", 3778 // "httpMethod": "GET", 3779 // "id": "people.contactGroups.list", 3780 // "parameterOrder": [], 3781 // "parameters": { 3782 // "pageSize": { 3783 // "description": "Optional. The maximum number of resources to return. Valid values are between 1 and\n1000, inclusive. Defaults to 30 if not set or set to 0.", 3784 // "format": "int32", 3785 // "location": "query", 3786 // "type": "integer" 3787 // }, 3788 // "pageToken": { 3789 // "description": "Optional. The next_page_token value returned from a previous call to\n[ListContactGroups](/people/api/rest/v1/contactgroups/list).\nRequests the next page of resources.", 3790 // "location": "query", 3791 // "type": "string" 3792 // }, 3793 // "syncToken": { 3794 // "description": "Optional. A sync token, returned by a previous call to `contactgroups.list`.\nOnly resources changed since the sync token was created will be returned.", 3795 // "location": "query", 3796 // "type": "string" 3797 // } 3798 // }, 3799 // "path": "v1/contactGroups", 3800 // "response": { 3801 // "$ref": "ListContactGroupsResponse" 3802 // }, 3803 // "scopes": [ 3804 // "https://www.googleapis.com/auth/contacts", 3805 // "https://www.googleapis.com/auth/contacts.readonly" 3806 // ] 3807 // } 3808 3809} 3810 3811// Pages invokes f for each page of results. 3812// A non-nil error returned from f will halt the iteration. 3813// The provided context supersedes any context provided to the Context method. 3814func (c *ContactGroupsListCall) Pages(ctx context.Context, f func(*ListContactGroupsResponse) error) error { 3815 c.ctx_ = ctx 3816 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3817 for { 3818 x, err := c.Do() 3819 if err != nil { 3820 return err 3821 } 3822 if err := f(x); err != nil { 3823 return err 3824 } 3825 if x.NextPageToken == "" { 3826 return nil 3827 } 3828 c.PageToken(x.NextPageToken) 3829 } 3830} 3831 3832// method id "people.contactGroups.update": 3833 3834type ContactGroupsUpdateCall struct { 3835 s *Service 3836 resourceName string 3837 updatecontactgrouprequest *UpdateContactGroupRequest 3838 urlParams_ gensupport.URLParams 3839 ctx_ context.Context 3840 header_ http.Header 3841} 3842 3843// Update: Update the name of an existing contact group owned by the 3844// authenticated 3845// user. 3846func (r *ContactGroupsService) Update(resourceName string, updatecontactgrouprequest *UpdateContactGroupRequest) *ContactGroupsUpdateCall { 3847 c := &ContactGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3848 c.resourceName = resourceName 3849 c.updatecontactgrouprequest = updatecontactgrouprequest 3850 return c 3851} 3852 3853// Fields allows partial responses to be retrieved. See 3854// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3855// for more information. 3856func (c *ContactGroupsUpdateCall) Fields(s ...googleapi.Field) *ContactGroupsUpdateCall { 3857 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3858 return c 3859} 3860 3861// Context sets the context to be used in this call's Do method. Any 3862// pending HTTP request will be aborted if the provided context is 3863// canceled. 3864func (c *ContactGroupsUpdateCall) Context(ctx context.Context) *ContactGroupsUpdateCall { 3865 c.ctx_ = ctx 3866 return c 3867} 3868 3869// Header returns an http.Header that can be modified by the caller to 3870// add HTTP headers to the request. 3871func (c *ContactGroupsUpdateCall) Header() http.Header { 3872 if c.header_ == nil { 3873 c.header_ = make(http.Header) 3874 } 3875 return c.header_ 3876} 3877 3878func (c *ContactGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 3879 reqHeaders := make(http.Header) 3880 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3881 for k, v := range c.header_ { 3882 reqHeaders[k] = v 3883 } 3884 reqHeaders.Set("User-Agent", c.s.userAgent()) 3885 var body io.Reader = nil 3886 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactgrouprequest) 3887 if err != nil { 3888 return nil, err 3889 } 3890 reqHeaders.Set("Content-Type", "application/json") 3891 c.urlParams_.Set("alt", alt) 3892 c.urlParams_.Set("prettyPrint", "false") 3893 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3894 urls += "?" + c.urlParams_.Encode() 3895 req, err := http.NewRequest("PUT", urls, body) 3896 if err != nil { 3897 return nil, err 3898 } 3899 req.Header = reqHeaders 3900 googleapi.Expand(req.URL, map[string]string{ 3901 "resourceName": c.resourceName, 3902 }) 3903 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3904} 3905 3906// Do executes the "people.contactGroups.update" call. 3907// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 3908// status code is an error. Response headers are in either 3909// *ContactGroup.ServerResponse.Header or (if a response was returned at 3910// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3911// to check whether the returned error was because 3912// http.StatusNotModified was returned. 3913func (c *ContactGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 3914 gensupport.SetOptions(c.urlParams_, opts...) 3915 res, err := c.doRequest("json") 3916 if res != nil && res.StatusCode == http.StatusNotModified { 3917 if res.Body != nil { 3918 res.Body.Close() 3919 } 3920 return nil, &googleapi.Error{ 3921 Code: res.StatusCode, 3922 Header: res.Header, 3923 } 3924 } 3925 if err != nil { 3926 return nil, err 3927 } 3928 defer googleapi.CloseBody(res) 3929 if err := googleapi.CheckResponse(res); err != nil { 3930 return nil, err 3931 } 3932 ret := &ContactGroup{ 3933 ServerResponse: googleapi.ServerResponse{ 3934 Header: res.Header, 3935 HTTPStatusCode: res.StatusCode, 3936 }, 3937 } 3938 target := &ret 3939 if err := gensupport.DecodeResponse(target, res); err != nil { 3940 return nil, err 3941 } 3942 return ret, nil 3943 // { 3944 // "description": "Update the name of an existing contact group owned by the authenticated\nuser.", 3945 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3946 // "httpMethod": "PUT", 3947 // "id": "people.contactGroups.update", 3948 // "parameterOrder": [ 3949 // "resourceName" 3950 // ], 3951 // "parameters": { 3952 // "resourceName": { 3953 // "description": "The resource name for the contact group, assigned by the server. An ASCII\nstring, in the form of `contactGroups/{contact_group_id}`.", 3954 // "location": "path", 3955 // "pattern": "^contactGroups/[^/]+$", 3956 // "required": true, 3957 // "type": "string" 3958 // } 3959 // }, 3960 // "path": "v1/{+resourceName}", 3961 // "request": { 3962 // "$ref": "UpdateContactGroupRequest" 3963 // }, 3964 // "response": { 3965 // "$ref": "ContactGroup" 3966 // }, 3967 // "scopes": [ 3968 // "https://www.googleapis.com/auth/contacts" 3969 // ] 3970 // } 3971 3972} 3973 3974// method id "people.contactGroups.members.modify": 3975 3976type ContactGroupsMembersModifyCall struct { 3977 s *Service 3978 resourceName string 3979 modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest 3980 urlParams_ gensupport.URLParams 3981 ctx_ context.Context 3982 header_ http.Header 3983} 3984 3985// Modify: Modify the members of a contact group owned by the 3986// authenticated user. 3987// 3988// The only system contact groups that can have members added 3989// are 3990// `contactGroups/myContacts` and `contactGroups/starred`. Other 3991// system 3992// contact groups are deprecated and can only have contacts removed. 3993func (r *ContactGroupsMembersService) Modify(resourceName string, modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest) *ContactGroupsMembersModifyCall { 3994 c := &ContactGroupsMembersModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3995 c.resourceName = resourceName 3996 c.modifycontactgroupmembersrequest = modifycontactgroupmembersrequest 3997 return c 3998} 3999 4000// Fields allows partial responses to be retrieved. See 4001// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4002// for more information. 4003func (c *ContactGroupsMembersModifyCall) Fields(s ...googleapi.Field) *ContactGroupsMembersModifyCall { 4004 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4005 return c 4006} 4007 4008// Context sets the context to be used in this call's Do method. Any 4009// pending HTTP request will be aborted if the provided context is 4010// canceled. 4011func (c *ContactGroupsMembersModifyCall) Context(ctx context.Context) *ContactGroupsMembersModifyCall { 4012 c.ctx_ = ctx 4013 return c 4014} 4015 4016// Header returns an http.Header that can be modified by the caller to 4017// add HTTP headers to the request. 4018func (c *ContactGroupsMembersModifyCall) Header() http.Header { 4019 if c.header_ == nil { 4020 c.header_ = make(http.Header) 4021 } 4022 return c.header_ 4023} 4024 4025func (c *ContactGroupsMembersModifyCall) doRequest(alt string) (*http.Response, error) { 4026 reqHeaders := make(http.Header) 4027 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4028 for k, v := range c.header_ { 4029 reqHeaders[k] = v 4030 } 4031 reqHeaders.Set("User-Agent", c.s.userAgent()) 4032 var body io.Reader = nil 4033 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycontactgroupmembersrequest) 4034 if err != nil { 4035 return nil, err 4036 } 4037 reqHeaders.Set("Content-Type", "application/json") 4038 c.urlParams_.Set("alt", alt) 4039 c.urlParams_.Set("prettyPrint", "false") 4040 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/members:modify") 4041 urls += "?" + c.urlParams_.Encode() 4042 req, err := http.NewRequest("POST", urls, body) 4043 if err != nil { 4044 return nil, err 4045 } 4046 req.Header = reqHeaders 4047 googleapi.Expand(req.URL, map[string]string{ 4048 "resourceName": c.resourceName, 4049 }) 4050 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4051} 4052 4053// Do executes the "people.contactGroups.members.modify" call. 4054// Exactly one of *ModifyContactGroupMembersResponse or error will be 4055// non-nil. Any non-2xx status code is an error. Response headers are in 4056// either *ModifyContactGroupMembersResponse.ServerResponse.Header or 4057// (if a response was returned at all) in 4058// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4059// whether the returned error was because http.StatusNotModified was 4060// returned. 4061func (c *ContactGroupsMembersModifyCall) Do(opts ...googleapi.CallOption) (*ModifyContactGroupMembersResponse, error) { 4062 gensupport.SetOptions(c.urlParams_, opts...) 4063 res, err := c.doRequest("json") 4064 if res != nil && res.StatusCode == http.StatusNotModified { 4065 if res.Body != nil { 4066 res.Body.Close() 4067 } 4068 return nil, &googleapi.Error{ 4069 Code: res.StatusCode, 4070 Header: res.Header, 4071 } 4072 } 4073 if err != nil { 4074 return nil, err 4075 } 4076 defer googleapi.CloseBody(res) 4077 if err := googleapi.CheckResponse(res); err != nil { 4078 return nil, err 4079 } 4080 ret := &ModifyContactGroupMembersResponse{ 4081 ServerResponse: googleapi.ServerResponse{ 4082 Header: res.Header, 4083 HTTPStatusCode: res.StatusCode, 4084 }, 4085 } 4086 target := &ret 4087 if err := gensupport.DecodeResponse(target, res); err != nil { 4088 return nil, err 4089 } 4090 return ret, nil 4091 // { 4092 // "description": "Modify the members of a contact group owned by the authenticated user.\n\nThe only system contact groups that can have members added are\n`contactGroups/myContacts` and `contactGroups/starred`. Other system\ncontact groups are deprecated and can only have contacts removed.", 4093 // "flatPath": "v1/contactGroups/{contactGroupsId}/members:modify", 4094 // "httpMethod": "POST", 4095 // "id": "people.contactGroups.members.modify", 4096 // "parameterOrder": [ 4097 // "resourceName" 4098 // ], 4099 // "parameters": { 4100 // "resourceName": { 4101 // "description": "Required. The resource name of the contact group to modify.", 4102 // "location": "path", 4103 // "pattern": "^contactGroups/[^/]+$", 4104 // "required": true, 4105 // "type": "string" 4106 // } 4107 // }, 4108 // "path": "v1/{+resourceName}/members:modify", 4109 // "request": { 4110 // "$ref": "ModifyContactGroupMembersRequest" 4111 // }, 4112 // "response": { 4113 // "$ref": "ModifyContactGroupMembersResponse" 4114 // }, 4115 // "scopes": [ 4116 // "https://www.googleapis.com/auth/contacts" 4117 // ] 4118 // } 4119 4120} 4121 4122// method id "people.otherContacts.copyOtherContactToMyContactsGroup": 4123 4124type OtherContactsCopyOtherContactToMyContactsGroupCall struct { 4125 s *Service 4126 resourceName string 4127 copyothercontacttomycontactsgrouprequest *CopyOtherContactToMyContactsGroupRequest 4128 urlParams_ gensupport.URLParams 4129 ctx_ context.Context 4130 header_ http.Header 4131} 4132 4133// CopyOtherContactToMyContactsGroup: Copies an "Other contact" to a new 4134// contact in the user's "myContacts" group 4135func (r *OtherContactsService) CopyOtherContactToMyContactsGroup(resourceName string, copyothercontacttomycontactsgrouprequest *CopyOtherContactToMyContactsGroupRequest) *OtherContactsCopyOtherContactToMyContactsGroupCall { 4136 c := &OtherContactsCopyOtherContactToMyContactsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4137 c.resourceName = resourceName 4138 c.copyothercontacttomycontactsgrouprequest = copyothercontacttomycontactsgrouprequest 4139 return c 4140} 4141 4142// Fields allows partial responses to be retrieved. See 4143// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4144// for more information. 4145func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Fields(s ...googleapi.Field) *OtherContactsCopyOtherContactToMyContactsGroupCall { 4146 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4147 return c 4148} 4149 4150// Context sets the context to be used in this call's Do method. Any 4151// pending HTTP request will be aborted if the provided context is 4152// canceled. 4153func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Context(ctx context.Context) *OtherContactsCopyOtherContactToMyContactsGroupCall { 4154 c.ctx_ = ctx 4155 return c 4156} 4157 4158// Header returns an http.Header that can be modified by the caller to 4159// add HTTP headers to the request. 4160func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Header() http.Header { 4161 if c.header_ == nil { 4162 c.header_ = make(http.Header) 4163 } 4164 return c.header_ 4165} 4166 4167func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) doRequest(alt string) (*http.Response, error) { 4168 reqHeaders := make(http.Header) 4169 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4170 for k, v := range c.header_ { 4171 reqHeaders[k] = v 4172 } 4173 reqHeaders.Set("User-Agent", c.s.userAgent()) 4174 var body io.Reader = nil 4175 body, err := googleapi.WithoutDataWrapper.JSONReader(c.copyothercontacttomycontactsgrouprequest) 4176 if err != nil { 4177 return nil, err 4178 } 4179 reqHeaders.Set("Content-Type", "application/json") 4180 c.urlParams_.Set("alt", alt) 4181 c.urlParams_.Set("prettyPrint", "false") 4182 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:copyOtherContactToMyContactsGroup") 4183 urls += "?" + c.urlParams_.Encode() 4184 req, err := http.NewRequest("POST", urls, body) 4185 if err != nil { 4186 return nil, err 4187 } 4188 req.Header = reqHeaders 4189 googleapi.Expand(req.URL, map[string]string{ 4190 "resourceName": c.resourceName, 4191 }) 4192 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4193} 4194 4195// Do executes the "people.otherContacts.copyOtherContactToMyContactsGroup" call. 4196// Exactly one of *Person or error will be non-nil. Any non-2xx status 4197// code is an error. Response headers are in either 4198// *Person.ServerResponse.Header or (if a response was returned at all) 4199// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4200// check whether the returned error was because http.StatusNotModified 4201// was returned. 4202func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Do(opts ...googleapi.CallOption) (*Person, error) { 4203 gensupport.SetOptions(c.urlParams_, opts...) 4204 res, err := c.doRequest("json") 4205 if res != nil && res.StatusCode == http.StatusNotModified { 4206 if res.Body != nil { 4207 res.Body.Close() 4208 } 4209 return nil, &googleapi.Error{ 4210 Code: res.StatusCode, 4211 Header: res.Header, 4212 } 4213 } 4214 if err != nil { 4215 return nil, err 4216 } 4217 defer googleapi.CloseBody(res) 4218 if err := googleapi.CheckResponse(res); err != nil { 4219 return nil, err 4220 } 4221 ret := &Person{ 4222 ServerResponse: googleapi.ServerResponse{ 4223 Header: res.Header, 4224 HTTPStatusCode: res.StatusCode, 4225 }, 4226 } 4227 target := &ret 4228 if err := gensupport.DecodeResponse(target, res); err != nil { 4229 return nil, err 4230 } 4231 return ret, nil 4232 // { 4233 // "description": "Copies an \"Other contact\" to a new contact in the user's \"myContacts\" group", 4234 // "flatPath": "v1/otherContacts/{otherContactsId}:copyOtherContactToMyContactsGroup", 4235 // "httpMethod": "POST", 4236 // "id": "people.otherContacts.copyOtherContactToMyContactsGroup", 4237 // "parameterOrder": [ 4238 // "resourceName" 4239 // ], 4240 // "parameters": { 4241 // "resourceName": { 4242 // "description": "Required. The resource name of the \"Other contact\" to copy.", 4243 // "location": "path", 4244 // "pattern": "^otherContacts/[^/]+$", 4245 // "required": true, 4246 // "type": "string" 4247 // } 4248 // }, 4249 // "path": "v1/{+resourceName}:copyOtherContactToMyContactsGroup", 4250 // "request": { 4251 // "$ref": "CopyOtherContactToMyContactsGroupRequest" 4252 // }, 4253 // "response": { 4254 // "$ref": "Person" 4255 // }, 4256 // "scopes": [ 4257 // "https://www.googleapis.com/auth/contacts", 4258 // "https://www.googleapis.com/auth/contacts.other.readonly" 4259 // ] 4260 // } 4261 4262} 4263 4264// method id "people.otherContacts.list": 4265 4266type OtherContactsListCall struct { 4267 s *Service 4268 urlParams_ gensupport.URLParams 4269 ifNoneMatch_ string 4270 ctx_ context.Context 4271 header_ http.Header 4272} 4273 4274// List: List all "Other contacts", that is contacts that are not in a 4275// contact 4276// group. "Other contacts" are typically auto created contacts 4277// from 4278// interactions. 4279func (r *OtherContactsService) List() *OtherContactsListCall { 4280 c := &OtherContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4281 return c 4282} 4283 4284// PageSize sets the optional parameter "pageSize": The number of "Other 4285// contacts" to include in the response. Valid values are 4286// between 1 and 1000, inclusive. Defaults to 100 if not set or set to 4287// 0. 4288func (c *OtherContactsListCall) PageSize(pageSize int64) *OtherContactsListCall { 4289 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4290 return c 4291} 4292 4293// PageToken sets the optional parameter "pageToken": A page token, 4294// received from a previous `ListOtherContacts` call. 4295// Provide this to retrieve the subsequent page. 4296// 4297// When paginating, all other parameters provided to 4298// `ListOtherContacts` 4299// must match the call that provided the page token. 4300func (c *OtherContactsListCall) PageToken(pageToken string) *OtherContactsListCall { 4301 c.urlParams_.Set("pageToken", pageToken) 4302 return c 4303} 4304 4305// ReadMask sets the optional parameter "readMask": Required. A field 4306// mask to restrict which fields on each person are returned. 4307// Multiple 4308// fields can be specified by separating them with commas. Valid values 4309// are: 4310// 4311// * emailAddresses 4312// * names 4313// * phoneNumbers 4314func (c *OtherContactsListCall) ReadMask(readMask string) *OtherContactsListCall { 4315 c.urlParams_.Set("readMask", readMask) 4316 return c 4317} 4318 4319// RequestSyncToken sets the optional parameter "requestSyncToken": 4320// Whether the response should include `next_sync_token`, which can be 4321// used to 4322// get all changes since the last request. For subsequent sync requests 4323// use 4324// the `sync_token` param instead. Initial sync requests that 4325// specify 4326// `request_sync_token` have an additional rate limit. 4327func (c *OtherContactsListCall) RequestSyncToken(requestSyncToken bool) *OtherContactsListCall { 4328 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken)) 4329 return c 4330} 4331 4332// SyncToken sets the optional parameter "syncToken": A sync token, 4333// received from a previous `ListOtherContacts` call. 4334// Provide this to retrieve only the resources changed since the last 4335// request. 4336// Sync requests that specify `sync_token` have an additional rate 4337// limit. 4338// 4339// When syncing, all other parameters provided to 4340// `ListOtherContacts` 4341// must match the call that provided the sync token. 4342func (c *OtherContactsListCall) SyncToken(syncToken string) *OtherContactsListCall { 4343 c.urlParams_.Set("syncToken", syncToken) 4344 return c 4345} 4346 4347// Fields allows partial responses to be retrieved. See 4348// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4349// for more information. 4350func (c *OtherContactsListCall) Fields(s ...googleapi.Field) *OtherContactsListCall { 4351 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4352 return c 4353} 4354 4355// IfNoneMatch sets the optional parameter which makes the operation 4356// fail if the object's ETag matches the given value. This is useful for 4357// getting updates only after the object has changed since the last 4358// request. Use googleapi.IsNotModified to check whether the response 4359// error from Do is the result of In-None-Match. 4360func (c *OtherContactsListCall) IfNoneMatch(entityTag string) *OtherContactsListCall { 4361 c.ifNoneMatch_ = entityTag 4362 return c 4363} 4364 4365// Context sets the context to be used in this call's Do method. Any 4366// pending HTTP request will be aborted if the provided context is 4367// canceled. 4368func (c *OtherContactsListCall) Context(ctx context.Context) *OtherContactsListCall { 4369 c.ctx_ = ctx 4370 return c 4371} 4372 4373// Header returns an http.Header that can be modified by the caller to 4374// add HTTP headers to the request. 4375func (c *OtherContactsListCall) Header() http.Header { 4376 if c.header_ == nil { 4377 c.header_ = make(http.Header) 4378 } 4379 return c.header_ 4380} 4381 4382func (c *OtherContactsListCall) doRequest(alt string) (*http.Response, error) { 4383 reqHeaders := make(http.Header) 4384 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4385 for k, v := range c.header_ { 4386 reqHeaders[k] = v 4387 } 4388 reqHeaders.Set("User-Agent", c.s.userAgent()) 4389 if c.ifNoneMatch_ != "" { 4390 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4391 } 4392 var body io.Reader = nil 4393 c.urlParams_.Set("alt", alt) 4394 c.urlParams_.Set("prettyPrint", "false") 4395 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/otherContacts") 4396 urls += "?" + c.urlParams_.Encode() 4397 req, err := http.NewRequest("GET", urls, body) 4398 if err != nil { 4399 return nil, err 4400 } 4401 req.Header = reqHeaders 4402 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4403} 4404 4405// Do executes the "people.otherContacts.list" call. 4406// Exactly one of *ListOtherContactsResponse or error will be non-nil. 4407// Any non-2xx status code is an error. Response headers are in either 4408// *ListOtherContactsResponse.ServerResponse.Header or (if a response 4409// was returned at all) in error.(*googleapi.Error).Header. Use 4410// googleapi.IsNotModified to check whether the returned error was 4411// because http.StatusNotModified was returned. 4412func (c *OtherContactsListCall) Do(opts ...googleapi.CallOption) (*ListOtherContactsResponse, error) { 4413 gensupport.SetOptions(c.urlParams_, opts...) 4414 res, err := c.doRequest("json") 4415 if res != nil && res.StatusCode == http.StatusNotModified { 4416 if res.Body != nil { 4417 res.Body.Close() 4418 } 4419 return nil, &googleapi.Error{ 4420 Code: res.StatusCode, 4421 Header: res.Header, 4422 } 4423 } 4424 if err != nil { 4425 return nil, err 4426 } 4427 defer googleapi.CloseBody(res) 4428 if err := googleapi.CheckResponse(res); err != nil { 4429 return nil, err 4430 } 4431 ret := &ListOtherContactsResponse{ 4432 ServerResponse: googleapi.ServerResponse{ 4433 Header: res.Header, 4434 HTTPStatusCode: res.StatusCode, 4435 }, 4436 } 4437 target := &ret 4438 if err := gensupport.DecodeResponse(target, res); err != nil { 4439 return nil, err 4440 } 4441 return ret, nil 4442 // { 4443 // "description": "List all \"Other contacts\", that is contacts that are not in a contact\ngroup. \"Other contacts\" are typically auto created contacts from\ninteractions.", 4444 // "flatPath": "v1/otherContacts", 4445 // "httpMethod": "GET", 4446 // "id": "people.otherContacts.list", 4447 // "parameterOrder": [], 4448 // "parameters": { 4449 // "pageSize": { 4450 // "description": "Optional. The number of \"Other contacts\" to include in the response. Valid values are\nbetween 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.", 4451 // "format": "int32", 4452 // "location": "query", 4453 // "type": "integer" 4454 // }, 4455 // "pageToken": { 4456 // "description": "Optional. A page token, received from a previous `ListOtherContacts` call.\nProvide this to retrieve the subsequent page.\n\nWhen paginating, all other parameters provided to `ListOtherContacts`\nmust match the call that provided the page token.", 4457 // "location": "query", 4458 // "type": "string" 4459 // }, 4460 // "readMask": { 4461 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* emailAddresses\n* names\n* phoneNumbers", 4462 // "format": "google-fieldmask", 4463 // "location": "query", 4464 // "type": "string" 4465 // }, 4466 // "requestSyncToken": { 4467 // "description": "Optional. Whether the response should include `next_sync_token`, which can be used to\nget all changes since the last request. For subsequent sync requests use\nthe `sync_token` param instead. Initial sync requests that specify\n`request_sync_token` have an additional rate limit.", 4468 // "location": "query", 4469 // "type": "boolean" 4470 // }, 4471 // "syncToken": { 4472 // "description": "Optional. A sync token, received from a previous `ListOtherContacts` call.\nProvide this to retrieve only the resources changed since the last request.\nSync requests that specify `sync_token` have an additional rate limit.\n\nWhen syncing, all other parameters provided to `ListOtherContacts`\nmust match the call that provided the sync token.", 4473 // "location": "query", 4474 // "type": "string" 4475 // } 4476 // }, 4477 // "path": "v1/otherContacts", 4478 // "response": { 4479 // "$ref": "ListOtherContactsResponse" 4480 // }, 4481 // "scopes": [ 4482 // "https://www.googleapis.com/auth/contacts.other.readonly" 4483 // ] 4484 // } 4485 4486} 4487 4488// Pages invokes f for each page of results. 4489// A non-nil error returned from f will halt the iteration. 4490// The provided context supersedes any context provided to the Context method. 4491func (c *OtherContactsListCall) Pages(ctx context.Context, f func(*ListOtherContactsResponse) error) error { 4492 c.ctx_ = ctx 4493 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4494 for { 4495 x, err := c.Do() 4496 if err != nil { 4497 return err 4498 } 4499 if err := f(x); err != nil { 4500 return err 4501 } 4502 if x.NextPageToken == "" { 4503 return nil 4504 } 4505 c.PageToken(x.NextPageToken) 4506 } 4507} 4508 4509// method id "people.people.createContact": 4510 4511type PeopleCreateContactCall struct { 4512 s *Service 4513 person *Person 4514 urlParams_ gensupport.URLParams 4515 ctx_ context.Context 4516 header_ http.Header 4517} 4518 4519// CreateContact: Create a new contact and return the person resource 4520// for that contact. 4521func (r *PeopleService) CreateContact(person *Person) *PeopleCreateContactCall { 4522 c := &PeopleCreateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4523 c.person = person 4524 return c 4525} 4526 4527// PersonFields sets the optional parameter "personFields": Required. A 4528// field mask to restrict which fields on each person are returned. 4529// Multiple 4530// fields can be specified by separating them with commas. Defaults to 4531// all 4532// fields if not set. Valid values are: 4533// 4534// * addresses 4535// * ageRanges 4536// * biographies 4537// * birthdays 4538// * coverPhotos 4539// * emailAddresses 4540// * events 4541// * genders 4542// * imClients 4543// * interests 4544// * locales 4545// * memberships 4546// * metadata 4547// * names 4548// * nicknames 4549// * occupations 4550// * organizations 4551// * phoneNumbers 4552// * photos 4553// * relations 4554// * residences 4555// * sipAddresses 4556// * skills 4557// * urls 4558// * userDefined 4559func (c *PeopleCreateContactCall) PersonFields(personFields string) *PeopleCreateContactCall { 4560 c.urlParams_.Set("personFields", personFields) 4561 return c 4562} 4563 4564// Sources sets the optional parameter "sources": A mask of what source 4565// types to return. Defaults to 4566// ReadSourceType.CONTACT and 4567// ReadSourceType.PROFILE if not 4568// set. 4569// 4570// Possible values: 4571// "READ_SOURCE_TYPE_UNSPECIFIED" 4572// "READ_SOURCE_TYPE_PROFILE" 4573// "READ_SOURCE_TYPE_CONTACT" 4574// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 4575func (c *PeopleCreateContactCall) Sources(sources ...string) *PeopleCreateContactCall { 4576 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 4577 return c 4578} 4579 4580// Fields allows partial responses to be retrieved. See 4581// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4582// for more information. 4583func (c *PeopleCreateContactCall) Fields(s ...googleapi.Field) *PeopleCreateContactCall { 4584 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4585 return c 4586} 4587 4588// Context sets the context to be used in this call's Do method. Any 4589// pending HTTP request will be aborted if the provided context is 4590// canceled. 4591func (c *PeopleCreateContactCall) Context(ctx context.Context) *PeopleCreateContactCall { 4592 c.ctx_ = ctx 4593 return c 4594} 4595 4596// Header returns an http.Header that can be modified by the caller to 4597// add HTTP headers to the request. 4598func (c *PeopleCreateContactCall) Header() http.Header { 4599 if c.header_ == nil { 4600 c.header_ = make(http.Header) 4601 } 4602 return c.header_ 4603} 4604 4605func (c *PeopleCreateContactCall) doRequest(alt string) (*http.Response, error) { 4606 reqHeaders := make(http.Header) 4607 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4608 for k, v := range c.header_ { 4609 reqHeaders[k] = v 4610 } 4611 reqHeaders.Set("User-Agent", c.s.userAgent()) 4612 var body io.Reader = nil 4613 body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) 4614 if err != nil { 4615 return nil, err 4616 } 4617 reqHeaders.Set("Content-Type", "application/json") 4618 c.urlParams_.Set("alt", alt) 4619 c.urlParams_.Set("prettyPrint", "false") 4620 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:createContact") 4621 urls += "?" + c.urlParams_.Encode() 4622 req, err := http.NewRequest("POST", urls, body) 4623 if err != nil { 4624 return nil, err 4625 } 4626 req.Header = reqHeaders 4627 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4628} 4629 4630// Do executes the "people.people.createContact" call. 4631// Exactly one of *Person or error will be non-nil. Any non-2xx status 4632// code is an error. Response headers are in either 4633// *Person.ServerResponse.Header or (if a response was returned at all) 4634// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4635// check whether the returned error was because http.StatusNotModified 4636// was returned. 4637func (c *PeopleCreateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) { 4638 gensupport.SetOptions(c.urlParams_, opts...) 4639 res, err := c.doRequest("json") 4640 if res != nil && res.StatusCode == http.StatusNotModified { 4641 if res.Body != nil { 4642 res.Body.Close() 4643 } 4644 return nil, &googleapi.Error{ 4645 Code: res.StatusCode, 4646 Header: res.Header, 4647 } 4648 } 4649 if err != nil { 4650 return nil, err 4651 } 4652 defer googleapi.CloseBody(res) 4653 if err := googleapi.CheckResponse(res); err != nil { 4654 return nil, err 4655 } 4656 ret := &Person{ 4657 ServerResponse: googleapi.ServerResponse{ 4658 Header: res.Header, 4659 HTTPStatusCode: res.StatusCode, 4660 }, 4661 } 4662 target := &ret 4663 if err := gensupport.DecodeResponse(target, res); err != nil { 4664 return nil, err 4665 } 4666 return ret, nil 4667 // { 4668 // "description": "Create a new contact and return the person resource for that contact.", 4669 // "flatPath": "v1/people:createContact", 4670 // "httpMethod": "POST", 4671 // "id": "people.people.createContact", 4672 // "parameterOrder": [], 4673 // "parameters": { 4674 // "personFields": { 4675 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Defaults to all\nfields if not set. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 4676 // "format": "google-fieldmask", 4677 // "location": "query", 4678 // "type": "string" 4679 // }, 4680 // "sources": { 4681 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.CONTACT and\nReadSourceType.PROFILE if not\nset.", 4682 // "enum": [ 4683 // "READ_SOURCE_TYPE_UNSPECIFIED", 4684 // "READ_SOURCE_TYPE_PROFILE", 4685 // "READ_SOURCE_TYPE_CONTACT", 4686 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 4687 // ], 4688 // "location": "query", 4689 // "repeated": true, 4690 // "type": "string" 4691 // } 4692 // }, 4693 // "path": "v1/people:createContact", 4694 // "request": { 4695 // "$ref": "Person" 4696 // }, 4697 // "response": { 4698 // "$ref": "Person" 4699 // }, 4700 // "scopes": [ 4701 // "https://www.googleapis.com/auth/contacts" 4702 // ] 4703 // } 4704 4705} 4706 4707// method id "people.people.deleteContact": 4708 4709type PeopleDeleteContactCall struct { 4710 s *Service 4711 resourceName string 4712 urlParams_ gensupport.URLParams 4713 ctx_ context.Context 4714 header_ http.Header 4715} 4716 4717// DeleteContact: Delete a contact person. Any non-contact data will not 4718// be deleted. 4719func (r *PeopleService) DeleteContact(resourceName string) *PeopleDeleteContactCall { 4720 c := &PeopleDeleteContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4721 c.resourceName = resourceName 4722 return c 4723} 4724 4725// Fields allows partial responses to be retrieved. See 4726// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4727// for more information. 4728func (c *PeopleDeleteContactCall) Fields(s ...googleapi.Field) *PeopleDeleteContactCall { 4729 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4730 return c 4731} 4732 4733// Context sets the context to be used in this call's Do method. Any 4734// pending HTTP request will be aborted if the provided context is 4735// canceled. 4736func (c *PeopleDeleteContactCall) Context(ctx context.Context) *PeopleDeleteContactCall { 4737 c.ctx_ = ctx 4738 return c 4739} 4740 4741// Header returns an http.Header that can be modified by the caller to 4742// add HTTP headers to the request. 4743func (c *PeopleDeleteContactCall) Header() http.Header { 4744 if c.header_ == nil { 4745 c.header_ = make(http.Header) 4746 } 4747 return c.header_ 4748} 4749 4750func (c *PeopleDeleteContactCall) doRequest(alt string) (*http.Response, error) { 4751 reqHeaders := make(http.Header) 4752 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4753 for k, v := range c.header_ { 4754 reqHeaders[k] = v 4755 } 4756 reqHeaders.Set("User-Agent", c.s.userAgent()) 4757 var body io.Reader = nil 4758 c.urlParams_.Set("alt", alt) 4759 c.urlParams_.Set("prettyPrint", "false") 4760 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContact") 4761 urls += "?" + c.urlParams_.Encode() 4762 req, err := http.NewRequest("DELETE", urls, body) 4763 if err != nil { 4764 return nil, err 4765 } 4766 req.Header = reqHeaders 4767 googleapi.Expand(req.URL, map[string]string{ 4768 "resourceName": c.resourceName, 4769 }) 4770 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4771} 4772 4773// Do executes the "people.people.deleteContact" call. 4774// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4775// code is an error. Response headers are in either 4776// *Empty.ServerResponse.Header or (if a response was returned at all) 4777// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4778// check whether the returned error was because http.StatusNotModified 4779// was returned. 4780func (c *PeopleDeleteContactCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4781 gensupport.SetOptions(c.urlParams_, opts...) 4782 res, err := c.doRequest("json") 4783 if res != nil && res.StatusCode == http.StatusNotModified { 4784 if res.Body != nil { 4785 res.Body.Close() 4786 } 4787 return nil, &googleapi.Error{ 4788 Code: res.StatusCode, 4789 Header: res.Header, 4790 } 4791 } 4792 if err != nil { 4793 return nil, err 4794 } 4795 defer googleapi.CloseBody(res) 4796 if err := googleapi.CheckResponse(res); err != nil { 4797 return nil, err 4798 } 4799 ret := &Empty{ 4800 ServerResponse: googleapi.ServerResponse{ 4801 Header: res.Header, 4802 HTTPStatusCode: res.StatusCode, 4803 }, 4804 } 4805 target := &ret 4806 if err := gensupport.DecodeResponse(target, res); err != nil { 4807 return nil, err 4808 } 4809 return ret, nil 4810 // { 4811 // "description": "Delete a contact person. Any non-contact data will not be deleted.", 4812 // "flatPath": "v1/people/{peopleId}:deleteContact", 4813 // "httpMethod": "DELETE", 4814 // "id": "people.people.deleteContact", 4815 // "parameterOrder": [ 4816 // "resourceName" 4817 // ], 4818 // "parameters": { 4819 // "resourceName": { 4820 // "description": "Required. The resource name of the contact to delete.", 4821 // "location": "path", 4822 // "pattern": "^people/[^/]+$", 4823 // "required": true, 4824 // "type": "string" 4825 // } 4826 // }, 4827 // "path": "v1/{+resourceName}:deleteContact", 4828 // "response": { 4829 // "$ref": "Empty" 4830 // }, 4831 // "scopes": [ 4832 // "https://www.googleapis.com/auth/contacts" 4833 // ] 4834 // } 4835 4836} 4837 4838// method id "people.people.deleteContactPhoto": 4839 4840type PeopleDeleteContactPhotoCall struct { 4841 s *Service 4842 resourceName string 4843 urlParams_ gensupport.URLParams 4844 ctx_ context.Context 4845 header_ http.Header 4846} 4847 4848// DeleteContactPhoto: Delete a contact's photo. 4849func (r *PeopleService) DeleteContactPhoto(resourceName string) *PeopleDeleteContactPhotoCall { 4850 c := &PeopleDeleteContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4851 c.resourceName = resourceName 4852 return c 4853} 4854 4855// PersonFields sets the optional parameter "personFields": A field mask 4856// to restrict which fields on the person are returned. Multiple 4857// fields can be specified by separating them with commas. Defaults to 4858// empty 4859// if not set, which will skip the post mutate get. Valid values are: 4860// 4861// * addresses 4862// * ageRanges 4863// * biographies 4864// * birthdays 4865// * coverPhotos 4866// * emailAddresses 4867// * events 4868// * genders 4869// * imClients 4870// * interests 4871// * locales 4872// * memberships 4873// * metadata 4874// * names 4875// * nicknames 4876// * occupations 4877// * organizations 4878// * phoneNumbers 4879// * photos 4880// * relations 4881// * residences 4882// * sipAddresses 4883// * skills 4884// * urls 4885// * userDefined 4886func (c *PeopleDeleteContactPhotoCall) PersonFields(personFields string) *PeopleDeleteContactPhotoCall { 4887 c.urlParams_.Set("personFields", personFields) 4888 return c 4889} 4890 4891// Sources sets the optional parameter "sources": A mask of what source 4892// types to return. Defaults to 4893// ReadSourceType.CONTACT and 4894// ReadSourceType.PROFILE if not 4895// set. 4896// 4897// Possible values: 4898// "READ_SOURCE_TYPE_UNSPECIFIED" 4899// "READ_SOURCE_TYPE_PROFILE" 4900// "READ_SOURCE_TYPE_CONTACT" 4901// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 4902func (c *PeopleDeleteContactPhotoCall) Sources(sources ...string) *PeopleDeleteContactPhotoCall { 4903 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 4904 return c 4905} 4906 4907// Fields allows partial responses to be retrieved. See 4908// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4909// for more information. 4910func (c *PeopleDeleteContactPhotoCall) Fields(s ...googleapi.Field) *PeopleDeleteContactPhotoCall { 4911 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4912 return c 4913} 4914 4915// Context sets the context to be used in this call's Do method. Any 4916// pending HTTP request will be aborted if the provided context is 4917// canceled. 4918func (c *PeopleDeleteContactPhotoCall) Context(ctx context.Context) *PeopleDeleteContactPhotoCall { 4919 c.ctx_ = ctx 4920 return c 4921} 4922 4923// Header returns an http.Header that can be modified by the caller to 4924// add HTTP headers to the request. 4925func (c *PeopleDeleteContactPhotoCall) Header() http.Header { 4926 if c.header_ == nil { 4927 c.header_ = make(http.Header) 4928 } 4929 return c.header_ 4930} 4931 4932func (c *PeopleDeleteContactPhotoCall) doRequest(alt string) (*http.Response, error) { 4933 reqHeaders := make(http.Header) 4934 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 4935 for k, v := range c.header_ { 4936 reqHeaders[k] = v 4937 } 4938 reqHeaders.Set("User-Agent", c.s.userAgent()) 4939 var body io.Reader = nil 4940 c.urlParams_.Set("alt", alt) 4941 c.urlParams_.Set("prettyPrint", "false") 4942 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContactPhoto") 4943 urls += "?" + c.urlParams_.Encode() 4944 req, err := http.NewRequest("DELETE", urls, body) 4945 if err != nil { 4946 return nil, err 4947 } 4948 req.Header = reqHeaders 4949 googleapi.Expand(req.URL, map[string]string{ 4950 "resourceName": c.resourceName, 4951 }) 4952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4953} 4954 4955// Do executes the "people.people.deleteContactPhoto" call. 4956// Exactly one of *DeleteContactPhotoResponse or error will be non-nil. 4957// Any non-2xx status code is an error. Response headers are in either 4958// *DeleteContactPhotoResponse.ServerResponse.Header or (if a response 4959// was returned at all) in error.(*googleapi.Error).Header. Use 4960// googleapi.IsNotModified to check whether the returned error was 4961// because http.StatusNotModified was returned. 4962func (c *PeopleDeleteContactPhotoCall) Do(opts ...googleapi.CallOption) (*DeleteContactPhotoResponse, error) { 4963 gensupport.SetOptions(c.urlParams_, opts...) 4964 res, err := c.doRequest("json") 4965 if res != nil && res.StatusCode == http.StatusNotModified { 4966 if res.Body != nil { 4967 res.Body.Close() 4968 } 4969 return nil, &googleapi.Error{ 4970 Code: res.StatusCode, 4971 Header: res.Header, 4972 } 4973 } 4974 if err != nil { 4975 return nil, err 4976 } 4977 defer googleapi.CloseBody(res) 4978 if err := googleapi.CheckResponse(res); err != nil { 4979 return nil, err 4980 } 4981 ret := &DeleteContactPhotoResponse{ 4982 ServerResponse: googleapi.ServerResponse{ 4983 Header: res.Header, 4984 HTTPStatusCode: res.StatusCode, 4985 }, 4986 } 4987 target := &ret 4988 if err := gensupport.DecodeResponse(target, res); err != nil { 4989 return nil, err 4990 } 4991 return ret, nil 4992 // { 4993 // "description": "Delete a contact's photo.", 4994 // "flatPath": "v1/people/{peopleId}:deleteContactPhoto", 4995 // "httpMethod": "DELETE", 4996 // "id": "people.people.deleteContactPhoto", 4997 // "parameterOrder": [ 4998 // "resourceName" 4999 // ], 5000 // "parameters": { 5001 // "personFields": { 5002 // "description": "Optional. A field mask to restrict which fields on the person are returned. Multiple\nfields can be specified by separating them with commas. Defaults to empty\nif not set, which will skip the post mutate get. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 5003 // "format": "google-fieldmask", 5004 // "location": "query", 5005 // "type": "string" 5006 // }, 5007 // "resourceName": { 5008 // "description": "Required. The resource name of the contact whose photo will be deleted.", 5009 // "location": "path", 5010 // "pattern": "^people/[^/]+$", 5011 // "required": true, 5012 // "type": "string" 5013 // }, 5014 // "sources": { 5015 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.CONTACT and\nReadSourceType.PROFILE if not\nset.", 5016 // "enum": [ 5017 // "READ_SOURCE_TYPE_UNSPECIFIED", 5018 // "READ_SOURCE_TYPE_PROFILE", 5019 // "READ_SOURCE_TYPE_CONTACT", 5020 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 5021 // ], 5022 // "location": "query", 5023 // "repeated": true, 5024 // "type": "string" 5025 // } 5026 // }, 5027 // "path": "v1/{+resourceName}:deleteContactPhoto", 5028 // "response": { 5029 // "$ref": "DeleteContactPhotoResponse" 5030 // }, 5031 // "scopes": [ 5032 // "https://www.googleapis.com/auth/contacts" 5033 // ] 5034 // } 5035 5036} 5037 5038// method id "people.people.get": 5039 5040type PeopleGetCall struct { 5041 s *Service 5042 resourceName string 5043 urlParams_ gensupport.URLParams 5044 ifNoneMatch_ string 5045 ctx_ context.Context 5046 header_ http.Header 5047} 5048 5049// Get: Provides information about a person by specifying a resource 5050// name. Use 5051// `people/me` to indicate the authenticated user. 5052// 5053// The request throws a 400 error if 'personFields' is not specified. 5054func (r *PeopleService) Get(resourceName string) *PeopleGetCall { 5055 c := &PeopleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5056 c.resourceName = resourceName 5057 return c 5058} 5059 5060// PersonFields sets the optional parameter "personFields": Required. A 5061// field mask to restrict which fields on the person are returned. 5062// Multiple 5063// fields can be specified by separating them with commas. Valid values 5064// are: 5065// 5066// * addresses 5067// * ageRanges 5068// * biographies 5069// * birthdays 5070// * coverPhotos 5071// * emailAddresses 5072// * events 5073// * genders 5074// * imClients 5075// * interests 5076// * locales 5077// * memberships 5078// * metadata 5079// * names 5080// * nicknames 5081// * occupations 5082// * organizations 5083// * phoneNumbers 5084// * photos 5085// * relations 5086// * residences 5087// * sipAddresses 5088// * skills 5089// * urls 5090// * userDefined 5091func (c *PeopleGetCall) PersonFields(personFields string) *PeopleGetCall { 5092 c.urlParams_.Set("personFields", personFields) 5093 return c 5094} 5095 5096// RequestMaskIncludeField sets the optional parameter 5097// "requestMask.includeField": Required. Comma-separated list of person 5098// fields to be included in the response. Each 5099// path should start with `person.`: for example, `person.names` 5100// or 5101// `person.photos`. 5102func (c *PeopleGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetCall { 5103 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 5104 return c 5105} 5106 5107// Sources sets the optional parameter "sources": A mask of what source 5108// types to return. Defaults 5109// to 5110// ReadSourceType.PROFILE 5111// and 5112// ReadSourceType.CONTACT 5113// if not set. 5114// 5115// Possible values: 5116// "READ_SOURCE_TYPE_UNSPECIFIED" 5117// "READ_SOURCE_TYPE_PROFILE" 5118// "READ_SOURCE_TYPE_CONTACT" 5119// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 5120func (c *PeopleGetCall) Sources(sources ...string) *PeopleGetCall { 5121 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 5122 return c 5123} 5124 5125// Fields allows partial responses to be retrieved. See 5126// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5127// for more information. 5128func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall { 5129 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5130 return c 5131} 5132 5133// IfNoneMatch sets the optional parameter which makes the operation 5134// fail if the object's ETag matches the given value. This is useful for 5135// getting updates only after the object has changed since the last 5136// request. Use googleapi.IsNotModified to check whether the response 5137// error from Do is the result of In-None-Match. 5138func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall { 5139 c.ifNoneMatch_ = entityTag 5140 return c 5141} 5142 5143// Context sets the context to be used in this call's Do method. Any 5144// pending HTTP request will be aborted if the provided context is 5145// canceled. 5146func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall { 5147 c.ctx_ = ctx 5148 return c 5149} 5150 5151// Header returns an http.Header that can be modified by the caller to 5152// add HTTP headers to the request. 5153func (c *PeopleGetCall) Header() http.Header { 5154 if c.header_ == nil { 5155 c.header_ = make(http.Header) 5156 } 5157 return c.header_ 5158} 5159 5160func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) { 5161 reqHeaders := make(http.Header) 5162 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 5163 for k, v := range c.header_ { 5164 reqHeaders[k] = v 5165 } 5166 reqHeaders.Set("User-Agent", c.s.userAgent()) 5167 if c.ifNoneMatch_ != "" { 5168 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5169 } 5170 var body io.Reader = nil 5171 c.urlParams_.Set("alt", alt) 5172 c.urlParams_.Set("prettyPrint", "false") 5173 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 5174 urls += "?" + c.urlParams_.Encode() 5175 req, err := http.NewRequest("GET", urls, body) 5176 if err != nil { 5177 return nil, err 5178 } 5179 req.Header = reqHeaders 5180 googleapi.Expand(req.URL, map[string]string{ 5181 "resourceName": c.resourceName, 5182 }) 5183 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5184} 5185 5186// Do executes the "people.people.get" call. 5187// Exactly one of *Person or error will be non-nil. Any non-2xx status 5188// code is an error. Response headers are in either 5189// *Person.ServerResponse.Header or (if a response was returned at all) 5190// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5191// check whether the returned error was because http.StatusNotModified 5192// was returned. 5193func (c *PeopleGetCall) Do(opts ...googleapi.CallOption) (*Person, error) { 5194 gensupport.SetOptions(c.urlParams_, opts...) 5195 res, err := c.doRequest("json") 5196 if res != nil && res.StatusCode == http.StatusNotModified { 5197 if res.Body != nil { 5198 res.Body.Close() 5199 } 5200 return nil, &googleapi.Error{ 5201 Code: res.StatusCode, 5202 Header: res.Header, 5203 } 5204 } 5205 if err != nil { 5206 return nil, err 5207 } 5208 defer googleapi.CloseBody(res) 5209 if err := googleapi.CheckResponse(res); err != nil { 5210 return nil, err 5211 } 5212 ret := &Person{ 5213 ServerResponse: googleapi.ServerResponse{ 5214 Header: res.Header, 5215 HTTPStatusCode: res.StatusCode, 5216 }, 5217 } 5218 target := &ret 5219 if err := gensupport.DecodeResponse(target, res); err != nil { 5220 return nil, err 5221 } 5222 return ret, nil 5223 // { 5224 // "description": "Provides information about a person by specifying a resource name. Use\n`people/me` to indicate the authenticated user.\n\nThe request throws a 400 error if 'personFields' is not specified.", 5225 // "flatPath": "v1/people/{peopleId}", 5226 // "httpMethod": "GET", 5227 // "id": "people.people.get", 5228 // "parameterOrder": [ 5229 // "resourceName" 5230 // ], 5231 // "parameters": { 5232 // "personFields": { 5233 // "description": "Required. A field mask to restrict which fields on the person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 5234 // "format": "google-fieldmask", 5235 // "location": "query", 5236 // "type": "string" 5237 // }, 5238 // "requestMask.includeField": { 5239 // "description": "Required. Comma-separated list of person fields to be included in the response. Each\npath should start with `person.`: for example, `person.names` or\n`person.photos`.", 5240 // "format": "google-fieldmask", 5241 // "location": "query", 5242 // "type": "string" 5243 // }, 5244 // "resourceName": { 5245 // "description": "Required. The resource name of the person to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/{account_id}`.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).", 5246 // "location": "path", 5247 // "pattern": "^people/[^/]+$", 5248 // "required": true, 5249 // "type": "string" 5250 // }, 5251 // "sources": { 5252 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.PROFILE\nand\nReadSourceType.CONTACT\nif not set.", 5253 // "enum": [ 5254 // "READ_SOURCE_TYPE_UNSPECIFIED", 5255 // "READ_SOURCE_TYPE_PROFILE", 5256 // "READ_SOURCE_TYPE_CONTACT", 5257 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 5258 // ], 5259 // "location": "query", 5260 // "repeated": true, 5261 // "type": "string" 5262 // } 5263 // }, 5264 // "path": "v1/{+resourceName}", 5265 // "response": { 5266 // "$ref": "Person" 5267 // }, 5268 // "scopes": [ 5269 // "https://www.googleapis.com/auth/contacts", 5270 // "https://www.googleapis.com/auth/contacts.readonly", 5271 // "https://www.googleapis.com/auth/directory.readonly", 5272 // "https://www.googleapis.com/auth/user.addresses.read", 5273 // "https://www.googleapis.com/auth/user.birthday.read", 5274 // "https://www.googleapis.com/auth/user.emails.read", 5275 // "https://www.googleapis.com/auth/user.gender.read", 5276 // "https://www.googleapis.com/auth/user.organization.read", 5277 // "https://www.googleapis.com/auth/user.phonenumbers.read", 5278 // "https://www.googleapis.com/auth/userinfo.email", 5279 // "https://www.googleapis.com/auth/userinfo.profile" 5280 // ] 5281 // } 5282 5283} 5284 5285// method id "people.people.getBatchGet": 5286 5287type PeopleGetBatchGetCall struct { 5288 s *Service 5289 urlParams_ gensupport.URLParams 5290 ifNoneMatch_ string 5291 ctx_ context.Context 5292 header_ http.Header 5293} 5294 5295// GetBatchGet: Provides information about a list of specific people by 5296// specifying a list 5297// of requested resource names. Use `people/me` to indicate the 5298// authenticated 5299// user. 5300// 5301// The request throws a 400 error if 'personFields' is not specified. 5302func (r *PeopleService) GetBatchGet() *PeopleGetBatchGetCall { 5303 c := &PeopleGetBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5304 return c 5305} 5306 5307// PersonFields sets the optional parameter "personFields": Required. A 5308// field mask to restrict which fields on each person are returned. 5309// Multiple 5310// fields can be specified by separating them with commas. Valid values 5311// are: 5312// 5313// * addresses 5314// * ageRanges 5315// * biographies 5316// * birthdays 5317// * coverPhotos 5318// * emailAddresses 5319// * events 5320// * genders 5321// * imClients 5322// * interests 5323// * locales 5324// * memberships 5325// * metadata 5326// * names 5327// * nicknames 5328// * occupations 5329// * organizations 5330// * phoneNumbers 5331// * photos 5332// * relations 5333// * residences 5334// * sipAddresses 5335// * skills 5336// * urls 5337// * userDefined 5338func (c *PeopleGetBatchGetCall) PersonFields(personFields string) *PeopleGetBatchGetCall { 5339 c.urlParams_.Set("personFields", personFields) 5340 return c 5341} 5342 5343// RequestMaskIncludeField sets the optional parameter 5344// "requestMask.includeField": Required. Comma-separated list of person 5345// fields to be included in the response. Each 5346// path should start with `person.`: for example, `person.names` 5347// or 5348// `person.photos`. 5349func (c *PeopleGetBatchGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetBatchGetCall { 5350 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 5351 return c 5352} 5353 5354// ResourceNames sets the optional parameter "resourceNames": Required. 5355// The resource names of the people to provide information about. 5356// 5357// - To get information about the authenticated user, specify 5358// `people/me`. 5359// - To get information about a google account, specify 5360// `people/{account_id}`. 5361// - To get information about a contact, specify the resource name that 5362// identifies the contact as returned 5363// by 5364// [`people.connections.list`](/people/api/rest/v1/people.connections/ 5365// list). 5366// 5367// You can include up to 50 resource names in one request. 5368func (c *PeopleGetBatchGetCall) ResourceNames(resourceNames ...string) *PeopleGetBatchGetCall { 5369 c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) 5370 return c 5371} 5372 5373// Sources sets the optional parameter "sources": A mask of what source 5374// types to return. Defaults 5375// to 5376// ReadSourceType.CONTACT 5377// and 5378// ReadSourceType.PROFILE 5379// if not set. 5380// 5381// Possible values: 5382// "READ_SOURCE_TYPE_UNSPECIFIED" 5383// "READ_SOURCE_TYPE_PROFILE" 5384// "READ_SOURCE_TYPE_CONTACT" 5385// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 5386func (c *PeopleGetBatchGetCall) Sources(sources ...string) *PeopleGetBatchGetCall { 5387 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 5388 return c 5389} 5390 5391// Fields allows partial responses to be retrieved. See 5392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5393// for more information. 5394func (c *PeopleGetBatchGetCall) Fields(s ...googleapi.Field) *PeopleGetBatchGetCall { 5395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5396 return c 5397} 5398 5399// IfNoneMatch sets the optional parameter which makes the operation 5400// fail if the object's ETag matches the given value. This is useful for 5401// getting updates only after the object has changed since the last 5402// request. Use googleapi.IsNotModified to check whether the response 5403// error from Do is the result of In-None-Match. 5404func (c *PeopleGetBatchGetCall) IfNoneMatch(entityTag string) *PeopleGetBatchGetCall { 5405 c.ifNoneMatch_ = entityTag 5406 return c 5407} 5408 5409// Context sets the context to be used in this call's Do method. Any 5410// pending HTTP request will be aborted if the provided context is 5411// canceled. 5412func (c *PeopleGetBatchGetCall) Context(ctx context.Context) *PeopleGetBatchGetCall { 5413 c.ctx_ = ctx 5414 return c 5415} 5416 5417// Header returns an http.Header that can be modified by the caller to 5418// add HTTP headers to the request. 5419func (c *PeopleGetBatchGetCall) Header() http.Header { 5420 if c.header_ == nil { 5421 c.header_ = make(http.Header) 5422 } 5423 return c.header_ 5424} 5425 5426func (c *PeopleGetBatchGetCall) doRequest(alt string) (*http.Response, error) { 5427 reqHeaders := make(http.Header) 5428 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 5429 for k, v := range c.header_ { 5430 reqHeaders[k] = v 5431 } 5432 reqHeaders.Set("User-Agent", c.s.userAgent()) 5433 if c.ifNoneMatch_ != "" { 5434 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5435 } 5436 var body io.Reader = nil 5437 c.urlParams_.Set("alt", alt) 5438 c.urlParams_.Set("prettyPrint", "false") 5439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchGet") 5440 urls += "?" + c.urlParams_.Encode() 5441 req, err := http.NewRequest("GET", urls, body) 5442 if err != nil { 5443 return nil, err 5444 } 5445 req.Header = reqHeaders 5446 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5447} 5448 5449// Do executes the "people.people.getBatchGet" call. 5450// Exactly one of *GetPeopleResponse or error will be non-nil. Any 5451// non-2xx status code is an error. Response headers are in either 5452// *GetPeopleResponse.ServerResponse.Header or (if a response was 5453// returned at all) in error.(*googleapi.Error).Header. Use 5454// googleapi.IsNotModified to check whether the returned error was 5455// because http.StatusNotModified was returned. 5456func (c *PeopleGetBatchGetCall) Do(opts ...googleapi.CallOption) (*GetPeopleResponse, error) { 5457 gensupport.SetOptions(c.urlParams_, opts...) 5458 res, err := c.doRequest("json") 5459 if res != nil && res.StatusCode == http.StatusNotModified { 5460 if res.Body != nil { 5461 res.Body.Close() 5462 } 5463 return nil, &googleapi.Error{ 5464 Code: res.StatusCode, 5465 Header: res.Header, 5466 } 5467 } 5468 if err != nil { 5469 return nil, err 5470 } 5471 defer googleapi.CloseBody(res) 5472 if err := googleapi.CheckResponse(res); err != nil { 5473 return nil, err 5474 } 5475 ret := &GetPeopleResponse{ 5476 ServerResponse: googleapi.ServerResponse{ 5477 Header: res.Header, 5478 HTTPStatusCode: res.StatusCode, 5479 }, 5480 } 5481 target := &ret 5482 if err := gensupport.DecodeResponse(target, res); err != nil { 5483 return nil, err 5484 } 5485 return ret, nil 5486 // { 5487 // "description": "Provides information about a list of specific people by specifying a list\nof requested resource names. Use `people/me` to indicate the authenticated\nuser.\n\nThe request throws a 400 error if 'personFields' is not specified.", 5488 // "flatPath": "v1/people:batchGet", 5489 // "httpMethod": "GET", 5490 // "id": "people.people.getBatchGet", 5491 // "parameterOrder": [], 5492 // "parameters": { 5493 // "personFields": { 5494 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 5495 // "format": "google-fieldmask", 5496 // "location": "query", 5497 // "type": "string" 5498 // }, 5499 // "requestMask.includeField": { 5500 // "description": "Required. Comma-separated list of person fields to be included in the response. Each\npath should start with `person.`: for example, `person.names` or\n`person.photos`.", 5501 // "format": "google-fieldmask", 5502 // "location": "query", 5503 // "type": "string" 5504 // }, 5505 // "resourceNames": { 5506 // "description": "Required. The resource names of the people to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/{account_id}`.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).\n\nYou can include up to 50 resource names in one request.", 5507 // "location": "query", 5508 // "repeated": true, 5509 // "type": "string" 5510 // }, 5511 // "sources": { 5512 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.CONTACT\nand\nReadSourceType.PROFILE\nif not set.", 5513 // "enum": [ 5514 // "READ_SOURCE_TYPE_UNSPECIFIED", 5515 // "READ_SOURCE_TYPE_PROFILE", 5516 // "READ_SOURCE_TYPE_CONTACT", 5517 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 5518 // ], 5519 // "location": "query", 5520 // "repeated": true, 5521 // "type": "string" 5522 // } 5523 // }, 5524 // "path": "v1/people:batchGet", 5525 // "response": { 5526 // "$ref": "GetPeopleResponse" 5527 // }, 5528 // "scopes": [ 5529 // "https://www.googleapis.com/auth/contacts", 5530 // "https://www.googleapis.com/auth/contacts.readonly", 5531 // "https://www.googleapis.com/auth/directory.readonly", 5532 // "https://www.googleapis.com/auth/user.addresses.read", 5533 // "https://www.googleapis.com/auth/user.birthday.read", 5534 // "https://www.googleapis.com/auth/user.emails.read", 5535 // "https://www.googleapis.com/auth/user.gender.read", 5536 // "https://www.googleapis.com/auth/user.organization.read", 5537 // "https://www.googleapis.com/auth/user.phonenumbers.read", 5538 // "https://www.googleapis.com/auth/userinfo.email", 5539 // "https://www.googleapis.com/auth/userinfo.profile" 5540 // ] 5541 // } 5542 5543} 5544 5545// method id "people.people.listDirectoryPeople": 5546 5547type PeopleListDirectoryPeopleCall struct { 5548 s *Service 5549 urlParams_ gensupport.URLParams 5550 ifNoneMatch_ string 5551 ctx_ context.Context 5552 header_ http.Header 5553} 5554 5555// ListDirectoryPeople: Provides a list of domain profiles and domain 5556// contacts in the authenticated 5557// user's domain directory. 5558func (r *PeopleService) ListDirectoryPeople() *PeopleListDirectoryPeopleCall { 5559 c := &PeopleListDirectoryPeopleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5560 return c 5561} 5562 5563// MergeSources sets the optional parameter "mergeSources": Additional 5564// data to merge into the directory sources if they are 5565// connected 5566// through verified join keys such as email addresses or phone numbers. 5567// 5568// Possible values: 5569// "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED" 5570// "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" 5571func (c *PeopleListDirectoryPeopleCall) MergeSources(mergeSources ...string) *PeopleListDirectoryPeopleCall { 5572 c.urlParams_.SetMulti("mergeSources", append([]string{}, mergeSources...)) 5573 return c 5574} 5575 5576// PageSize sets the optional parameter "pageSize": The number of people 5577// to include in the response. Valid values are 5578// between 1 and 1000, inclusive. Defaults to 100 if not set or set to 5579// 0. 5580func (c *PeopleListDirectoryPeopleCall) PageSize(pageSize int64) *PeopleListDirectoryPeopleCall { 5581 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5582 return c 5583} 5584 5585// PageToken sets the optional parameter "pageToken": A page token, 5586// received from a previous `ListDirectoryPeople` call. 5587// Provide this to retrieve the subsequent page. 5588// 5589// When paginating, all other parameters provided to 5590// `ListDirectoryPeople` 5591// must match the call that provided the page token. 5592func (c *PeopleListDirectoryPeopleCall) PageToken(pageToken string) *PeopleListDirectoryPeopleCall { 5593 c.urlParams_.Set("pageToken", pageToken) 5594 return c 5595} 5596 5597// ReadMask sets the optional parameter "readMask": Required. A field 5598// mask to restrict which fields on each person are returned. 5599// Multiple 5600// fields can be specified by separating them with commas. Valid values 5601// are: 5602// 5603// * addresses 5604// * ageRanges 5605// * biographies 5606// * birthdays 5607// * coverPhotos 5608// * emailAddresses 5609// * events 5610// * genders 5611// * imClients 5612// * interests 5613// * locales 5614// * memberships 5615// * metadata 5616// * names 5617// * nicknames 5618// * occupations 5619// * organizations 5620// * phoneNumbers 5621// * photos 5622// * relations 5623// * residences 5624// * sipAddresses 5625// * skills 5626// * urls 5627// * userDefined 5628func (c *PeopleListDirectoryPeopleCall) ReadMask(readMask string) *PeopleListDirectoryPeopleCall { 5629 c.urlParams_.Set("readMask", readMask) 5630 return c 5631} 5632 5633// RequestSyncToken sets the optional parameter "requestSyncToken": 5634// Whether the response should include `next_sync_token`, which can be 5635// used to 5636// get all changes since the last request. For subsequent sync requests 5637// use 5638// the `sync_token` param instead. 5639func (c *PeopleListDirectoryPeopleCall) RequestSyncToken(requestSyncToken bool) *PeopleListDirectoryPeopleCall { 5640 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken)) 5641 return c 5642} 5643 5644// Sources sets the optional parameter "sources": Required. Directory 5645// sources to return. 5646// 5647// Possible values: 5648// "DIRECTORY_SOURCE_TYPE_UNSPECIFIED" 5649// "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT" 5650// "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" 5651func (c *PeopleListDirectoryPeopleCall) Sources(sources ...string) *PeopleListDirectoryPeopleCall { 5652 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 5653 return c 5654} 5655 5656// SyncToken sets the optional parameter "syncToken": A sync token, 5657// received from a previous `ListDirectoryPeople` call. 5658// Provide this to retrieve only the resources changed since the last 5659// request. 5660// 5661// When syncing, all other parameters provided to 5662// `ListDirectoryPeople` 5663// must match the call that provided the sync token. 5664func (c *PeopleListDirectoryPeopleCall) SyncToken(syncToken string) *PeopleListDirectoryPeopleCall { 5665 c.urlParams_.Set("syncToken", syncToken) 5666 return c 5667} 5668 5669// Fields allows partial responses to be retrieved. See 5670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5671// for more information. 5672func (c *PeopleListDirectoryPeopleCall) Fields(s ...googleapi.Field) *PeopleListDirectoryPeopleCall { 5673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5674 return c 5675} 5676 5677// IfNoneMatch sets the optional parameter which makes the operation 5678// fail if the object's ETag matches the given value. This is useful for 5679// getting updates only after the object has changed since the last 5680// request. Use googleapi.IsNotModified to check whether the response 5681// error from Do is the result of In-None-Match. 5682func (c *PeopleListDirectoryPeopleCall) IfNoneMatch(entityTag string) *PeopleListDirectoryPeopleCall { 5683 c.ifNoneMatch_ = entityTag 5684 return c 5685} 5686 5687// Context sets the context to be used in this call's Do method. Any 5688// pending HTTP request will be aborted if the provided context is 5689// canceled. 5690func (c *PeopleListDirectoryPeopleCall) Context(ctx context.Context) *PeopleListDirectoryPeopleCall { 5691 c.ctx_ = ctx 5692 return c 5693} 5694 5695// Header returns an http.Header that can be modified by the caller to 5696// add HTTP headers to the request. 5697func (c *PeopleListDirectoryPeopleCall) Header() http.Header { 5698 if c.header_ == nil { 5699 c.header_ = make(http.Header) 5700 } 5701 return c.header_ 5702} 5703 5704func (c *PeopleListDirectoryPeopleCall) doRequest(alt string) (*http.Response, error) { 5705 reqHeaders := make(http.Header) 5706 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 5707 for k, v := range c.header_ { 5708 reqHeaders[k] = v 5709 } 5710 reqHeaders.Set("User-Agent", c.s.userAgent()) 5711 if c.ifNoneMatch_ != "" { 5712 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5713 } 5714 var body io.Reader = nil 5715 c.urlParams_.Set("alt", alt) 5716 c.urlParams_.Set("prettyPrint", "false") 5717 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:listDirectoryPeople") 5718 urls += "?" + c.urlParams_.Encode() 5719 req, err := http.NewRequest("GET", urls, body) 5720 if err != nil { 5721 return nil, err 5722 } 5723 req.Header = reqHeaders 5724 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5725} 5726 5727// Do executes the "people.people.listDirectoryPeople" call. 5728// Exactly one of *ListDirectoryPeopleResponse or error will be non-nil. 5729// Any non-2xx status code is an error. Response headers are in either 5730// *ListDirectoryPeopleResponse.ServerResponse.Header or (if a response 5731// was returned at all) in error.(*googleapi.Error).Header. Use 5732// googleapi.IsNotModified to check whether the returned error was 5733// because http.StatusNotModified was returned. 5734func (c *PeopleListDirectoryPeopleCall) Do(opts ...googleapi.CallOption) (*ListDirectoryPeopleResponse, error) { 5735 gensupport.SetOptions(c.urlParams_, opts...) 5736 res, err := c.doRequest("json") 5737 if res != nil && res.StatusCode == http.StatusNotModified { 5738 if res.Body != nil { 5739 res.Body.Close() 5740 } 5741 return nil, &googleapi.Error{ 5742 Code: res.StatusCode, 5743 Header: res.Header, 5744 } 5745 } 5746 if err != nil { 5747 return nil, err 5748 } 5749 defer googleapi.CloseBody(res) 5750 if err := googleapi.CheckResponse(res); err != nil { 5751 return nil, err 5752 } 5753 ret := &ListDirectoryPeopleResponse{ 5754 ServerResponse: googleapi.ServerResponse{ 5755 Header: res.Header, 5756 HTTPStatusCode: res.StatusCode, 5757 }, 5758 } 5759 target := &ret 5760 if err := gensupport.DecodeResponse(target, res); err != nil { 5761 return nil, err 5762 } 5763 return ret, nil 5764 // { 5765 // "description": "Provides a list of domain profiles and domain contacts in the authenticated\nuser's domain directory.", 5766 // "flatPath": "v1/people:listDirectoryPeople", 5767 // "httpMethod": "GET", 5768 // "id": "people.people.listDirectoryPeople", 5769 // "parameterOrder": [], 5770 // "parameters": { 5771 // "mergeSources": { 5772 // "description": "Optional. Additional data to merge into the directory sources if they are connected\nthrough verified join keys such as email addresses or phone numbers.", 5773 // "enum": [ 5774 // "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED", 5775 // "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" 5776 // ], 5777 // "location": "query", 5778 // "repeated": true, 5779 // "type": "string" 5780 // }, 5781 // "pageSize": { 5782 // "description": "Optional. The number of people to include in the response. Valid values are\nbetween 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.", 5783 // "format": "int32", 5784 // "location": "query", 5785 // "type": "integer" 5786 // }, 5787 // "pageToken": { 5788 // "description": "Optional. A page token, received from a previous `ListDirectoryPeople` call.\nProvide this to retrieve the subsequent page.\n\nWhen paginating, all other parameters provided to `ListDirectoryPeople`\nmust match the call that provided the page token.", 5789 // "location": "query", 5790 // "type": "string" 5791 // }, 5792 // "readMask": { 5793 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 5794 // "format": "google-fieldmask", 5795 // "location": "query", 5796 // "type": "string" 5797 // }, 5798 // "requestSyncToken": { 5799 // "description": "Optional. Whether the response should include `next_sync_token`, which can be used to\nget all changes since the last request. For subsequent sync requests use\nthe `sync_token` param instead.", 5800 // "location": "query", 5801 // "type": "boolean" 5802 // }, 5803 // "sources": { 5804 // "description": "Required. Directory sources to return.", 5805 // "enum": [ 5806 // "DIRECTORY_SOURCE_TYPE_UNSPECIFIED", 5807 // "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT", 5808 // "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" 5809 // ], 5810 // "location": "query", 5811 // "repeated": true, 5812 // "type": "string" 5813 // }, 5814 // "syncToken": { 5815 // "description": "Optional. A sync token, received from a previous `ListDirectoryPeople` call.\nProvide this to retrieve only the resources changed since the last request.\n\nWhen syncing, all other parameters provided to `ListDirectoryPeople`\nmust match the call that provided the sync token.", 5816 // "location": "query", 5817 // "type": "string" 5818 // } 5819 // }, 5820 // "path": "v1/people:listDirectoryPeople", 5821 // "response": { 5822 // "$ref": "ListDirectoryPeopleResponse" 5823 // }, 5824 // "scopes": [ 5825 // "https://www.googleapis.com/auth/directory.readonly" 5826 // ] 5827 // } 5828 5829} 5830 5831// Pages invokes f for each page of results. 5832// A non-nil error returned from f will halt the iteration. 5833// The provided context supersedes any context provided to the Context method. 5834func (c *PeopleListDirectoryPeopleCall) Pages(ctx context.Context, f func(*ListDirectoryPeopleResponse) error) error { 5835 c.ctx_ = ctx 5836 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5837 for { 5838 x, err := c.Do() 5839 if err != nil { 5840 return err 5841 } 5842 if err := f(x); err != nil { 5843 return err 5844 } 5845 if x.NextPageToken == "" { 5846 return nil 5847 } 5848 c.PageToken(x.NextPageToken) 5849 } 5850} 5851 5852// method id "people.people.searchDirectoryPeople": 5853 5854type PeopleSearchDirectoryPeopleCall struct { 5855 s *Service 5856 urlParams_ gensupport.URLParams 5857 ifNoneMatch_ string 5858 ctx_ context.Context 5859 header_ http.Header 5860} 5861 5862// SearchDirectoryPeople: Provides a list of domain profiles and domain 5863// contacts in the authenticated 5864// user's domain directory that match the search query. 5865func (r *PeopleService) SearchDirectoryPeople() *PeopleSearchDirectoryPeopleCall { 5866 c := &PeopleSearchDirectoryPeopleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5867 return c 5868} 5869 5870// MergeSources sets the optional parameter "mergeSources": Additional 5871// data to merge into the directory sources if they are 5872// connected 5873// through verified join keys such as email addresses or phone numbers. 5874// 5875// Possible values: 5876// "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED" 5877// "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" 5878func (c *PeopleSearchDirectoryPeopleCall) MergeSources(mergeSources ...string) *PeopleSearchDirectoryPeopleCall { 5879 c.urlParams_.SetMulti("mergeSources", append([]string{}, mergeSources...)) 5880 return c 5881} 5882 5883// PageSize sets the optional parameter "pageSize": The number of people 5884// to include in the response. Valid values are 5885// between 1 and 500, inclusive. Defaults to 100 if not set or set to 0. 5886func (c *PeopleSearchDirectoryPeopleCall) PageSize(pageSize int64) *PeopleSearchDirectoryPeopleCall { 5887 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5888 return c 5889} 5890 5891// PageToken sets the optional parameter "pageToken": A page token, 5892// received from a previous `SearchDirectoryPeople` call. 5893// Provide this to retrieve the subsequent page. 5894// 5895// When paginating, all other parameters provided to 5896// `SearchDirectoryPeople` 5897// must match the call that provided the page token. 5898func (c *PeopleSearchDirectoryPeopleCall) PageToken(pageToken string) *PeopleSearchDirectoryPeopleCall { 5899 c.urlParams_.Set("pageToken", pageToken) 5900 return c 5901} 5902 5903// Query sets the optional parameter "query": Required. Prefix query 5904// that matches fields in the person. Does NOT use the 5905// read_mask for determining what fields to match. 5906func (c *PeopleSearchDirectoryPeopleCall) Query(query string) *PeopleSearchDirectoryPeopleCall { 5907 c.urlParams_.Set("query", query) 5908 return c 5909} 5910 5911// ReadMask sets the optional parameter "readMask": Required. A field 5912// mask to restrict which fields on each person are returned. 5913// Multiple 5914// fields can be specified by separating them with commas. Valid values 5915// are: 5916// 5917// * addresses 5918// * ageRanges 5919// * biographies 5920// * birthdays 5921// * coverPhotos 5922// * emailAddresses 5923// * events 5924// * genders 5925// * imClients 5926// * interests 5927// * locales 5928// * memberships 5929// * metadata 5930// * names 5931// * nicknames 5932// * occupations 5933// * organizations 5934// * phoneNumbers 5935// * photos 5936// * relations 5937// * residences 5938// * sipAddresses 5939// * skills 5940// * urls 5941// * userDefined 5942func (c *PeopleSearchDirectoryPeopleCall) ReadMask(readMask string) *PeopleSearchDirectoryPeopleCall { 5943 c.urlParams_.Set("readMask", readMask) 5944 return c 5945} 5946 5947// Sources sets the optional parameter "sources": Required. Directory 5948// sources to return. 5949// 5950// Possible values: 5951// "DIRECTORY_SOURCE_TYPE_UNSPECIFIED" 5952// "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT" 5953// "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" 5954func (c *PeopleSearchDirectoryPeopleCall) Sources(sources ...string) *PeopleSearchDirectoryPeopleCall { 5955 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 5956 return c 5957} 5958 5959// Fields allows partial responses to be retrieved. See 5960// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5961// for more information. 5962func (c *PeopleSearchDirectoryPeopleCall) Fields(s ...googleapi.Field) *PeopleSearchDirectoryPeopleCall { 5963 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5964 return c 5965} 5966 5967// IfNoneMatch sets the optional parameter which makes the operation 5968// fail if the object's ETag matches the given value. This is useful for 5969// getting updates only after the object has changed since the last 5970// request. Use googleapi.IsNotModified to check whether the response 5971// error from Do is the result of In-None-Match. 5972func (c *PeopleSearchDirectoryPeopleCall) IfNoneMatch(entityTag string) *PeopleSearchDirectoryPeopleCall { 5973 c.ifNoneMatch_ = entityTag 5974 return c 5975} 5976 5977// Context sets the context to be used in this call's Do method. Any 5978// pending HTTP request will be aborted if the provided context is 5979// canceled. 5980func (c *PeopleSearchDirectoryPeopleCall) Context(ctx context.Context) *PeopleSearchDirectoryPeopleCall { 5981 c.ctx_ = ctx 5982 return c 5983} 5984 5985// Header returns an http.Header that can be modified by the caller to 5986// add HTTP headers to the request. 5987func (c *PeopleSearchDirectoryPeopleCall) Header() http.Header { 5988 if c.header_ == nil { 5989 c.header_ = make(http.Header) 5990 } 5991 return c.header_ 5992} 5993 5994func (c *PeopleSearchDirectoryPeopleCall) doRequest(alt string) (*http.Response, error) { 5995 reqHeaders := make(http.Header) 5996 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 5997 for k, v := range c.header_ { 5998 reqHeaders[k] = v 5999 } 6000 reqHeaders.Set("User-Agent", c.s.userAgent()) 6001 if c.ifNoneMatch_ != "" { 6002 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6003 } 6004 var body io.Reader = nil 6005 c.urlParams_.Set("alt", alt) 6006 c.urlParams_.Set("prettyPrint", "false") 6007 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:searchDirectoryPeople") 6008 urls += "?" + c.urlParams_.Encode() 6009 req, err := http.NewRequest("GET", urls, body) 6010 if err != nil { 6011 return nil, err 6012 } 6013 req.Header = reqHeaders 6014 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6015} 6016 6017// Do executes the "people.people.searchDirectoryPeople" call. 6018// Exactly one of *SearchDirectoryPeopleResponse or error will be 6019// non-nil. Any non-2xx status code is an error. Response headers are in 6020// either *SearchDirectoryPeopleResponse.ServerResponse.Header or (if a 6021// response was returned at all) in error.(*googleapi.Error).Header. Use 6022// googleapi.IsNotModified to check whether the returned error was 6023// because http.StatusNotModified was returned. 6024func (c *PeopleSearchDirectoryPeopleCall) Do(opts ...googleapi.CallOption) (*SearchDirectoryPeopleResponse, error) { 6025 gensupport.SetOptions(c.urlParams_, opts...) 6026 res, err := c.doRequest("json") 6027 if res != nil && res.StatusCode == http.StatusNotModified { 6028 if res.Body != nil { 6029 res.Body.Close() 6030 } 6031 return nil, &googleapi.Error{ 6032 Code: res.StatusCode, 6033 Header: res.Header, 6034 } 6035 } 6036 if err != nil { 6037 return nil, err 6038 } 6039 defer googleapi.CloseBody(res) 6040 if err := googleapi.CheckResponse(res); err != nil { 6041 return nil, err 6042 } 6043 ret := &SearchDirectoryPeopleResponse{ 6044 ServerResponse: googleapi.ServerResponse{ 6045 Header: res.Header, 6046 HTTPStatusCode: res.StatusCode, 6047 }, 6048 } 6049 target := &ret 6050 if err := gensupport.DecodeResponse(target, res); err != nil { 6051 return nil, err 6052 } 6053 return ret, nil 6054 // { 6055 // "description": "Provides a list of domain profiles and domain contacts in the authenticated\nuser's domain directory that match the search query.", 6056 // "flatPath": "v1/people:searchDirectoryPeople", 6057 // "httpMethod": "GET", 6058 // "id": "people.people.searchDirectoryPeople", 6059 // "parameterOrder": [], 6060 // "parameters": { 6061 // "mergeSources": { 6062 // "description": "Optional. Additional data to merge into the directory sources if they are connected\nthrough verified join keys such as email addresses or phone numbers.", 6063 // "enum": [ 6064 // "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED", 6065 // "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" 6066 // ], 6067 // "location": "query", 6068 // "repeated": true, 6069 // "type": "string" 6070 // }, 6071 // "pageSize": { 6072 // "description": "Optional. The number of people to include in the response. Valid values are\nbetween 1 and 500, inclusive. Defaults to 100 if not set or set to 0.", 6073 // "format": "int32", 6074 // "location": "query", 6075 // "type": "integer" 6076 // }, 6077 // "pageToken": { 6078 // "description": "Optional. A page token, received from a previous `SearchDirectoryPeople` call.\nProvide this to retrieve the subsequent page.\n\nWhen paginating, all other parameters provided to `SearchDirectoryPeople`\nmust match the call that provided the page token.", 6079 // "location": "query", 6080 // "type": "string" 6081 // }, 6082 // "query": { 6083 // "description": "Required. Prefix query that matches fields in the person. Does NOT use the\nread_mask for determining what fields to match.", 6084 // "location": "query", 6085 // "type": "string" 6086 // }, 6087 // "readMask": { 6088 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 6089 // "format": "google-fieldmask", 6090 // "location": "query", 6091 // "type": "string" 6092 // }, 6093 // "sources": { 6094 // "description": "Required. Directory sources to return.", 6095 // "enum": [ 6096 // "DIRECTORY_SOURCE_TYPE_UNSPECIFIED", 6097 // "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT", 6098 // "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" 6099 // ], 6100 // "location": "query", 6101 // "repeated": true, 6102 // "type": "string" 6103 // } 6104 // }, 6105 // "path": "v1/people:searchDirectoryPeople", 6106 // "response": { 6107 // "$ref": "SearchDirectoryPeopleResponse" 6108 // }, 6109 // "scopes": [ 6110 // "https://www.googleapis.com/auth/directory.readonly" 6111 // ] 6112 // } 6113 6114} 6115 6116// Pages invokes f for each page of results. 6117// A non-nil error returned from f will halt the iteration. 6118// The provided context supersedes any context provided to the Context method. 6119func (c *PeopleSearchDirectoryPeopleCall) Pages(ctx context.Context, f func(*SearchDirectoryPeopleResponse) error) error { 6120 c.ctx_ = ctx 6121 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6122 for { 6123 x, err := c.Do() 6124 if err != nil { 6125 return err 6126 } 6127 if err := f(x); err != nil { 6128 return err 6129 } 6130 if x.NextPageToken == "" { 6131 return nil 6132 } 6133 c.PageToken(x.NextPageToken) 6134 } 6135} 6136 6137// method id "people.people.updateContact": 6138 6139type PeopleUpdateContactCall struct { 6140 s *Service 6141 resourceName string 6142 person *Person 6143 urlParams_ gensupport.URLParams 6144 ctx_ context.Context 6145 header_ http.Header 6146} 6147 6148// UpdateContact: Update contact data for an existing contact person. 6149// Any non-contact data 6150// will not be modified. 6151// 6152// The request throws a 400 error if `updatePersonFields` is not 6153// specified. 6154// 6155// The request throws a 400 error if `person.metadata.sources` is 6156// not 6157// specified for the contact to be updated. 6158// 6159// The request throws a 400 error with an error with 6160// reason 6161// "failedPrecondition" if `person.metadata.sources.etag` is different 6162// than 6163// the contact's etag, which indicates the contact has changed since its 6164// data 6165// was read. Clients should get the latest person and re-apply their 6166// updates 6167// to the latest person. 6168func (r *PeopleService) UpdateContact(resourceName string, person *Person) *PeopleUpdateContactCall { 6169 c := &PeopleUpdateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6170 c.resourceName = resourceName 6171 c.person = person 6172 return c 6173} 6174 6175// PersonFields sets the optional parameter "personFields": A field mask 6176// to restrict which fields on each person are returned. Multiple 6177// fields can be specified by separating them with commas. Defaults to 6178// all 6179// fields if not set. Valid values are: 6180// 6181// * addresses 6182// * ageRanges 6183// * biographies 6184// * birthdays 6185// * coverPhotos 6186// * emailAddresses 6187// * events 6188// * genders 6189// * imClients 6190// * interests 6191// * locales 6192// * memberships 6193// * metadata 6194// * names 6195// * nicknames 6196// * occupations 6197// * organizations 6198// * phoneNumbers 6199// * photos 6200// * relations 6201// * residences 6202// * sipAddresses 6203// * skills 6204// * urls 6205// * userDefined 6206func (c *PeopleUpdateContactCall) PersonFields(personFields string) *PeopleUpdateContactCall { 6207 c.urlParams_.Set("personFields", personFields) 6208 return c 6209} 6210 6211// Sources sets the optional parameter "sources": A mask of what source 6212// types to return. Defaults to 6213// ReadSourceType.CONTACT and 6214// ReadSourceType.PROFILE if not 6215// set. 6216// 6217// Possible values: 6218// "READ_SOURCE_TYPE_UNSPECIFIED" 6219// "READ_SOURCE_TYPE_PROFILE" 6220// "READ_SOURCE_TYPE_CONTACT" 6221// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 6222func (c *PeopleUpdateContactCall) Sources(sources ...string) *PeopleUpdateContactCall { 6223 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 6224 return c 6225} 6226 6227// UpdatePersonFields sets the optional parameter "updatePersonFields": 6228// Required. A field mask to restrict which fields on the person are 6229// updated. Multiple 6230// fields can be specified by separating them with commas. 6231// All updated fields will be replaced. Valid values are: 6232// 6233// * addresses 6234// * biographies 6235// * birthdays 6236// * emailAddresses 6237// * events 6238// * genders 6239// * imClients 6240// * interests 6241// * locales 6242// * memberships 6243// * names 6244// * nicknames 6245// * occupations 6246// * organizations 6247// * phoneNumbers 6248// * relations 6249// * residences 6250// * sipAddresses 6251// * urls 6252// * userDefined 6253func (c *PeopleUpdateContactCall) UpdatePersonFields(updatePersonFields string) *PeopleUpdateContactCall { 6254 c.urlParams_.Set("updatePersonFields", updatePersonFields) 6255 return c 6256} 6257 6258// Fields allows partial responses to be retrieved. See 6259// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6260// for more information. 6261func (c *PeopleUpdateContactCall) Fields(s ...googleapi.Field) *PeopleUpdateContactCall { 6262 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6263 return c 6264} 6265 6266// Context sets the context to be used in this call's Do method. Any 6267// pending HTTP request will be aborted if the provided context is 6268// canceled. 6269func (c *PeopleUpdateContactCall) Context(ctx context.Context) *PeopleUpdateContactCall { 6270 c.ctx_ = ctx 6271 return c 6272} 6273 6274// Header returns an http.Header that can be modified by the caller to 6275// add HTTP headers to the request. 6276func (c *PeopleUpdateContactCall) Header() http.Header { 6277 if c.header_ == nil { 6278 c.header_ = make(http.Header) 6279 } 6280 return c.header_ 6281} 6282 6283func (c *PeopleUpdateContactCall) doRequest(alt string) (*http.Response, error) { 6284 reqHeaders := make(http.Header) 6285 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 6286 for k, v := range c.header_ { 6287 reqHeaders[k] = v 6288 } 6289 reqHeaders.Set("User-Agent", c.s.userAgent()) 6290 var body io.Reader = nil 6291 body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) 6292 if err != nil { 6293 return nil, err 6294 } 6295 reqHeaders.Set("Content-Type", "application/json") 6296 c.urlParams_.Set("alt", alt) 6297 c.urlParams_.Set("prettyPrint", "false") 6298 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContact") 6299 urls += "?" + c.urlParams_.Encode() 6300 req, err := http.NewRequest("PATCH", urls, body) 6301 if err != nil { 6302 return nil, err 6303 } 6304 req.Header = reqHeaders 6305 googleapi.Expand(req.URL, map[string]string{ 6306 "resourceName": c.resourceName, 6307 }) 6308 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6309} 6310 6311// Do executes the "people.people.updateContact" call. 6312// Exactly one of *Person or error will be non-nil. Any non-2xx status 6313// code is an error. Response headers are in either 6314// *Person.ServerResponse.Header or (if a response was returned at all) 6315// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6316// check whether the returned error was because http.StatusNotModified 6317// was returned. 6318func (c *PeopleUpdateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) { 6319 gensupport.SetOptions(c.urlParams_, opts...) 6320 res, err := c.doRequest("json") 6321 if res != nil && res.StatusCode == http.StatusNotModified { 6322 if res.Body != nil { 6323 res.Body.Close() 6324 } 6325 return nil, &googleapi.Error{ 6326 Code: res.StatusCode, 6327 Header: res.Header, 6328 } 6329 } 6330 if err != nil { 6331 return nil, err 6332 } 6333 defer googleapi.CloseBody(res) 6334 if err := googleapi.CheckResponse(res); err != nil { 6335 return nil, err 6336 } 6337 ret := &Person{ 6338 ServerResponse: googleapi.ServerResponse{ 6339 Header: res.Header, 6340 HTTPStatusCode: res.StatusCode, 6341 }, 6342 } 6343 target := &ret 6344 if err := gensupport.DecodeResponse(target, res); err != nil { 6345 return nil, err 6346 } 6347 return ret, nil 6348 // { 6349 // "description": "Update contact data for an existing contact person. Any non-contact data\nwill not be modified.\n\nThe request throws a 400 error if `updatePersonFields` is not specified.\n\nThe request throws a 400 error if `person.metadata.sources` is not\nspecified for the contact to be updated.\n\nThe request throws a 400 error with an error with reason\n`\"failedPrecondition\"` if `person.metadata.sources.etag` is different than\nthe contact's etag, which indicates the contact has changed since its data\nwas read. Clients should get the latest person and re-apply their updates\nto the latest person.", 6350 // "flatPath": "v1/people/{peopleId}:updateContact", 6351 // "httpMethod": "PATCH", 6352 // "id": "people.people.updateContact", 6353 // "parameterOrder": [ 6354 // "resourceName" 6355 // ], 6356 // "parameters": { 6357 // "personFields": { 6358 // "description": "Optional. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Defaults to all\nfields if not set. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 6359 // "format": "google-fieldmask", 6360 // "location": "query", 6361 // "type": "string" 6362 // }, 6363 // "resourceName": { 6364 // "description": "The resource name for the person, assigned by the server. An ASCII string\nwith a max length of 27 characters, in the form of\n`people/{person_id}`.", 6365 // "location": "path", 6366 // "pattern": "^people/[^/]+$", 6367 // "required": true, 6368 // "type": "string" 6369 // }, 6370 // "sources": { 6371 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.CONTACT and\nReadSourceType.PROFILE if not\nset.", 6372 // "enum": [ 6373 // "READ_SOURCE_TYPE_UNSPECIFIED", 6374 // "READ_SOURCE_TYPE_PROFILE", 6375 // "READ_SOURCE_TYPE_CONTACT", 6376 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 6377 // ], 6378 // "location": "query", 6379 // "repeated": true, 6380 // "type": "string" 6381 // }, 6382 // "updatePersonFields": { 6383 // "description": "Required. A field mask to restrict which fields on the person are updated. Multiple\nfields can be specified by separating them with commas.\nAll updated fields will be replaced. Valid values are:\n\n* addresses\n* biographies\n* birthdays\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* relations\n* residences\n* sipAddresses\n* urls\n* userDefined", 6384 // "format": "google-fieldmask", 6385 // "location": "query", 6386 // "type": "string" 6387 // } 6388 // }, 6389 // "path": "v1/{+resourceName}:updateContact", 6390 // "request": { 6391 // "$ref": "Person" 6392 // }, 6393 // "response": { 6394 // "$ref": "Person" 6395 // }, 6396 // "scopes": [ 6397 // "https://www.googleapis.com/auth/contacts" 6398 // ] 6399 // } 6400 6401} 6402 6403// method id "people.people.updateContactPhoto": 6404 6405type PeopleUpdateContactPhotoCall struct { 6406 s *Service 6407 resourceName string 6408 updatecontactphotorequest *UpdateContactPhotoRequest 6409 urlParams_ gensupport.URLParams 6410 ctx_ context.Context 6411 header_ http.Header 6412} 6413 6414// UpdateContactPhoto: Update a contact's photo. 6415func (r *PeopleService) UpdateContactPhoto(resourceName string, updatecontactphotorequest *UpdateContactPhotoRequest) *PeopleUpdateContactPhotoCall { 6416 c := &PeopleUpdateContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6417 c.resourceName = resourceName 6418 c.updatecontactphotorequest = updatecontactphotorequest 6419 return c 6420} 6421 6422// Fields allows partial responses to be retrieved. See 6423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6424// for more information. 6425func (c *PeopleUpdateContactPhotoCall) Fields(s ...googleapi.Field) *PeopleUpdateContactPhotoCall { 6426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6427 return c 6428} 6429 6430// Context sets the context to be used in this call's Do method. Any 6431// pending HTTP request will be aborted if the provided context is 6432// canceled. 6433func (c *PeopleUpdateContactPhotoCall) Context(ctx context.Context) *PeopleUpdateContactPhotoCall { 6434 c.ctx_ = ctx 6435 return c 6436} 6437 6438// Header returns an http.Header that can be modified by the caller to 6439// add HTTP headers to the request. 6440func (c *PeopleUpdateContactPhotoCall) Header() http.Header { 6441 if c.header_ == nil { 6442 c.header_ = make(http.Header) 6443 } 6444 return c.header_ 6445} 6446 6447func (c *PeopleUpdateContactPhotoCall) doRequest(alt string) (*http.Response, error) { 6448 reqHeaders := make(http.Header) 6449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 6450 for k, v := range c.header_ { 6451 reqHeaders[k] = v 6452 } 6453 reqHeaders.Set("User-Agent", c.s.userAgent()) 6454 var body io.Reader = nil 6455 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactphotorequest) 6456 if err != nil { 6457 return nil, err 6458 } 6459 reqHeaders.Set("Content-Type", "application/json") 6460 c.urlParams_.Set("alt", alt) 6461 c.urlParams_.Set("prettyPrint", "false") 6462 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContactPhoto") 6463 urls += "?" + c.urlParams_.Encode() 6464 req, err := http.NewRequest("PATCH", urls, body) 6465 if err != nil { 6466 return nil, err 6467 } 6468 req.Header = reqHeaders 6469 googleapi.Expand(req.URL, map[string]string{ 6470 "resourceName": c.resourceName, 6471 }) 6472 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6473} 6474 6475// Do executes the "people.people.updateContactPhoto" call. 6476// Exactly one of *UpdateContactPhotoResponse or error will be non-nil. 6477// Any non-2xx status code is an error. Response headers are in either 6478// *UpdateContactPhotoResponse.ServerResponse.Header or (if a response 6479// was returned at all) in error.(*googleapi.Error).Header. Use 6480// googleapi.IsNotModified to check whether the returned error was 6481// because http.StatusNotModified was returned. 6482func (c *PeopleUpdateContactPhotoCall) Do(opts ...googleapi.CallOption) (*UpdateContactPhotoResponse, error) { 6483 gensupport.SetOptions(c.urlParams_, opts...) 6484 res, err := c.doRequest("json") 6485 if res != nil && res.StatusCode == http.StatusNotModified { 6486 if res.Body != nil { 6487 res.Body.Close() 6488 } 6489 return nil, &googleapi.Error{ 6490 Code: res.StatusCode, 6491 Header: res.Header, 6492 } 6493 } 6494 if err != nil { 6495 return nil, err 6496 } 6497 defer googleapi.CloseBody(res) 6498 if err := googleapi.CheckResponse(res); err != nil { 6499 return nil, err 6500 } 6501 ret := &UpdateContactPhotoResponse{ 6502 ServerResponse: googleapi.ServerResponse{ 6503 Header: res.Header, 6504 HTTPStatusCode: res.StatusCode, 6505 }, 6506 } 6507 target := &ret 6508 if err := gensupport.DecodeResponse(target, res); err != nil { 6509 return nil, err 6510 } 6511 return ret, nil 6512 // { 6513 // "description": "Update a contact's photo.", 6514 // "flatPath": "v1/people/{peopleId}:updateContactPhoto", 6515 // "httpMethod": "PATCH", 6516 // "id": "people.people.updateContactPhoto", 6517 // "parameterOrder": [ 6518 // "resourceName" 6519 // ], 6520 // "parameters": { 6521 // "resourceName": { 6522 // "description": "Required. Person resource name", 6523 // "location": "path", 6524 // "pattern": "^people/[^/]+$", 6525 // "required": true, 6526 // "type": "string" 6527 // } 6528 // }, 6529 // "path": "v1/{+resourceName}:updateContactPhoto", 6530 // "request": { 6531 // "$ref": "UpdateContactPhotoRequest" 6532 // }, 6533 // "response": { 6534 // "$ref": "UpdateContactPhotoResponse" 6535 // }, 6536 // "scopes": [ 6537 // "https://www.googleapis.com/auth/contacts" 6538 // ] 6539 // } 6540 6541} 6542 6543// method id "people.people.connections.list": 6544 6545type PeopleConnectionsListCall struct { 6546 s *Service 6547 resourceName string 6548 urlParams_ gensupport.URLParams 6549 ifNoneMatch_ string 6550 ctx_ context.Context 6551 header_ http.Header 6552} 6553 6554// List: Provides a list of the authenticated user's contacts. 6555// 6556// The request throws a 400 error if 'personFields' is not specified. 6557func (r *PeopleConnectionsService) List(resourceName string) *PeopleConnectionsListCall { 6558 c := &PeopleConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6559 c.resourceName = resourceName 6560 return c 6561} 6562 6563// PageSize sets the optional parameter "pageSize": The number of 6564// connections to include in the response. Valid values are 6565// between 1 and 1000, inclusive. Defaults to 100 if not set or set to 6566// 0. 6567func (c *PeopleConnectionsListCall) PageSize(pageSize int64) *PeopleConnectionsListCall { 6568 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6569 return c 6570} 6571 6572// PageToken sets the optional parameter "pageToken": A page token, 6573// received from a previous `ListConnections` call. 6574// Provide this to retrieve the subsequent page. 6575// 6576// When paginating, all other parameters provided to 6577// `ListConnections` 6578// must match the call that provided the page token. 6579func (c *PeopleConnectionsListCall) PageToken(pageToken string) *PeopleConnectionsListCall { 6580 c.urlParams_.Set("pageToken", pageToken) 6581 return c 6582} 6583 6584// PersonFields sets the optional parameter "personFields": Required. A 6585// field mask to restrict which fields on each person are returned. 6586// Multiple 6587// fields can be specified by separating them with commas. Valid values 6588// are: 6589// 6590// * addresses 6591// * ageRanges 6592// * biographies 6593// * birthdays 6594// * coverPhotos 6595// * emailAddresses 6596// * events 6597// * genders 6598// * imClients 6599// * interests 6600// * locales 6601// * memberships 6602// * metadata 6603// * names 6604// * nicknames 6605// * occupations 6606// * organizations 6607// * phoneNumbers 6608// * photos 6609// * relations 6610// * residences 6611// * sipAddresses 6612// * skills 6613// * urls 6614// * userDefined 6615func (c *PeopleConnectionsListCall) PersonFields(personFields string) *PeopleConnectionsListCall { 6616 c.urlParams_.Set("personFields", personFields) 6617 return c 6618} 6619 6620// RequestMaskIncludeField sets the optional parameter 6621// "requestMask.includeField": Required. Comma-separated list of person 6622// fields to be included in the response. Each 6623// path should start with `person.`: for example, `person.names` 6624// or 6625// `person.photos`. 6626func (c *PeopleConnectionsListCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleConnectionsListCall { 6627 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 6628 return c 6629} 6630 6631// RequestSyncToken sets the optional parameter "requestSyncToken": 6632// Whether the response should include `next_sync_token`, which can be 6633// used to 6634// get all changes since the last request. For subsequent sync requests 6635// use 6636// the `sync_token` param instead. Initial sync requests that 6637// specify 6638// `request_sync_token` have an additional rate limit. 6639func (c *PeopleConnectionsListCall) RequestSyncToken(requestSyncToken bool) *PeopleConnectionsListCall { 6640 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken)) 6641 return c 6642} 6643 6644// SortOrder sets the optional parameter "sortOrder": The order in which 6645// the connections should be sorted. Defaults 6646// to 6647// `LAST_MODIFIED_ASCENDING`. 6648// 6649// Possible values: 6650// "LAST_MODIFIED_ASCENDING" 6651// "LAST_MODIFIED_DESCENDING" 6652// "FIRST_NAME_ASCENDING" 6653// "LAST_NAME_ASCENDING" 6654func (c *PeopleConnectionsListCall) SortOrder(sortOrder string) *PeopleConnectionsListCall { 6655 c.urlParams_.Set("sortOrder", sortOrder) 6656 return c 6657} 6658 6659// Sources sets the optional parameter "sources": A mask of what source 6660// types to return. Defaults 6661// to 6662// ReadSourceType.CONTACT 6663// and 6664// ReadSourceType.PROFILE if not 6665// set. 6666// 6667// Possible values: 6668// "READ_SOURCE_TYPE_UNSPECIFIED" 6669// "READ_SOURCE_TYPE_PROFILE" 6670// "READ_SOURCE_TYPE_CONTACT" 6671// "READ_SOURCE_TYPE_DOMAIN_CONTACT" 6672func (c *PeopleConnectionsListCall) Sources(sources ...string) *PeopleConnectionsListCall { 6673 c.urlParams_.SetMulti("sources", append([]string{}, sources...)) 6674 return c 6675} 6676 6677// SyncToken sets the optional parameter "syncToken": A sync token, 6678// received from a previous `ListConnections` call. 6679// Provide this to retrieve only the resources changed since the last 6680// request. 6681// Sync requests that specify `sync_token` have an additional rate 6682// limit. 6683// 6684// When syncing, all other parameters provided to `ListConnections` 6685// must match the call that provided the sync token. 6686func (c *PeopleConnectionsListCall) SyncToken(syncToken string) *PeopleConnectionsListCall { 6687 c.urlParams_.Set("syncToken", syncToken) 6688 return c 6689} 6690 6691// Fields allows partial responses to be retrieved. See 6692// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6693// for more information. 6694func (c *PeopleConnectionsListCall) Fields(s ...googleapi.Field) *PeopleConnectionsListCall { 6695 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6696 return c 6697} 6698 6699// IfNoneMatch sets the optional parameter which makes the operation 6700// fail if the object's ETag matches the given value. This is useful for 6701// getting updates only after the object has changed since the last 6702// request. Use googleapi.IsNotModified to check whether the response 6703// error from Do is the result of In-None-Match. 6704func (c *PeopleConnectionsListCall) IfNoneMatch(entityTag string) *PeopleConnectionsListCall { 6705 c.ifNoneMatch_ = entityTag 6706 return c 6707} 6708 6709// Context sets the context to be used in this call's Do method. Any 6710// pending HTTP request will be aborted if the provided context is 6711// canceled. 6712func (c *PeopleConnectionsListCall) Context(ctx context.Context) *PeopleConnectionsListCall { 6713 c.ctx_ = ctx 6714 return c 6715} 6716 6717// Header returns an http.Header that can be modified by the caller to 6718// add HTTP headers to the request. 6719func (c *PeopleConnectionsListCall) Header() http.Header { 6720 if c.header_ == nil { 6721 c.header_ = make(http.Header) 6722 } 6723 return c.header_ 6724} 6725 6726func (c *PeopleConnectionsListCall) doRequest(alt string) (*http.Response, error) { 6727 reqHeaders := make(http.Header) 6728 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 6729 for k, v := range c.header_ { 6730 reqHeaders[k] = v 6731 } 6732 reqHeaders.Set("User-Agent", c.s.userAgent()) 6733 if c.ifNoneMatch_ != "" { 6734 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6735 } 6736 var body io.Reader = nil 6737 c.urlParams_.Set("alt", alt) 6738 c.urlParams_.Set("prettyPrint", "false") 6739 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/connections") 6740 urls += "?" + c.urlParams_.Encode() 6741 req, err := http.NewRequest("GET", urls, body) 6742 if err != nil { 6743 return nil, err 6744 } 6745 req.Header = reqHeaders 6746 googleapi.Expand(req.URL, map[string]string{ 6747 "resourceName": c.resourceName, 6748 }) 6749 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6750} 6751 6752// Do executes the "people.people.connections.list" call. 6753// Exactly one of *ListConnectionsResponse or error will be non-nil. Any 6754// non-2xx status code is an error. Response headers are in either 6755// *ListConnectionsResponse.ServerResponse.Header or (if a response was 6756// returned at all) in error.(*googleapi.Error).Header. Use 6757// googleapi.IsNotModified to check whether the returned error was 6758// because http.StatusNotModified was returned. 6759func (c *PeopleConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) { 6760 gensupport.SetOptions(c.urlParams_, opts...) 6761 res, err := c.doRequest("json") 6762 if res != nil && res.StatusCode == http.StatusNotModified { 6763 if res.Body != nil { 6764 res.Body.Close() 6765 } 6766 return nil, &googleapi.Error{ 6767 Code: res.StatusCode, 6768 Header: res.Header, 6769 } 6770 } 6771 if err != nil { 6772 return nil, err 6773 } 6774 defer googleapi.CloseBody(res) 6775 if err := googleapi.CheckResponse(res); err != nil { 6776 return nil, err 6777 } 6778 ret := &ListConnectionsResponse{ 6779 ServerResponse: googleapi.ServerResponse{ 6780 Header: res.Header, 6781 HTTPStatusCode: res.StatusCode, 6782 }, 6783 } 6784 target := &ret 6785 if err := gensupport.DecodeResponse(target, res); err != nil { 6786 return nil, err 6787 } 6788 return ret, nil 6789 // { 6790 // "description": "Provides a list of the authenticated user's contacts.\n\nThe request throws a 400 error if 'personFields' is not specified.", 6791 // "flatPath": "v1/people/{peopleId}/connections", 6792 // "httpMethod": "GET", 6793 // "id": "people.people.connections.list", 6794 // "parameterOrder": [ 6795 // "resourceName" 6796 // ], 6797 // "parameters": { 6798 // "pageSize": { 6799 // "description": "Optional. The number of connections to include in the response. Valid values are\nbetween 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.", 6800 // "format": "int32", 6801 // "location": "query", 6802 // "type": "integer" 6803 // }, 6804 // "pageToken": { 6805 // "description": "Optional. A page token, received from a previous `ListConnections` call.\nProvide this to retrieve the subsequent page.\n\nWhen paginating, all other parameters provided to `ListConnections`\nmust match the call that provided the page token.", 6806 // "location": "query", 6807 // "type": "string" 6808 // }, 6809 // "personFields": { 6810 // "description": "Required. A field mask to restrict which fields on each person are returned. Multiple\nfields can be specified by separating them with commas. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* residences\n* sipAddresses\n* skills\n* urls\n* userDefined", 6811 // "format": "google-fieldmask", 6812 // "location": "query", 6813 // "type": "string" 6814 // }, 6815 // "requestMask.includeField": { 6816 // "description": "Required. Comma-separated list of person fields to be included in the response. Each\npath should start with `person.`: for example, `person.names` or\n`person.photos`.", 6817 // "format": "google-fieldmask", 6818 // "location": "query", 6819 // "type": "string" 6820 // }, 6821 // "requestSyncToken": { 6822 // "description": "Optional. Whether the response should include `next_sync_token`, which can be used to\nget all changes since the last request. For subsequent sync requests use\nthe `sync_token` param instead. Initial sync requests that specify\n`request_sync_token` have an additional rate limit.", 6823 // "location": "query", 6824 // "type": "boolean" 6825 // }, 6826 // "resourceName": { 6827 // "description": "Required. The resource name to return connections for. Only `people/me` is valid.", 6828 // "location": "path", 6829 // "pattern": "^people/[^/]+$", 6830 // "required": true, 6831 // "type": "string" 6832 // }, 6833 // "sortOrder": { 6834 // "description": "Optional. The order in which the connections should be sorted. Defaults to\n`LAST_MODIFIED_ASCENDING`.", 6835 // "enum": [ 6836 // "LAST_MODIFIED_ASCENDING", 6837 // "LAST_MODIFIED_DESCENDING", 6838 // "FIRST_NAME_ASCENDING", 6839 // "LAST_NAME_ASCENDING" 6840 // ], 6841 // "location": "query", 6842 // "type": "string" 6843 // }, 6844 // "sources": { 6845 // "description": "Optional. A mask of what source types to return. Defaults to\nReadSourceType.CONTACT\nand\nReadSourceType.PROFILE if not\nset.", 6846 // "enum": [ 6847 // "READ_SOURCE_TYPE_UNSPECIFIED", 6848 // "READ_SOURCE_TYPE_PROFILE", 6849 // "READ_SOURCE_TYPE_CONTACT", 6850 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" 6851 // ], 6852 // "location": "query", 6853 // "repeated": true, 6854 // "type": "string" 6855 // }, 6856 // "syncToken": { 6857 // "description": "Optional. A sync token, received from a previous `ListConnections` call.\nProvide this to retrieve only the resources changed since the last request.\nSync requests that specify `sync_token` have an additional rate limit.\n\nWhen syncing, all other parameters provided to `ListConnections`\nmust match the call that provided the sync token.", 6858 // "location": "query", 6859 // "type": "string" 6860 // } 6861 // }, 6862 // "path": "v1/{+resourceName}/connections", 6863 // "response": { 6864 // "$ref": "ListConnectionsResponse" 6865 // }, 6866 // "scopes": [ 6867 // "https://www.googleapis.com/auth/contacts", 6868 // "https://www.googleapis.com/auth/contacts.readonly" 6869 // ] 6870 // } 6871 6872} 6873 6874// Pages invokes f for each page of results. 6875// A non-nil error returned from f will halt the iteration. 6876// The provided context supersedes any context provided to the Context method. 6877func (c *PeopleConnectionsListCall) Pages(ctx context.Context, f func(*ListConnectionsResponse) error) error { 6878 c.ctx_ = ctx 6879 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6880 for { 6881 x, err := c.Do() 6882 if err != nil { 6883 return err 6884 } 6885 if err := f(x); err != nil { 6886 return err 6887 } 6888 if x.NextPageToken == "" { 6889 return nil 6890 } 6891 c.PageToken(x.NextPageToken) 6892 } 6893} 6894