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/" 82 83// OAuth2 scopes used by this API. 84const ( 85 // See, edit, download, and permanently delete your contacts 86 ContactsScope = "https://www.googleapis.com/auth/contacts" 87 88 // See and download your contacts 89 ContactsReadonlyScope = "https://www.googleapis.com/auth/contacts.readonly" 90 91 // See and download your organization's GSuite directory 92 DirectoryReadonlyScope = "https://www.googleapis.com/auth/directory.readonly" 93 94 // View your street addresses 95 UserAddressesReadScope = "https://www.googleapis.com/auth/user.addresses.read" 96 97 // View your complete date of birth 98 UserBirthdayReadScope = "https://www.googleapis.com/auth/user.birthday.read" 99 100 // View your email addresses 101 UserEmailsReadScope = "https://www.googleapis.com/auth/user.emails.read" 102 103 // See your gender 104 UserGenderReadScope = "https://www.googleapis.com/auth/user.gender.read" 105 106 // See your education, work history and org info 107 UserOrganizationReadScope = "https://www.googleapis.com/auth/user.organization.read" 108 109 // View your phone numbers 110 UserPhonenumbersReadScope = "https://www.googleapis.com/auth/user.phonenumbers.read" 111 112 // View your email address 113 UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" 114 115 // See your personal info, including any personal info you've made 116 // publicly available 117 UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" 118) 119 120// NewService creates a new Service. 121func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 122 scopesOption := option.WithScopes( 123 "https://www.googleapis.com/auth/contacts", 124 "https://www.googleapis.com/auth/contacts.readonly", 125 "https://www.googleapis.com/auth/directory.readonly", 126 "https://www.googleapis.com/auth/user.addresses.read", 127 "https://www.googleapis.com/auth/user.birthday.read", 128 "https://www.googleapis.com/auth/user.emails.read", 129 "https://www.googleapis.com/auth/user.gender.read", 130 "https://www.googleapis.com/auth/user.organization.read", 131 "https://www.googleapis.com/auth/user.phonenumbers.read", 132 "https://www.googleapis.com/auth/userinfo.email", 133 "https://www.googleapis.com/auth/userinfo.profile", 134 ) 135 // NOTE: prepend, so we don't override user-specified scopes. 136 opts = append([]option.ClientOption{scopesOption}, opts...) 137 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 138 client, endpoint, err := htransport.NewClient(ctx, opts...) 139 if err != nil { 140 return nil, err 141 } 142 s, err := New(client) 143 if err != nil { 144 return nil, err 145 } 146 if endpoint != "" { 147 s.BasePath = endpoint 148 } 149 return s, nil 150} 151 152// New creates a new Service. It uses the provided http.Client for requests. 153// 154// Deprecated: please use NewService instead. 155// To provide a custom HTTP client, use option.WithHTTPClient. 156// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 157func New(client *http.Client) (*Service, error) { 158 if client == nil { 159 return nil, errors.New("client is nil") 160 } 161 s := &Service{client: client, BasePath: basePath} 162 s.ContactGroups = NewContactGroupsService(s) 163 s.People = NewPeopleService(s) 164 return s, nil 165} 166 167type Service struct { 168 client *http.Client 169 BasePath string // API endpoint base URL 170 UserAgent string // optional additional User-Agent fragment 171 172 ContactGroups *ContactGroupsService 173 174 People *PeopleService 175} 176 177func (s *Service) userAgent() string { 178 if s.UserAgent == "" { 179 return googleapi.UserAgent 180 } 181 return googleapi.UserAgent + " " + s.UserAgent 182} 183 184func NewContactGroupsService(s *Service) *ContactGroupsService { 185 rs := &ContactGroupsService{s: s} 186 rs.Members = NewContactGroupsMembersService(s) 187 return rs 188} 189 190type ContactGroupsService struct { 191 s *Service 192 193 Members *ContactGroupsMembersService 194} 195 196func NewContactGroupsMembersService(s *Service) *ContactGroupsMembersService { 197 rs := &ContactGroupsMembersService{s: s} 198 return rs 199} 200 201type ContactGroupsMembersService struct { 202 s *Service 203} 204 205func NewPeopleService(s *Service) *PeopleService { 206 rs := &PeopleService{s: s} 207 rs.Connections = NewPeopleConnectionsService(s) 208 return rs 209} 210 211type PeopleService struct { 212 s *Service 213 214 Connections *PeopleConnectionsService 215} 216 217func NewPeopleConnectionsService(s *Service) *PeopleConnectionsService { 218 rs := &PeopleConnectionsService{s: s} 219 return rs 220} 221 222type PeopleConnectionsService struct { 223 s *Service 224} 225 226// Address: A person's physical address. May be a P.O. box or street 227// address. All fields 228// are optional. 229type Address struct { 230 // City: The city of the address. 231 City string `json:"city,omitempty"` 232 233 // Country: The country of the address. 234 Country string `json:"country,omitempty"` 235 236 // CountryCode: The [ISO 3166-1 237 // alpha-2](http://www.iso.org/iso/country_codes.htm) country 238 // code of the address. 239 CountryCode string `json:"countryCode,omitempty"` 240 241 // ExtendedAddress: The extended address of the address; for example, 242 // the apartment number. 243 ExtendedAddress string `json:"extendedAddress,omitempty"` 244 245 // FormattedType: Output only. The type of the address translated and 246 // formatted in the viewer's 247 // account locale or the `Accept-Language` HTTP header locale. 248 FormattedType string `json:"formattedType,omitempty"` 249 250 // FormattedValue: The unstructured value of the address. If this is not 251 // set by the user it 252 // will be automatically constructed from structured values. 253 FormattedValue string `json:"formattedValue,omitempty"` 254 255 // Metadata: Metadata about the address. 256 Metadata *FieldMetadata `json:"metadata,omitempty"` 257 258 // PoBox: The P.O. box of the address. 259 PoBox string `json:"poBox,omitempty"` 260 261 // PostalCode: The postal code of the address. 262 PostalCode string `json:"postalCode,omitempty"` 263 264 // Region: The region of the address; for example, the state or 265 // province. 266 Region string `json:"region,omitempty"` 267 268 // StreetAddress: The street address. 269 StreetAddress string `json:"streetAddress,omitempty"` 270 271 // Type: The type of the address. The type can be custom or one of these 272 // predefined 273 // values: 274 // 275 // * `home` 276 // * `work` 277 // * `other` 278 Type string `json:"type,omitempty"` 279 280 // ForceSendFields is a list of field names (e.g. "City") to 281 // unconditionally include in API requests. By default, fields with 282 // empty values are omitted from API requests. However, any non-pointer, 283 // non-interface field appearing in ForceSendFields will be sent to the 284 // server regardless of whether the field is empty or not. This may be 285 // used to include empty fields in Patch requests. 286 ForceSendFields []string `json:"-"` 287 288 // NullFields is a list of field names (e.g. "City") to include in API 289 // requests with the JSON null value. By default, fields with empty 290 // values are omitted from API requests. However, any field with an 291 // empty value appearing in NullFields will be sent to the server as 292 // null. It is an error if a field in this list has a non-empty value. 293 // This may be used to include null fields in Patch requests. 294 NullFields []string `json:"-"` 295} 296 297func (s *Address) MarshalJSON() ([]byte, error) { 298 type NoMethod Address 299 raw := NoMethod(*s) 300 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 301} 302 303// AgeRangeType: A person's age range. 304type AgeRangeType struct { 305 // AgeRange: The age range. 306 // 307 // Possible values: 308 // "AGE_RANGE_UNSPECIFIED" - Unspecified. 309 // "LESS_THAN_EIGHTEEN" - Younger than eighteen. 310 // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty. 311 // "TWENTY_ONE_OR_OLDER" - Twenty-one and older. 312 AgeRange string `json:"ageRange,omitempty"` 313 314 // Metadata: Metadata about the age range. 315 Metadata *FieldMetadata `json:"metadata,omitempty"` 316 317 // ForceSendFields is a list of field names (e.g. "AgeRange") to 318 // unconditionally include in API requests. By default, fields with 319 // empty values are omitted from API requests. However, any non-pointer, 320 // non-interface field appearing in ForceSendFields will be sent to the 321 // server regardless of whether the field is empty or not. This may be 322 // used to include empty fields in Patch requests. 323 ForceSendFields []string `json:"-"` 324 325 // NullFields is a list of field names (e.g. "AgeRange") to include in 326 // API requests with the JSON null value. By default, fields with empty 327 // values are omitted from API requests. However, any field with an 328 // empty value appearing in NullFields will be sent to the server as 329 // null. It is an error if a field in this list has a non-empty value. 330 // This may be used to include null fields in Patch requests. 331 NullFields []string `json:"-"` 332} 333 334func (s *AgeRangeType) MarshalJSON() ([]byte, error) { 335 type NoMethod AgeRangeType 336 raw := NoMethod(*s) 337 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 338} 339 340// BatchGetContactGroupsResponse: The response to a batch get contact 341// groups request. 342type BatchGetContactGroupsResponse struct { 343 // Responses: The list of responses for each requested contact group 344 // resource. 345 Responses []*ContactGroupResponse `json:"responses,omitempty"` 346 347 // ServerResponse contains the HTTP response code and headers from the 348 // server. 349 googleapi.ServerResponse `json:"-"` 350 351 // ForceSendFields is a list of field names (e.g. "Responses") to 352 // unconditionally include in API requests. By default, fields with 353 // empty values are omitted from API requests. However, any non-pointer, 354 // non-interface field appearing in ForceSendFields will be sent to the 355 // server regardless of whether the field is empty or not. This may be 356 // used to include empty fields in Patch requests. 357 ForceSendFields []string `json:"-"` 358 359 // NullFields is a list of field names (e.g. "Responses") to include in 360 // API requests with the JSON null value. By default, fields with empty 361 // values are omitted from API requests. However, any field with an 362 // empty value appearing in NullFields will be sent to the server as 363 // null. It is an error if a field in this list has a non-empty value. 364 // This may be used to include null fields in Patch requests. 365 NullFields []string `json:"-"` 366} 367 368func (s *BatchGetContactGroupsResponse) MarshalJSON() ([]byte, error) { 369 type NoMethod BatchGetContactGroupsResponse 370 raw := NoMethod(*s) 371 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 372} 373 374// Biography: A person's short biography. 375type Biography struct { 376 // ContentType: The content type of the biography. 377 // 378 // Possible values: 379 // "CONTENT_TYPE_UNSPECIFIED" - Unspecified. 380 // "TEXT_PLAIN" - Plain text. 381 // "TEXT_HTML" - HTML text. 382 ContentType string `json:"contentType,omitempty"` 383 384 // Metadata: Metadata about the biography. 385 Metadata *FieldMetadata `json:"metadata,omitempty"` 386 387 // Value: The short biography. 388 Value string `json:"value,omitempty"` 389 390 // ForceSendFields is a list of field names (e.g. "ContentType") to 391 // unconditionally include in API requests. By default, fields with 392 // empty values are omitted from API requests. However, any non-pointer, 393 // non-interface field appearing in ForceSendFields will be sent to the 394 // server regardless of whether the field is empty or not. This may be 395 // used to include empty fields in Patch requests. 396 ForceSendFields []string `json:"-"` 397 398 // NullFields is a list of field names (e.g. "ContentType") to include 399 // in API requests with the JSON null value. By default, fields with 400 // empty values are omitted from API requests. However, any field with 401 // an empty value appearing in NullFields will be sent to the server as 402 // null. It is an error if a field in this list has a non-empty value. 403 // This may be used to include null fields in Patch requests. 404 NullFields []string `json:"-"` 405} 406 407func (s *Biography) MarshalJSON() ([]byte, error) { 408 type NoMethod Biography 409 raw := NoMethod(*s) 410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 411} 412 413// Birthday: A person's birthday. At least one of the `date` and `text` 414// fields are 415// specified. The `date` and `text` fields typically represent the 416// same 417// date, but are not guaranteed to. 418type Birthday struct { 419 // Date: The date of the birthday. 420 Date *Date `json:"date,omitempty"` 421 422 // Metadata: Metadata about the birthday. 423 Metadata *FieldMetadata `json:"metadata,omitempty"` 424 425 // Text: A free-form string representing the user's birthday. 426 Text string `json:"text,omitempty"` 427 428 // ForceSendFields is a list of field names (e.g. "Date") to 429 // unconditionally include in API requests. By default, fields with 430 // empty values are omitted from API requests. However, any non-pointer, 431 // non-interface field appearing in ForceSendFields will be sent to the 432 // server regardless of whether the field is empty or not. This may be 433 // used to include empty fields in Patch requests. 434 ForceSendFields []string `json:"-"` 435 436 // NullFields is a list of field names (e.g. "Date") to include in API 437 // requests with the JSON null value. By default, fields with empty 438 // values are omitted from API requests. However, any field with an 439 // empty value appearing in NullFields will be sent to the server as 440 // null. It is an error if a field in this list has a non-empty value. 441 // This may be used to include null fields in Patch requests. 442 NullFields []string `json:"-"` 443} 444 445func (s *Birthday) MarshalJSON() ([]byte, error) { 446 type NoMethod Birthday 447 raw := NoMethod(*s) 448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 449} 450 451// BraggingRights: **DEPRECATED**: No data will be returned 452// A person's bragging rights. 453type BraggingRights struct { 454 // Metadata: Metadata about the bragging rights. 455 Metadata *FieldMetadata `json:"metadata,omitempty"` 456 457 // Value: The bragging rights; for example, `climbed mount everest`. 458 Value string `json:"value,omitempty"` 459 460 // ForceSendFields is a list of field names (e.g. "Metadata") to 461 // unconditionally include in API requests. By default, fields with 462 // empty values are omitted from API requests. However, any non-pointer, 463 // non-interface field appearing in ForceSendFields will be sent to the 464 // server regardless of whether the field is empty or not. This may be 465 // used to include empty fields in Patch requests. 466 ForceSendFields []string `json:"-"` 467 468 // NullFields is a list of field names (e.g. "Metadata") to include in 469 // API requests with the JSON null value. By default, fields with empty 470 // values are omitted from API requests. However, any field with an 471 // empty value appearing in NullFields will be sent to the server as 472 // null. It is an error if a field in this list has a non-empty value. 473 // This may be used to include null fields in Patch requests. 474 NullFields []string `json:"-"` 475} 476 477func (s *BraggingRights) MarshalJSON() ([]byte, error) { 478 type NoMethod BraggingRights 479 raw := NoMethod(*s) 480 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 481} 482 483// ContactGroup: A contact group. 484type ContactGroup struct { 485 // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) 486 // of the 487 // resource. Used for web cache validation. 488 Etag string `json:"etag,omitempty"` 489 490 // FormattedName: Output only. The name translated and formatted in the 491 // viewer's account locale 492 // or the `Accept-Language` HTTP header locale for system groups 493 // names. 494 // Group names set by the owner are the same as name. 495 FormattedName string `json:"formattedName,omitempty"` 496 497 // GroupType: Output only. The contact group type. 498 // 499 // Possible values: 500 // "GROUP_TYPE_UNSPECIFIED" - Unspecified. 501 // "USER_CONTACT_GROUP" - User defined contact group. 502 // "SYSTEM_CONTACT_GROUP" - System defined contact group. 503 GroupType string `json:"groupType,omitempty"` 504 505 // MemberCount: Output only. The total number of contacts in the group 506 // irrespective of max members in 507 // specified in the request. 508 MemberCount int64 `json:"memberCount,omitempty"` 509 510 // MemberResourceNames: Output only. The list of contact person resource 511 // names that are members of the contact 512 // group. The field is not populated for LIST requests and can only be 513 // updated 514 // through 515 // the 516 // [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/memb 517 // ers/modify). 518 MemberResourceNames []string `json:"memberResourceNames,omitempty"` 519 520 // Metadata: Output only. Metadata about the contact group. 521 Metadata *ContactGroupMetadata `json:"metadata,omitempty"` 522 523 // Name: The contact group name set by the group owner or a system 524 // provided name 525 // for system groups. 526 Name string `json:"name,omitempty"` 527 528 // ResourceName: The resource name for the contact group, assigned by 529 // the server. An ASCII 530 // string, in the form of `contactGroups/{contact_group_id}`. 531 ResourceName string `json:"resourceName,omitempty"` 532 533 // ServerResponse contains the HTTP response code and headers from the 534 // server. 535 googleapi.ServerResponse `json:"-"` 536 537 // ForceSendFields is a list of field names (e.g. "Etag") to 538 // unconditionally include in API requests. By default, fields with 539 // empty values are omitted from API requests. However, any non-pointer, 540 // non-interface field appearing in ForceSendFields will be sent to the 541 // server regardless of whether the field is empty or not. This may be 542 // used to include empty fields in Patch requests. 543 ForceSendFields []string `json:"-"` 544 545 // NullFields is a list of field names (e.g. "Etag") to include in API 546 // requests with the JSON null value. By default, fields with empty 547 // values are omitted from API requests. However, any field with an 548 // empty value appearing in NullFields will be sent to the server as 549 // null. It is an error if a field in this list has a non-empty value. 550 // This may be used to include null fields in Patch requests. 551 NullFields []string `json:"-"` 552} 553 554func (s *ContactGroup) MarshalJSON() ([]byte, error) { 555 type NoMethod ContactGroup 556 raw := NoMethod(*s) 557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 558} 559 560// ContactGroupMembership: A Google contact group membership. 561type ContactGroupMembership struct { 562 // ContactGroupId: Output only. The contact group ID for the contact 563 // group membership. 564 ContactGroupId string `json:"contactGroupId,omitempty"` 565 566 // ContactGroupResourceName: The resource name for the contact group, 567 // assigned by the server. An ASCII 568 // string, in the form of `contactGroups/{contact_group_id}`. 569 // Only contact_group_resource_name can be used for modifying 570 // memberships. 571 // Any contact group membership can be removed, but only user group 572 // or 573 // "myContacts" or "starred" system groups memberships can be added. 574 // A 575 // contact must always have at least one contact group membership. 576 ContactGroupResourceName string `json:"contactGroupResourceName,omitempty"` 577 578 // ForceSendFields is a list of field names (e.g. "ContactGroupId") to 579 // unconditionally include in API requests. By default, fields with 580 // empty values are omitted from API requests. However, any non-pointer, 581 // non-interface field appearing in ForceSendFields will be sent to the 582 // server regardless of whether the field is empty or not. This may be 583 // used to include empty fields in Patch requests. 584 ForceSendFields []string `json:"-"` 585 586 // NullFields is a list of field names (e.g. "ContactGroupId") to 587 // include in API requests with the JSON null value. By default, fields 588 // with empty values are omitted from API requests. However, any field 589 // with an empty value appearing in NullFields will be sent to the 590 // server as null. It is an error if a field in this list has a 591 // non-empty value. This may be used to include null fields in Patch 592 // requests. 593 NullFields []string `json:"-"` 594} 595 596func (s *ContactGroupMembership) MarshalJSON() ([]byte, error) { 597 type NoMethod ContactGroupMembership 598 raw := NoMethod(*s) 599 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 600} 601 602// ContactGroupMetadata: The metadata about a contact group. 603type ContactGroupMetadata struct { 604 // Deleted: Output only. True if the contact group resource has been 605 // deleted. Populated only 606 // for 607 // [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) 608 // requests 609 // that include a sync token. 610 Deleted bool `json:"deleted,omitempty"` 611 612 // UpdateTime: Output only. The time the group was last updated. 613 UpdateTime string `json:"updateTime,omitempty"` 614 615 // ForceSendFields is a list of field names (e.g. "Deleted") to 616 // unconditionally include in API requests. By default, fields with 617 // empty values are omitted from API requests. However, any non-pointer, 618 // non-interface field appearing in ForceSendFields will be sent to the 619 // server regardless of whether the field is empty or not. This may be 620 // used to include empty fields in Patch requests. 621 ForceSendFields []string `json:"-"` 622 623 // NullFields is a list of field names (e.g. "Deleted") to include in 624 // API requests with the JSON null value. By default, fields with empty 625 // values are omitted from API requests. However, any field with an 626 // empty value appearing in NullFields will be sent to the server as 627 // null. It is an error if a field in this list has a non-empty value. 628 // This may be used to include null fields in Patch requests. 629 NullFields []string `json:"-"` 630} 631 632func (s *ContactGroupMetadata) MarshalJSON() ([]byte, error) { 633 type NoMethod ContactGroupMetadata 634 raw := NoMethod(*s) 635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 636} 637 638// ContactGroupResponse: The response for a specific contact group. 639type ContactGroupResponse struct { 640 // ContactGroup: The contact group. 641 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 642 643 // RequestedResourceName: The original requested resource name. 644 RequestedResourceName string `json:"requestedResourceName,omitempty"` 645 646 // Status: The status of the response. 647 Status *Status `json:"status,omitempty"` 648 649 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 650 // unconditionally include in API requests. By default, fields with 651 // empty values are omitted from API requests. However, any non-pointer, 652 // non-interface field appearing in ForceSendFields will be sent to the 653 // server regardless of whether the field is empty or not. This may be 654 // used to include empty fields in Patch requests. 655 ForceSendFields []string `json:"-"` 656 657 // NullFields is a list of field names (e.g. "ContactGroup") to include 658 // in API requests with the JSON null value. By default, fields with 659 // empty values are omitted from API requests. However, any field with 660 // an empty value appearing in NullFields will be sent to the server as 661 // null. It is an error if a field in this list has a non-empty value. 662 // This may be used to include null fields in Patch requests. 663 NullFields []string `json:"-"` 664} 665 666func (s *ContactGroupResponse) MarshalJSON() ([]byte, error) { 667 type NoMethod ContactGroupResponse 668 raw := NoMethod(*s) 669 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 670} 671 672// CoverPhoto: A person's cover photo. A large image shown on the 673// person's 674// profile page that represents who they are or what they care about. 675type CoverPhoto struct { 676 // Default: True if the cover photo is the default cover photo; 677 // false if the cover photo is a user-provided cover photo. 678 Default bool `json:"default,omitempty"` 679 680 // Metadata: Metadata about the cover photo. 681 Metadata *FieldMetadata `json:"metadata,omitempty"` 682 683 // Url: The URL of the cover photo. 684 Url string `json:"url,omitempty"` 685 686 // ForceSendFields is a list of field names (e.g. "Default") to 687 // unconditionally include in API requests. By default, fields with 688 // empty values are omitted from API requests. However, any non-pointer, 689 // non-interface field appearing in ForceSendFields will be sent to the 690 // server regardless of whether the field is empty or not. This may be 691 // used to include empty fields in Patch requests. 692 ForceSendFields []string `json:"-"` 693 694 // NullFields is a list of field names (e.g. "Default") to include in 695 // API requests with the JSON null value. By default, fields with empty 696 // values are omitted from API requests. However, any field with an 697 // empty value appearing in NullFields will be sent to the server as 698 // null. It is an error if a field in this list has a non-empty value. 699 // This may be used to include null fields in Patch requests. 700 NullFields []string `json:"-"` 701} 702 703func (s *CoverPhoto) MarshalJSON() ([]byte, error) { 704 type NoMethod CoverPhoto 705 raw := NoMethod(*s) 706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 707} 708 709// CreateContactGroupRequest: A request to create a new contact group. 710type CreateContactGroupRequest struct { 711 // ContactGroup: Required. The contact group to create. 712 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 713 714 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 715 // unconditionally include in API requests. By default, fields with 716 // empty values are omitted from API requests. However, any non-pointer, 717 // non-interface field appearing in ForceSendFields will be sent to the 718 // server regardless of whether the field is empty or not. This may be 719 // used to include empty fields in Patch requests. 720 ForceSendFields []string `json:"-"` 721 722 // NullFields is a list of field names (e.g. "ContactGroup") to include 723 // in API requests with the JSON null value. By default, fields with 724 // empty values are omitted from API requests. However, any field with 725 // an empty value appearing in NullFields will be sent to the server as 726 // null. It is an error if a field in this list has a non-empty value. 727 // This may be used to include null fields in Patch requests. 728 NullFields []string `json:"-"` 729} 730 731func (s *CreateContactGroupRequest) MarshalJSON() ([]byte, error) { 732 type NoMethod CreateContactGroupRequest 733 raw := NoMethod(*s) 734 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 735} 736 737// Date: Represents a whole or partial calendar date, e.g. a birthday. 738// The time of day 739// and time zone are either specified elsewhere or are not significant. 740// The date 741// is relative to the Proleptic Gregorian Calendar. This can 742// represent: 743// 744// * A full date, with non-zero year, month and day values 745// * A month and day value, with a zero year, e.g. an anniversary 746// * A year on its own, with zero month and day values 747// * A year and month value, with a zero day, e.g. a credit card 748// expiration date 749// 750// Related types are google.type.TimeOfDay and 751// `google.protobuf.Timestamp`. 752type Date struct { 753 // Day: Day of month. Must be from 1 to 31 and valid for the year and 754 // month, or 0 755 // if specifying a year by itself or a year and month where the day is 756 // not 757 // significant. 758 Day int64 `json:"day,omitempty"` 759 760 // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year 761 // without a 762 // month and day. 763 Month int64 `json:"month,omitempty"` 764 765 // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date 766 // without 767 // a year. 768 Year int64 `json:"year,omitempty"` 769 770 // ForceSendFields is a list of field names (e.g. "Day") to 771 // unconditionally include in API requests. By default, fields with 772 // empty values are omitted from API requests. However, any non-pointer, 773 // non-interface field appearing in ForceSendFields will be sent to the 774 // server regardless of whether the field is empty or not. This may be 775 // used to include empty fields in Patch requests. 776 ForceSendFields []string `json:"-"` 777 778 // NullFields is a list of field names (e.g. "Day") to include in API 779 // requests with the JSON null value. By default, fields with empty 780 // values are omitted from API requests. However, any field with an 781 // empty value appearing in NullFields will be sent to the server as 782 // null. It is an error if a field in this list has a non-empty value. 783 // This may be used to include null fields in Patch requests. 784 NullFields []string `json:"-"` 785} 786 787func (s *Date) MarshalJSON() ([]byte, error) { 788 type NoMethod Date 789 raw := NoMethod(*s) 790 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 791} 792 793// DeleteContactPhotoResponse: The response for deleteing a contact's 794// photo. 795type DeleteContactPhotoResponse struct { 796 // Person: The updated person, if person_fields is set in 797 // the 798 // DeleteContactPhotoRequest; otherwise this will be unset. 799 Person *Person `json:"person,omitempty"` 800 801 // ServerResponse contains the HTTP response code and headers from the 802 // server. 803 googleapi.ServerResponse `json:"-"` 804 805 // ForceSendFields is a list of field names (e.g. "Person") to 806 // unconditionally include in API requests. By default, fields with 807 // empty values are omitted from API requests. However, any non-pointer, 808 // non-interface field appearing in ForceSendFields will be sent to the 809 // server regardless of whether the field is empty or not. This may be 810 // used to include empty fields in Patch requests. 811 ForceSendFields []string `json:"-"` 812 813 // NullFields is a list of field names (e.g. "Person") to include in API 814 // requests with the JSON null value. By default, fields with empty 815 // values are omitted from API requests. However, any field with an 816 // empty value appearing in NullFields will be sent to the server as 817 // null. It is an error if a field in this list has a non-empty value. 818 // This may be used to include null fields in Patch requests. 819 NullFields []string `json:"-"` 820} 821 822func (s *DeleteContactPhotoResponse) MarshalJSON() ([]byte, error) { 823 type NoMethod DeleteContactPhotoResponse 824 raw := NoMethod(*s) 825 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 826} 827 828// DomainMembership: A G Suite Domain membership. 829type DomainMembership struct { 830 // InViewerDomain: True if the person is in the viewer's G Suite domain. 831 InViewerDomain bool `json:"inViewerDomain,omitempty"` 832 833 // ForceSendFields is a list of field names (e.g. "InViewerDomain") to 834 // unconditionally include in API requests. By default, fields with 835 // empty values are omitted from API requests. However, any non-pointer, 836 // non-interface field appearing in ForceSendFields will be sent to the 837 // server regardless of whether the field is empty or not. This may be 838 // used to include empty fields in Patch requests. 839 ForceSendFields []string `json:"-"` 840 841 // NullFields is a list of field names (e.g. "InViewerDomain") to 842 // include in API requests with the JSON null value. By default, fields 843 // with empty values are omitted from API requests. However, any field 844 // with an empty value appearing in NullFields will be sent to the 845 // server as null. It is an error if a field in this list has a 846 // non-empty value. This may be used to include null fields in Patch 847 // requests. 848 NullFields []string `json:"-"` 849} 850 851func (s *DomainMembership) MarshalJSON() ([]byte, error) { 852 type NoMethod DomainMembership 853 raw := NoMethod(*s) 854 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 855} 856 857// EmailAddress: A person's email address. 858type EmailAddress struct { 859 // DisplayName: The display name of the email. 860 DisplayName string `json:"displayName,omitempty"` 861 862 // FormattedType: Output only. The type of the email address translated 863 // and formatted in the 864 // viewer's account locale or the `Accept-Language` HTTP header locale. 865 FormattedType string `json:"formattedType,omitempty"` 866 867 // Metadata: Metadata about the email address. 868 Metadata *FieldMetadata `json:"metadata,omitempty"` 869 870 // Type: The type of the email address. The type can be custom or one of 871 // these 872 // predefined values: 873 // 874 // * `home` 875 // * `work` 876 // * `other` 877 Type string `json:"type,omitempty"` 878 879 // Value: The email address. 880 Value string `json:"value,omitempty"` 881 882 // ForceSendFields is a list of field names (e.g. "DisplayName") to 883 // unconditionally include in API requests. By default, fields with 884 // empty values are omitted from API requests. However, any non-pointer, 885 // non-interface field appearing in ForceSendFields will be sent to the 886 // server regardless of whether the field is empty or not. This may be 887 // used to include empty fields in Patch requests. 888 ForceSendFields []string `json:"-"` 889 890 // NullFields is a list of field names (e.g. "DisplayName") to include 891 // in API requests with the JSON null value. By default, fields with 892 // empty values are omitted from API requests. However, any field with 893 // an empty value appearing in NullFields will be sent to the server as 894 // null. It is an error if a field in this list has a non-empty value. 895 // This may be used to include null fields in Patch requests. 896 NullFields []string `json:"-"` 897} 898 899func (s *EmailAddress) MarshalJSON() ([]byte, error) { 900 type NoMethod EmailAddress 901 raw := NoMethod(*s) 902 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 903} 904 905// Empty: A generic empty message that you can re-use to avoid defining 906// duplicated 907// empty messages in your APIs. A typical example is to use it as the 908// request 909// or the response type of an API method. For instance: 910// 911// service Foo { 912// rpc Bar(google.protobuf.Empty) returns 913// (google.protobuf.Empty); 914// } 915// 916// The JSON representation for `Empty` is empty JSON object `{}`. 917type Empty struct { 918 // ServerResponse contains the HTTP response code and headers from the 919 // server. 920 googleapi.ServerResponse `json:"-"` 921} 922 923// Event: An event related to the person. 924type Event struct { 925 // Date: The date of the event. 926 Date *Date `json:"date,omitempty"` 927 928 // FormattedType: Output only. The type of the event translated and 929 // formatted in the 930 // viewer's account locale or the `Accept-Language` HTTP header locale. 931 FormattedType string `json:"formattedType,omitempty"` 932 933 // Metadata: Metadata about the event. 934 Metadata *FieldMetadata `json:"metadata,omitempty"` 935 936 // Type: The type of the event. The type can be custom or one of these 937 // predefined 938 // values: 939 // 940 // * `anniversary` 941 // * `other` 942 Type string `json:"type,omitempty"` 943 944 // ForceSendFields is a list of field names (e.g. "Date") to 945 // unconditionally include in API requests. By default, fields with 946 // empty values are omitted from API requests. However, any non-pointer, 947 // non-interface field appearing in ForceSendFields will be sent to the 948 // server regardless of whether the field is empty or not. This may be 949 // used to include empty fields in Patch requests. 950 ForceSendFields []string `json:"-"` 951 952 // NullFields is a list of field names (e.g. "Date") to include in API 953 // requests with the JSON null value. By default, fields with empty 954 // values are omitted from API requests. However, any field with an 955 // empty value appearing in NullFields will be sent to the server as 956 // null. It is an error if a field in this list has a non-empty value. 957 // This may be used to include null fields in Patch requests. 958 NullFields []string `json:"-"` 959} 960 961func (s *Event) MarshalJSON() ([]byte, error) { 962 type NoMethod Event 963 raw := NoMethod(*s) 964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 965} 966 967// FieldMetadata: Metadata about a field. 968type FieldMetadata struct { 969 // Primary: True if the field is the primary field; false if the field 970 // is a secondary 971 // field. 972 Primary bool `json:"primary,omitempty"` 973 974 // Source: The source of the field. 975 Source *Source `json:"source,omitempty"` 976 977 // Verified: Output only. True if the field is verified; false if the 978 // field is unverified. A 979 // verified field is typically a name, email address, phone number, 980 // or 981 // website that has been confirmed to be owned by the person. 982 Verified bool `json:"verified,omitempty"` 983 984 // ForceSendFields is a list of field names (e.g. "Primary") to 985 // unconditionally include in API requests. By default, fields with 986 // empty values are omitted from API requests. However, any non-pointer, 987 // non-interface field appearing in ForceSendFields will be sent to the 988 // server regardless of whether the field is empty or not. This may be 989 // used to include empty fields in Patch requests. 990 ForceSendFields []string `json:"-"` 991 992 // NullFields is a list of field names (e.g. "Primary") to include in 993 // API requests with the JSON null value. By default, fields with empty 994 // values are omitted from API requests. However, any field with an 995 // empty value appearing in NullFields will be sent to the server as 996 // null. It is an error if a field in this list has a non-empty value. 997 // This may be used to include null fields in Patch requests. 998 NullFields []string `json:"-"` 999} 1000 1001func (s *FieldMetadata) MarshalJSON() ([]byte, error) { 1002 type NoMethod FieldMetadata 1003 raw := NoMethod(*s) 1004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1005} 1006 1007// Gender: A person's gender. 1008type Gender struct { 1009 // AddressMeAs: The type of pronouns that should be used to address the 1010 // person. The value 1011 // can be custom or one of these predefined values: 1012 // 1013 // * `male` 1014 // * `female` 1015 // * `other` 1016 AddressMeAs string `json:"addressMeAs,omitempty"` 1017 1018 // FormattedValue: Output only. The value of the gender translated and 1019 // formatted in the viewer's account 1020 // locale or the `Accept-Language` HTTP header locale. Unspecified or 1021 // custom 1022 // value are not localized. 1023 FormattedValue string `json:"formattedValue,omitempty"` 1024 1025 // Metadata: Metadata about the gender. 1026 Metadata *FieldMetadata `json:"metadata,omitempty"` 1027 1028 // Value: The gender for the person. The gender can be custom or one of 1029 // these 1030 // predefined values: 1031 // 1032 // * `male` 1033 // * `female` 1034 // * `unspecified` 1035 Value string `json:"value,omitempty"` 1036 1037 // ForceSendFields is a list of field names (e.g. "AddressMeAs") to 1038 // unconditionally include in API requests. By default, fields with 1039 // empty values are omitted from API requests. However, any non-pointer, 1040 // non-interface field appearing in ForceSendFields will be sent to the 1041 // server regardless of whether the field is empty or not. This may be 1042 // used to include empty fields in Patch requests. 1043 ForceSendFields []string `json:"-"` 1044 1045 // NullFields is a list of field names (e.g. "AddressMeAs") to include 1046 // in API requests with the JSON null value. By default, fields with 1047 // empty values are omitted from API requests. However, any field with 1048 // an empty value appearing in NullFields will be sent to the server as 1049 // null. It is an error if a field in this list has a non-empty value. 1050 // This may be used to include null fields in Patch requests. 1051 NullFields []string `json:"-"` 1052} 1053 1054func (s *Gender) MarshalJSON() ([]byte, error) { 1055 type NoMethod Gender 1056 raw := NoMethod(*s) 1057 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1058} 1059 1060// GetPeopleResponse: The response to a get request for a list of people 1061// by resource name. 1062type GetPeopleResponse struct { 1063 // Responses: The response for each requested resource name. 1064 Responses []*PersonResponse `json:"responses,omitempty"` 1065 1066 // ServerResponse contains the HTTP response code and headers from the 1067 // server. 1068 googleapi.ServerResponse `json:"-"` 1069 1070 // ForceSendFields is a list of field names (e.g. "Responses") to 1071 // unconditionally include in API requests. By default, fields with 1072 // empty values are omitted from API requests. However, any non-pointer, 1073 // non-interface field appearing in ForceSendFields will be sent to the 1074 // server regardless of whether the field is empty or not. This may be 1075 // used to include empty fields in Patch requests. 1076 ForceSendFields []string `json:"-"` 1077 1078 // NullFields is a list of field names (e.g. "Responses") to include in 1079 // API requests with the JSON null value. By default, fields with empty 1080 // values are omitted from API requests. However, any field with an 1081 // empty value appearing in NullFields will be sent to the server as 1082 // null. It is an error if a field in this list has a non-empty value. 1083 // This may be used to include null fields in Patch requests. 1084 NullFields []string `json:"-"` 1085} 1086 1087func (s *GetPeopleResponse) MarshalJSON() ([]byte, error) { 1088 type NoMethod GetPeopleResponse 1089 raw := NoMethod(*s) 1090 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1091} 1092 1093// ImClient: A person's instant messaging client. 1094type ImClient struct { 1095 // FormattedProtocol: Output only. The protocol of the IM client 1096 // formatted in the viewer's account 1097 // locale or the `Accept-Language` HTTP header locale. 1098 FormattedProtocol string `json:"formattedProtocol,omitempty"` 1099 1100 // FormattedType: Output only. The type of the IM client translated and 1101 // formatted in the 1102 // viewer's account locale or the `Accept-Language` HTTP header locale. 1103 FormattedType string `json:"formattedType,omitempty"` 1104 1105 // Metadata: Metadata about the IM client. 1106 Metadata *FieldMetadata `json:"metadata,omitempty"` 1107 1108 // Protocol: The protocol of the IM client. The protocol can be custom 1109 // or one of these 1110 // predefined values: 1111 // 1112 // * `aim` 1113 // * `msn` 1114 // * `yahoo` 1115 // * `skype` 1116 // * `qq` 1117 // * `googleTalk` 1118 // * `icq` 1119 // * `jabber` 1120 // * `netMeeting` 1121 Protocol string `json:"protocol,omitempty"` 1122 1123 // Type: The type of the IM client. The type can be custom or one of 1124 // these 1125 // predefined values: 1126 // 1127 // * `home` 1128 // * `work` 1129 // * `other` 1130 Type string `json:"type,omitempty"` 1131 1132 // Username: The user name used in the IM client. 1133 Username string `json:"username,omitempty"` 1134 1135 // ForceSendFields is a list of field names (e.g. "FormattedProtocol") 1136 // to unconditionally include in API requests. By default, fields with 1137 // empty values are omitted from API requests. However, any non-pointer, 1138 // non-interface field appearing in ForceSendFields will be sent to the 1139 // server regardless of whether the field is empty or not. This may be 1140 // used to include empty fields in Patch requests. 1141 ForceSendFields []string `json:"-"` 1142 1143 // NullFields is a list of field names (e.g. "FormattedProtocol") to 1144 // include in API requests with the JSON null value. By default, fields 1145 // with empty values are omitted from API requests. However, any field 1146 // with an empty value appearing in NullFields will be sent to the 1147 // server as null. It is an error if a field in this list has a 1148 // non-empty value. This may be used to include null fields in Patch 1149 // requests. 1150 NullFields []string `json:"-"` 1151} 1152 1153func (s *ImClient) MarshalJSON() ([]byte, error) { 1154 type NoMethod ImClient 1155 raw := NoMethod(*s) 1156 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1157} 1158 1159// Interest: One of the person's interests. 1160type Interest struct { 1161 // Metadata: Metadata about the interest. 1162 Metadata *FieldMetadata `json:"metadata,omitempty"` 1163 1164 // Value: The interest; for example, `stargazing`. 1165 Value string `json:"value,omitempty"` 1166 1167 // ForceSendFields is a list of field names (e.g. "Metadata") to 1168 // unconditionally include in API requests. By default, fields with 1169 // empty values are omitted from API requests. However, any non-pointer, 1170 // non-interface field appearing in ForceSendFields will be sent to the 1171 // server regardless of whether the field is empty or not. This may be 1172 // used to include empty fields in Patch requests. 1173 ForceSendFields []string `json:"-"` 1174 1175 // NullFields is a list of field names (e.g. "Metadata") to include in 1176 // API requests with the JSON null value. By default, fields with empty 1177 // values are omitted from API requests. However, any field with an 1178 // empty value appearing in NullFields will be sent to the server as 1179 // null. It is an error if a field in this list has a non-empty value. 1180 // This may be used to include null fields in Patch requests. 1181 NullFields []string `json:"-"` 1182} 1183 1184func (s *Interest) MarshalJSON() ([]byte, error) { 1185 type NoMethod Interest 1186 raw := NoMethod(*s) 1187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1188} 1189 1190// ListConnectionsResponse: The response to a request for the 1191// authenticated user's connections. 1192type ListConnectionsResponse struct { 1193 // Connections: The list of people that the requestor is connected to. 1194 Connections []*Person `json:"connections,omitempty"` 1195 1196 // NextPageToken: A token, which can be sent as `page_token` to retrieve 1197 // the next page. 1198 // If this field is omitted, there are no subsequent pages. 1199 NextPageToken string `json:"nextPageToken,omitempty"` 1200 1201 // NextSyncToken: A token, which can be sent as `sync_token` to retrieve 1202 // changes since the 1203 // last request. Request must set `request_sync_token` to return the 1204 // sync 1205 // token. 1206 NextSyncToken string `json:"nextSyncToken,omitempty"` 1207 1208 // TotalItems: The total number of items in the list without pagination. 1209 TotalItems int64 `json:"totalItems,omitempty"` 1210 1211 // TotalPeople: **DEPRECATED** (Please use totalItems) 1212 // The total number of people in the list without pagination. 1213 TotalPeople int64 `json:"totalPeople,omitempty"` 1214 1215 // ServerResponse contains the HTTP response code and headers from the 1216 // server. 1217 googleapi.ServerResponse `json:"-"` 1218 1219 // ForceSendFields is a list of field names (e.g. "Connections") to 1220 // unconditionally include in API requests. By default, fields with 1221 // empty values are omitted from API requests. However, any non-pointer, 1222 // non-interface field appearing in ForceSendFields will be sent to the 1223 // server regardless of whether the field is empty or not. This may be 1224 // used to include empty fields in Patch requests. 1225 ForceSendFields []string `json:"-"` 1226 1227 // NullFields is a list of field names (e.g. "Connections") to include 1228 // in API requests with the JSON null value. By default, fields with 1229 // empty values are omitted from API requests. However, any field with 1230 // an empty value appearing in NullFields will be sent to the server as 1231 // null. It is an error if a field in this list has a non-empty value. 1232 // This may be used to include null fields in Patch requests. 1233 NullFields []string `json:"-"` 1234} 1235 1236func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) { 1237 type NoMethod ListConnectionsResponse 1238 raw := NoMethod(*s) 1239 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1240} 1241 1242// ListContactGroupsResponse: The response to a list contact groups 1243// request. 1244type ListContactGroupsResponse struct { 1245 // ContactGroups: The list of contact groups. Members of the contact 1246 // groups are not 1247 // populated. 1248 ContactGroups []*ContactGroup `json:"contactGroups,omitempty"` 1249 1250 // NextPageToken: The token that can be used to retrieve the next page 1251 // of results. 1252 NextPageToken string `json:"nextPageToken,omitempty"` 1253 1254 // NextSyncToken: The token that can be used to retrieve changes since 1255 // the last request. 1256 NextSyncToken string `json:"nextSyncToken,omitempty"` 1257 1258 // TotalItems: The total number of items in the list without pagination. 1259 TotalItems int64 `json:"totalItems,omitempty"` 1260 1261 // ServerResponse contains the HTTP response code and headers from the 1262 // server. 1263 googleapi.ServerResponse `json:"-"` 1264 1265 // ForceSendFields is a list of field names (e.g. "ContactGroups") to 1266 // unconditionally include in API requests. By default, fields with 1267 // empty values are omitted from API requests. However, any non-pointer, 1268 // non-interface field appearing in ForceSendFields will be sent to the 1269 // server regardless of whether the field is empty or not. This may be 1270 // used to include empty fields in Patch requests. 1271 ForceSendFields []string `json:"-"` 1272 1273 // NullFields is a list of field names (e.g. "ContactGroups") to include 1274 // in API requests with the JSON null value. By default, fields with 1275 // empty values are omitted from API requests. However, any field with 1276 // an empty value appearing in NullFields will be sent to the server as 1277 // null. It is an error if a field in this list has a non-empty value. 1278 // This may be used to include null fields in Patch requests. 1279 NullFields []string `json:"-"` 1280} 1281 1282func (s *ListContactGroupsResponse) MarshalJSON() ([]byte, error) { 1283 type NoMethod ListContactGroupsResponse 1284 raw := NoMethod(*s) 1285 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1286} 1287 1288// Locale: A person's locale preference. 1289type Locale struct { 1290 // Metadata: Metadata about the locale. 1291 Metadata *FieldMetadata `json:"metadata,omitempty"` 1292 1293 // Value: The well-formed [IETF BCP 1294 // 47](https://tools.ietf.org/html/bcp47) 1295 // language tag representing the locale. 1296 Value string `json:"value,omitempty"` 1297 1298 // ForceSendFields is a list of field names (e.g. "Metadata") to 1299 // unconditionally include in API requests. By default, fields with 1300 // empty values are omitted from API requests. However, any non-pointer, 1301 // non-interface field appearing in ForceSendFields will be sent to the 1302 // server regardless of whether the field is empty or not. This may be 1303 // used to include empty fields in Patch requests. 1304 ForceSendFields []string `json:"-"` 1305 1306 // NullFields is a list of field names (e.g. "Metadata") to include in 1307 // API requests with the JSON null value. By default, fields with empty 1308 // values are omitted from API requests. However, any field with an 1309 // empty value appearing in NullFields will be sent to the server as 1310 // null. It is an error if a field in this list has a non-empty value. 1311 // This may be used to include null fields in Patch requests. 1312 NullFields []string `json:"-"` 1313} 1314 1315func (s *Locale) MarshalJSON() ([]byte, error) { 1316 type NoMethod Locale 1317 raw := NoMethod(*s) 1318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1319} 1320 1321// Membership: A person's membership in a group. Only contact group 1322// memberships can be 1323// modified. 1324type Membership struct { 1325 // ContactGroupMembership: The contact group membership. 1326 ContactGroupMembership *ContactGroupMembership `json:"contactGroupMembership,omitempty"` 1327 1328 // DomainMembership: Output only. The domain membership. 1329 DomainMembership *DomainMembership `json:"domainMembership,omitempty"` 1330 1331 // Metadata: Metadata about the membership. 1332 Metadata *FieldMetadata `json:"metadata,omitempty"` 1333 1334 // ForceSendFields is a list of field names (e.g. 1335 // "ContactGroupMembership") to unconditionally include in API requests. 1336 // By default, fields with empty values are omitted from API requests. 1337 // However, any non-pointer, non-interface field appearing in 1338 // ForceSendFields will be sent to the server regardless of whether the 1339 // field is empty or not. This may be used to include empty fields in 1340 // Patch requests. 1341 ForceSendFields []string `json:"-"` 1342 1343 // NullFields is a list of field names (e.g. "ContactGroupMembership") 1344 // to include in API requests with the JSON null value. By default, 1345 // fields with empty values are omitted from API requests. However, any 1346 // field with an empty value appearing in NullFields will be sent to the 1347 // server as null. It is an error if a field in this list has a 1348 // non-empty value. This may be used to include null fields in Patch 1349 // requests. 1350 NullFields []string `json:"-"` 1351} 1352 1353func (s *Membership) MarshalJSON() ([]byte, error) { 1354 type NoMethod Membership 1355 raw := NoMethod(*s) 1356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1357} 1358 1359// ModifyContactGroupMembersRequest: A request to modify an existing 1360// contact group's members. Contacts can be 1361// removed from any group but they can only be added to a user group 1362// or 1363// "myContacts" or "starred" system groups. 1364type ModifyContactGroupMembersRequest struct { 1365 // ResourceNamesToAdd: Optional. The resource names of the contact 1366 // people to add in the form of 1367 // `people/{person_id}`. 1368 ResourceNamesToAdd []string `json:"resourceNamesToAdd,omitempty"` 1369 1370 // ResourceNamesToRemove: Optional. The resource names of the contact 1371 // people to remove in the form of 1372 // `people/{person_id}`. 1373 ResourceNamesToRemove []string `json:"resourceNamesToRemove,omitempty"` 1374 1375 // ForceSendFields is a list of field names (e.g. "ResourceNamesToAdd") 1376 // to unconditionally include in API requests. By default, fields with 1377 // empty values are omitted from API requests. However, any non-pointer, 1378 // non-interface field appearing in ForceSendFields will be sent to the 1379 // server regardless of whether the field is empty or not. This may be 1380 // used to include empty fields in Patch requests. 1381 ForceSendFields []string `json:"-"` 1382 1383 // NullFields is a list of field names (e.g. "ResourceNamesToAdd") to 1384 // include in API requests with the JSON null value. By default, fields 1385 // with empty values are omitted from API requests. However, any field 1386 // with an empty value appearing in NullFields will be sent to the 1387 // server as null. It is an error if a field in this list has a 1388 // non-empty value. This may be used to include null fields in Patch 1389 // requests. 1390 NullFields []string `json:"-"` 1391} 1392 1393func (s *ModifyContactGroupMembersRequest) MarshalJSON() ([]byte, error) { 1394 type NoMethod ModifyContactGroupMembersRequest 1395 raw := NoMethod(*s) 1396 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1397} 1398 1399// ModifyContactGroupMembersResponse: The response to a modify contact 1400// group members request. 1401type ModifyContactGroupMembersResponse struct { 1402 // CanNotRemoveLastContactGroupResourceNames: The contact people 1403 // resource names that cannot be removed from their 1404 // last contact group. 1405 CanNotRemoveLastContactGroupResourceNames []string `json:"canNotRemoveLastContactGroupResourceNames,omitempty"` 1406 1407 // NotFoundResourceNames: The contact people resource names that were 1408 // not found. 1409 NotFoundResourceNames []string `json:"notFoundResourceNames,omitempty"` 1410 1411 // ServerResponse contains the HTTP response code and headers from the 1412 // server. 1413 googleapi.ServerResponse `json:"-"` 1414 1415 // ForceSendFields is a list of field names (e.g. 1416 // "CanNotRemoveLastContactGroupResourceNames") to unconditionally 1417 // include in API requests. By default, fields with empty values are 1418 // omitted from API requests. However, any non-pointer, non-interface 1419 // field appearing in ForceSendFields will be sent to the server 1420 // regardless of whether the field is empty or not. This may be used to 1421 // include empty fields in Patch requests. 1422 ForceSendFields []string `json:"-"` 1423 1424 // NullFields is a list of field names (e.g. 1425 // "CanNotRemoveLastContactGroupResourceNames") to include in API 1426 // requests with the JSON null value. By default, fields with empty 1427 // values are omitted from API requests. However, any field with an 1428 // empty value appearing in NullFields will be sent to the server as 1429 // null. It is an error if a field in this list has a non-empty value. 1430 // This may be used to include null fields in Patch requests. 1431 NullFields []string `json:"-"` 1432} 1433 1434func (s *ModifyContactGroupMembersResponse) MarshalJSON() ([]byte, error) { 1435 type NoMethod ModifyContactGroupMembersResponse 1436 raw := NoMethod(*s) 1437 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1438} 1439 1440// Name: A person's name. If the name is a mononym, the family name is 1441// empty. 1442type Name struct { 1443 // DisplayName: Output only. The display name formatted according to the 1444 // locale specified by 1445 // the viewer's account or the `Accept-Language` HTTP header. 1446 DisplayName string `json:"displayName,omitempty"` 1447 1448 // DisplayNameLastFirst: Output only. The display name with the last 1449 // name first formatted according to 1450 // the locale specified by the viewer's account or the 1451 // `Accept-Language` HTTP header. 1452 DisplayNameLastFirst string `json:"displayNameLastFirst,omitempty"` 1453 1454 // FamilyName: The family name. 1455 FamilyName string `json:"familyName,omitempty"` 1456 1457 // GivenName: The given name. 1458 GivenName string `json:"givenName,omitempty"` 1459 1460 // HonorificPrefix: The honorific prefixes, such as `Mrs.` or `Dr.` 1461 HonorificPrefix string `json:"honorificPrefix,omitempty"` 1462 1463 // HonorificSuffix: The honorific suffixes, such as `Jr.` 1464 HonorificSuffix string `json:"honorificSuffix,omitempty"` 1465 1466 // Metadata: Metadata about the name. 1467 Metadata *FieldMetadata `json:"metadata,omitempty"` 1468 1469 // MiddleName: The middle name(s). 1470 MiddleName string `json:"middleName,omitempty"` 1471 1472 // PhoneticFamilyName: The family name spelled as it sounds. 1473 PhoneticFamilyName string `json:"phoneticFamilyName,omitempty"` 1474 1475 // PhoneticFullName: The full name spelled as it sounds. 1476 PhoneticFullName string `json:"phoneticFullName,omitempty"` 1477 1478 // PhoneticGivenName: The given name spelled as it sounds. 1479 PhoneticGivenName string `json:"phoneticGivenName,omitempty"` 1480 1481 // PhoneticHonorificPrefix: The honorific prefixes spelled as they 1482 // sound. 1483 PhoneticHonorificPrefix string `json:"phoneticHonorificPrefix,omitempty"` 1484 1485 // PhoneticHonorificSuffix: The honorific suffixes spelled as they 1486 // sound. 1487 PhoneticHonorificSuffix string `json:"phoneticHonorificSuffix,omitempty"` 1488 1489 // PhoneticMiddleName: The middle name(s) spelled as they sound. 1490 PhoneticMiddleName string `json:"phoneticMiddleName,omitempty"` 1491 1492 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1493 // unconditionally include in API requests. By default, fields with 1494 // empty values are omitted from API requests. However, any non-pointer, 1495 // non-interface field appearing in ForceSendFields will be sent to the 1496 // server regardless of whether the field is empty or not. This may be 1497 // used to include empty fields in Patch requests. 1498 ForceSendFields []string `json:"-"` 1499 1500 // NullFields is a list of field names (e.g. "DisplayName") to include 1501 // in API requests with the JSON null value. By default, fields with 1502 // empty values are omitted from API requests. However, any field with 1503 // an empty value appearing in NullFields will be sent to the server as 1504 // null. It is an error if a field in this list has a non-empty value. 1505 // This may be used to include null fields in Patch requests. 1506 NullFields []string `json:"-"` 1507} 1508 1509func (s *Name) MarshalJSON() ([]byte, error) { 1510 type NoMethod Name 1511 raw := NoMethod(*s) 1512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1513} 1514 1515// Nickname: A person's nickname. 1516type Nickname struct { 1517 // Metadata: Metadata about the nickname. 1518 Metadata *FieldMetadata `json:"metadata,omitempty"` 1519 1520 // Type: The type of the nickname. 1521 // 1522 // Possible values: 1523 // "DEFAULT" - Generic nickname. 1524 // "MAIDEN_NAME" - Maiden name or birth family name. Used when the 1525 // person's family name has 1526 // changed as a result of marriage. 1527 // "INITIALS" - Initials. 1528 // "GPLUS" - Google+ profile nickname. 1529 // "OTHER_NAME" - A professional affiliation or other name; for 1530 // example, `Dr. Smith.` 1531 // "ALTERNATE_NAME" - Alternate name person is known by. 1532 // "SHORT_NAME" - A shorter version of the person's name. 1533 Type string `json:"type,omitempty"` 1534 1535 // Value: The nickname. 1536 Value string `json:"value,omitempty"` 1537 1538 // ForceSendFields is a list of field names (e.g. "Metadata") to 1539 // unconditionally include in API requests. By default, fields with 1540 // empty values are omitted from API requests. However, any non-pointer, 1541 // non-interface field appearing in ForceSendFields will be sent to the 1542 // server regardless of whether the field is empty or not. This may be 1543 // used to include empty fields in Patch requests. 1544 ForceSendFields []string `json:"-"` 1545 1546 // NullFields is a list of field names (e.g. "Metadata") to include in 1547 // API requests with the JSON null value. By default, fields with empty 1548 // values are omitted from API requests. However, any field with an 1549 // empty value appearing in NullFields will be sent to the server as 1550 // null. It is an error if a field in this list has a non-empty value. 1551 // This may be used to include null fields in Patch requests. 1552 NullFields []string `json:"-"` 1553} 1554 1555func (s *Nickname) MarshalJSON() ([]byte, error) { 1556 type NoMethod Nickname 1557 raw := NoMethod(*s) 1558 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1559} 1560 1561// Occupation: A person's occupation. 1562type Occupation struct { 1563 // Metadata: Metadata about the occupation. 1564 Metadata *FieldMetadata `json:"metadata,omitempty"` 1565 1566 // Value: The occupation; for example, `carpenter`. 1567 Value string `json:"value,omitempty"` 1568 1569 // ForceSendFields is a list of field names (e.g. "Metadata") to 1570 // unconditionally include in API requests. By default, fields with 1571 // empty values are omitted from API requests. However, any non-pointer, 1572 // non-interface field appearing in ForceSendFields will be sent to the 1573 // server regardless of whether the field is empty or not. This may be 1574 // used to include empty fields in Patch requests. 1575 ForceSendFields []string `json:"-"` 1576 1577 // NullFields is a list of field names (e.g. "Metadata") to include in 1578 // API requests with the JSON null value. By default, fields with empty 1579 // values are omitted from API requests. However, any field with an 1580 // empty value appearing in NullFields will be sent to the server as 1581 // null. It is an error if a field in this list has a non-empty value. 1582 // This may be used to include null fields in Patch requests. 1583 NullFields []string `json:"-"` 1584} 1585 1586func (s *Occupation) MarshalJSON() ([]byte, error) { 1587 type NoMethod Occupation 1588 raw := NoMethod(*s) 1589 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1590} 1591 1592// Organization: A person's past or current organization. Overlapping 1593// date ranges are 1594// permitted. 1595type Organization struct { 1596 // Current: True if the organization is the person's current 1597 // organization; 1598 // false if the organization is a past organization. 1599 Current bool `json:"current,omitempty"` 1600 1601 // Department: The person's department at the organization. 1602 Department string `json:"department,omitempty"` 1603 1604 // Domain: The domain name associated with the organization; for 1605 // example, 1606 // `google.com`. 1607 Domain string `json:"domain,omitempty"` 1608 1609 // EndDate: The end date when the person left the organization. 1610 EndDate *Date `json:"endDate,omitempty"` 1611 1612 // FormattedType: Output only. The type of the organization translated 1613 // and formatted in the 1614 // viewer's account locale or the `Accept-Language` HTTP header locale. 1615 FormattedType string `json:"formattedType,omitempty"` 1616 1617 // JobDescription: The person's job description at the organization. 1618 JobDescription string `json:"jobDescription,omitempty"` 1619 1620 // Location: The location of the organization office the person works 1621 // at. 1622 Location string `json:"location,omitempty"` 1623 1624 // Metadata: Metadata about the organization. 1625 Metadata *FieldMetadata `json:"metadata,omitempty"` 1626 1627 // Name: The name of the organization. 1628 Name string `json:"name,omitempty"` 1629 1630 // PhoneticName: The phonetic name of the organization. 1631 PhoneticName string `json:"phoneticName,omitempty"` 1632 1633 // StartDate: The start date when the person joined the organization. 1634 StartDate *Date `json:"startDate,omitempty"` 1635 1636 // Symbol: The symbol associated with the organization; for example, a 1637 // stock ticker 1638 // symbol, abbreviation, or acronym. 1639 Symbol string `json:"symbol,omitempty"` 1640 1641 // Title: The person's job title at the organization. 1642 Title string `json:"title,omitempty"` 1643 1644 // Type: The type of the organization. The type can be custom or one of 1645 // these 1646 // predefined values: 1647 // 1648 // * `work` 1649 // * `school` 1650 Type string `json:"type,omitempty"` 1651 1652 // ForceSendFields is a list of field names (e.g. "Current") to 1653 // unconditionally include in API requests. By default, fields with 1654 // empty values are omitted from API requests. However, any non-pointer, 1655 // non-interface field appearing in ForceSendFields will be sent to the 1656 // server regardless of whether the field is empty or not. This may be 1657 // used to include empty fields in Patch requests. 1658 ForceSendFields []string `json:"-"` 1659 1660 // NullFields is a list of field names (e.g. "Current") to include in 1661 // API 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 *Organization) MarshalJSON() ([]byte, error) { 1670 type NoMethod Organization 1671 raw := NoMethod(*s) 1672 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1673} 1674 1675// Person: Information about a person merged from various data sources 1676// such as the 1677// authenticated user's contacts and profile data. 1678// 1679// Most fields can have multiple items. The items in a field have no 1680// guaranteed 1681// order, but each non-empty field is guaranteed to have exactly one 1682// field with 1683// `metadata.primary` set to true. 1684type Person struct { 1685 // Addresses: The person's street addresses. 1686 Addresses []*Address `json:"addresses,omitempty"` 1687 1688 // AgeRange: Output only. **DEPRECATED** (Please use `person.ageRanges` 1689 // instead) 1690 // 1691 // The person's age range. 1692 // 1693 // Possible values: 1694 // "AGE_RANGE_UNSPECIFIED" - Unspecified. 1695 // "LESS_THAN_EIGHTEEN" - Younger than eighteen. 1696 // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty. 1697 // "TWENTY_ONE_OR_OLDER" - Twenty-one and older. 1698 AgeRange string `json:"ageRange,omitempty"` 1699 1700 // AgeRanges: Output only. The person's age ranges. 1701 AgeRanges []*AgeRangeType `json:"ageRanges,omitempty"` 1702 1703 // Biographies: The person's biographies. 1704 Biographies []*Biography `json:"biographies,omitempty"` 1705 1706 // Birthdays: The person's birthdays. 1707 Birthdays []*Birthday `json:"birthdays,omitempty"` 1708 1709 // BraggingRights: **DEPRECATED**: No data will be returned 1710 // The person's bragging rights. 1711 BraggingRights []*BraggingRights `json:"braggingRights,omitempty"` 1712 1713 // CoverPhotos: Output only. The person's cover photos. 1714 CoverPhotos []*CoverPhoto `json:"coverPhotos,omitempty"` 1715 1716 // EmailAddresses: The person's email addresses. 1717 EmailAddresses []*EmailAddress `json:"emailAddresses,omitempty"` 1718 1719 // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) 1720 // of the 1721 // resource. Used for web cache validation. 1722 Etag string `json:"etag,omitempty"` 1723 1724 // Events: The person's events. 1725 Events []*Event `json:"events,omitempty"` 1726 1727 // Genders: The person's genders. 1728 Genders []*Gender `json:"genders,omitempty"` 1729 1730 // ImClients: The person's instant messaging clients. 1731 ImClients []*ImClient `json:"imClients,omitempty"` 1732 1733 // Interests: The person's interests. 1734 Interests []*Interest `json:"interests,omitempty"` 1735 1736 // Locales: The person's locale preferences. 1737 Locales []*Locale `json:"locales,omitempty"` 1738 1739 // Memberships: The person's group memberships. 1740 Memberships []*Membership `json:"memberships,omitempty"` 1741 1742 // Metadata: Output only. Metadata about the person. 1743 Metadata *PersonMetadata `json:"metadata,omitempty"` 1744 1745 // Names: The person's names. 1746 Names []*Name `json:"names,omitempty"` 1747 1748 // Nicknames: The person's nicknames. 1749 Nicknames []*Nickname `json:"nicknames,omitempty"` 1750 1751 // Occupations: The person's occupations. 1752 Occupations []*Occupation `json:"occupations,omitempty"` 1753 1754 // Organizations: The person's past or current organizations. 1755 Organizations []*Organization `json:"organizations,omitempty"` 1756 1757 // PhoneNumbers: The person's phone numbers. 1758 PhoneNumbers []*PhoneNumber `json:"phoneNumbers,omitempty"` 1759 1760 // Photos: Output only. The person's photos. 1761 Photos []*Photo `json:"photos,omitempty"` 1762 1763 // Relations: The person's relations. 1764 Relations []*Relation `json:"relations,omitempty"` 1765 1766 // RelationshipInterests: Output only. **DEPRECATED**: No data will be 1767 // returned 1768 // The person's relationship interests. 1769 RelationshipInterests []*RelationshipInterest `json:"relationshipInterests,omitempty"` 1770 1771 // RelationshipStatuses: Output only. **DEPRECATED**: No data will be 1772 // returned 1773 // The person's relationship statuses. 1774 RelationshipStatuses []*RelationshipStatus `json:"relationshipStatuses,omitempty"` 1775 1776 // Residences: The person's residences. 1777 Residences []*Residence `json:"residences,omitempty"` 1778 1779 // ResourceName: The resource name for the person, assigned by the 1780 // server. An ASCII string 1781 // with a max length of 27 characters, in the form 1782 // of 1783 // `people/{person_id}`. 1784 ResourceName string `json:"resourceName,omitempty"` 1785 1786 // SipAddresses: The person's SIP addresses. 1787 SipAddresses []*SipAddress `json:"sipAddresses,omitempty"` 1788 1789 // Skills: The person's skills. 1790 Skills []*Skill `json:"skills,omitempty"` 1791 1792 // Taglines: Output only. **DEPRECATED**: No data will be returned 1793 // The person's taglines. 1794 Taglines []*Tagline `json:"taglines,omitempty"` 1795 1796 // Urls: The person's associated URLs. 1797 Urls []*Url `json:"urls,omitempty"` 1798 1799 // UserDefined: The person's user defined data. 1800 UserDefined []*UserDefined `json:"userDefined,omitempty"` 1801 1802 // ServerResponse contains the HTTP response code and headers from the 1803 // server. 1804 googleapi.ServerResponse `json:"-"` 1805 1806 // ForceSendFields is a list of field names (e.g. "Addresses") to 1807 // unconditionally include in API requests. By default, fields with 1808 // empty values are omitted from API requests. However, any non-pointer, 1809 // non-interface field appearing in ForceSendFields will be sent to the 1810 // server regardless of whether the field is empty or not. This may be 1811 // used to include empty fields in Patch requests. 1812 ForceSendFields []string `json:"-"` 1813 1814 // NullFields is a list of field names (e.g. "Addresses") to include in 1815 // API requests with the JSON null value. By default, fields with empty 1816 // values are omitted from API requests. However, any field with an 1817 // empty value appearing in NullFields will be sent to the server as 1818 // null. It is an error if a field in this list has a non-empty value. 1819 // This may be used to include null fields in Patch requests. 1820 NullFields []string `json:"-"` 1821} 1822 1823func (s *Person) MarshalJSON() ([]byte, error) { 1824 type NoMethod Person 1825 raw := NoMethod(*s) 1826 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1827} 1828 1829// PersonMetadata: The metadata about a person. 1830type PersonMetadata struct { 1831 // Deleted: Output only. True if the person resource has been deleted. 1832 // Populated only 1833 // for 1834 // [`connections.list`](/people/api/rest/v1/people.connections/list) 1835 // requests 1836 // that include a sync token. 1837 Deleted bool `json:"deleted,omitempty"` 1838 1839 // LinkedPeopleResourceNames: Output only. Resource names of people 1840 // linked to this resource. 1841 LinkedPeopleResourceNames []string `json:"linkedPeopleResourceNames,omitempty"` 1842 1843 // ObjectType: Output only. **DEPRECATED** (Please 1844 // use 1845 // `person.metadata.sources.profileMetadata.objectType` instead) 1846 // 1847 // The type of the person object. 1848 // 1849 // Possible values: 1850 // "OBJECT_TYPE_UNSPECIFIED" - Unspecified. 1851 // "PERSON" - Person. 1852 // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/) 1853 ObjectType string `json:"objectType,omitempty"` 1854 1855 // PreviousResourceNames: Output only. Any former resource names this 1856 // person has had. Populated only 1857 // for 1858 // [`connections.list`](/people/api/rest/v1/people.connections/list) 1859 // requests 1860 // that include a sync token. 1861 // 1862 // The resource name may change when adding or removing fields that link 1863 // a 1864 // contact and profile such as a verified email, verified phone number, 1865 // or 1866 // profile URL. 1867 PreviousResourceNames []string `json:"previousResourceNames,omitempty"` 1868 1869 // Sources: The sources of data for the person. 1870 Sources []*Source `json:"sources,omitempty"` 1871 1872 // ForceSendFields is a list of field names (e.g. "Deleted") to 1873 // unconditionally include in API requests. By default, fields with 1874 // empty values are omitted from API requests. However, any non-pointer, 1875 // non-interface field appearing in ForceSendFields will be sent to the 1876 // server regardless of whether the field is empty or not. This may be 1877 // used to include empty fields in Patch requests. 1878 ForceSendFields []string `json:"-"` 1879 1880 // NullFields is a list of field names (e.g. "Deleted") to include in 1881 // API requests with the JSON null value. By default, fields with empty 1882 // values are omitted from API requests. However, any field with an 1883 // empty value appearing in NullFields will be sent to the server as 1884 // null. It is an error if a field in this list has a non-empty value. 1885 // This may be used to include null fields in Patch requests. 1886 NullFields []string `json:"-"` 1887} 1888 1889func (s *PersonMetadata) MarshalJSON() ([]byte, error) { 1890 type NoMethod PersonMetadata 1891 raw := NoMethod(*s) 1892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1893} 1894 1895// PersonResponse: The response for a single person 1896type PersonResponse struct { 1897 // HttpStatusCode: **DEPRECATED** (Please use status instead) 1898 // 1899 // [HTTP 1.1 status 1900 // code] 1901 // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). 1902 HttpStatusCode int64 `json:"httpStatusCode,omitempty"` 1903 1904 // Person: The person. 1905 Person *Person `json:"person,omitempty"` 1906 1907 // RequestedResourceName: The original requested resource name. May be 1908 // different than the resource 1909 // name on the returned person. 1910 // 1911 // The resource name can change when adding or removing fields that link 1912 // a 1913 // contact and profile such as a verified email, verified phone number, 1914 // or a 1915 // profile URL. 1916 RequestedResourceName string `json:"requestedResourceName,omitempty"` 1917 1918 // Status: The status of the response. 1919 Status *Status `json:"status,omitempty"` 1920 1921 // ForceSendFields is a list of field names (e.g. "HttpStatusCode") to 1922 // unconditionally include in API requests. By default, fields with 1923 // empty values are omitted from API requests. However, any non-pointer, 1924 // non-interface field appearing in ForceSendFields will be sent to the 1925 // server regardless of whether the field is empty or not. This may be 1926 // used to include empty fields in Patch requests. 1927 ForceSendFields []string `json:"-"` 1928 1929 // NullFields is a list of field names (e.g. "HttpStatusCode") to 1930 // include in API requests with the JSON null value. By default, fields 1931 // with empty values are omitted from API requests. However, any field 1932 // with an empty value appearing in NullFields will be sent to the 1933 // server as null. It is an error if a field in this list has a 1934 // non-empty value. This may be used to include null fields in Patch 1935 // requests. 1936 NullFields []string `json:"-"` 1937} 1938 1939func (s *PersonResponse) MarshalJSON() ([]byte, error) { 1940 type NoMethod PersonResponse 1941 raw := NoMethod(*s) 1942 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1943} 1944 1945// PhoneNumber: A person's phone number. 1946type PhoneNumber struct { 1947 // CanonicalForm: Output only. The canonicalized 1948 // [ITU-T 1949 // E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164. 1950 // 1.2008.pdf) 1951 // form of the phone number. 1952 CanonicalForm string `json:"canonicalForm,omitempty"` 1953 1954 // FormattedType: Output only. The type of the phone number translated 1955 // and formatted in the 1956 // viewer's account locale or the `Accept-Language` HTTP header locale. 1957 FormattedType string `json:"formattedType,omitempty"` 1958 1959 // Metadata: Metadata about the phone number. 1960 Metadata *FieldMetadata `json:"metadata,omitempty"` 1961 1962 // Type: The type of the phone number. The type can be custom or one of 1963 // these 1964 // predefined values: 1965 // 1966 // * `home` 1967 // * `work` 1968 // * `mobile` 1969 // * `homeFax` 1970 // * `workFax` 1971 // * `otherFax` 1972 // * `pager` 1973 // * `workMobile` 1974 // * `workPager` 1975 // * `main` 1976 // * `googleVoice` 1977 // * `other` 1978 Type string `json:"type,omitempty"` 1979 1980 // Value: The phone number. 1981 Value string `json:"value,omitempty"` 1982 1983 // ForceSendFields is a list of field names (e.g. "CanonicalForm") to 1984 // unconditionally include in API requests. By default, fields with 1985 // empty values are omitted from API requests. However, any non-pointer, 1986 // non-interface field appearing in ForceSendFields will be sent to the 1987 // server regardless of whether the field is empty or not. This may be 1988 // used to include empty fields in Patch requests. 1989 ForceSendFields []string `json:"-"` 1990 1991 // NullFields is a list of field names (e.g. "CanonicalForm") to include 1992 // in API requests with the JSON null value. By default, fields with 1993 // empty values are omitted from API requests. However, any field with 1994 // an empty value appearing in NullFields will be sent to the server as 1995 // null. It is an error if a field in this list has a non-empty value. 1996 // This may be used to include null fields in Patch requests. 1997 NullFields []string `json:"-"` 1998} 1999 2000func (s *PhoneNumber) MarshalJSON() ([]byte, error) { 2001 type NoMethod PhoneNumber 2002 raw := NoMethod(*s) 2003 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2004} 2005 2006// Photo: A person's photo. A picture shown next to the person's name 2007// to 2008// help others recognize the person. 2009type Photo struct { 2010 // Default: True if the photo is a default photo; 2011 // false if the photo is a user-provided photo. 2012 Default bool `json:"default,omitempty"` 2013 2014 // Metadata: Metadata about the photo. 2015 Metadata *FieldMetadata `json:"metadata,omitempty"` 2016 2017 // Url: The URL of the photo. You can change the desired size by 2018 // appending a query 2019 // parameter `sz={size}` at the end of the url, where {size} is the size 2020 // in 2021 // pixels. 2022 // Example: 2023 // https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AA 2024 // AAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50 2025 Url string `json:"url,omitempty"` 2026 2027 // ForceSendFields is a list of field names (e.g. "Default") to 2028 // unconditionally include in API requests. By default, fields with 2029 // empty values are omitted from API requests. However, any non-pointer, 2030 // non-interface field appearing in ForceSendFields will be sent to the 2031 // server regardless of whether the field is empty or not. This may be 2032 // used to include empty fields in Patch requests. 2033 ForceSendFields []string `json:"-"` 2034 2035 // NullFields is a list of field names (e.g. "Default") to include in 2036 // API requests with the JSON null value. By default, fields with empty 2037 // values are omitted from API requests. However, any field with an 2038 // empty value appearing in NullFields will be sent to the server as 2039 // null. It is an error if a field in this list has a non-empty value. 2040 // This may be used to include null fields in Patch requests. 2041 NullFields []string `json:"-"` 2042} 2043 2044func (s *Photo) MarshalJSON() ([]byte, error) { 2045 type NoMethod Photo 2046 raw := NoMethod(*s) 2047 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2048} 2049 2050// ProfileMetadata: The metadata about a profile. 2051type ProfileMetadata struct { 2052 // ObjectType: Output only. The profile object type. 2053 // 2054 // Possible values: 2055 // "OBJECT_TYPE_UNSPECIFIED" - Unspecified. 2056 // "PERSON" - Person. 2057 // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/) 2058 ObjectType string `json:"objectType,omitempty"` 2059 2060 // UserTypes: Output only. The user types. 2061 // 2062 // Possible values: 2063 // "USER_TYPE_UNKNOWN" - The user type is not known. 2064 // "GOOGLE_USER" - The user is a Google user. 2065 // "GPLUS_USER" - The user is a Google+ user. 2066 // "GOOGLE_APPS_USER" - The user is a G Suite user. 2067 UserTypes []string `json:"userTypes,omitempty"` 2068 2069 // ForceSendFields is a list of field names (e.g. "ObjectType") to 2070 // unconditionally include in API requests. By default, fields with 2071 // empty values are omitted from API requests. However, any non-pointer, 2072 // non-interface field appearing in ForceSendFields will be sent to the 2073 // server regardless of whether the field is empty or not. This may be 2074 // used to include empty fields in Patch requests. 2075 ForceSendFields []string `json:"-"` 2076 2077 // NullFields is a list of field names (e.g. "ObjectType") to include in 2078 // API requests with the JSON null value. By default, fields with empty 2079 // values are omitted from API requests. However, any field with an 2080 // empty value appearing in NullFields will be sent to the server as 2081 // null. It is an error if a field in this list has a non-empty value. 2082 // This may be used to include null fields in Patch requests. 2083 NullFields []string `json:"-"` 2084} 2085 2086func (s *ProfileMetadata) MarshalJSON() ([]byte, error) { 2087 type NoMethod ProfileMetadata 2088 raw := NoMethod(*s) 2089 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2090} 2091 2092// Relation: A person's relation to another person. 2093type Relation struct { 2094 // FormattedType: Output only. The type of the relation translated and 2095 // formatted in the viewer's 2096 // account locale or the locale specified in the Accept-Language HTTP 2097 // header. 2098 FormattedType string `json:"formattedType,omitempty"` 2099 2100 // Metadata: Metadata about the relation. 2101 Metadata *FieldMetadata `json:"metadata,omitempty"` 2102 2103 // Person: The name of the other person this relation refers to. 2104 Person string `json:"person,omitempty"` 2105 2106 // Type: The person's relation to the other person. The type can be 2107 // custom or one of 2108 // these predefined values: 2109 // 2110 // * `spouse` 2111 // * `child` 2112 // * `mother` 2113 // * `father` 2114 // * `parent` 2115 // * `brother` 2116 // * `sister` 2117 // * `friend` 2118 // * `relative` 2119 // * `domesticPartner` 2120 // * `manager` 2121 // * `assistant` 2122 // * `referredBy` 2123 // * `partner` 2124 Type string `json:"type,omitempty"` 2125 2126 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2127 // unconditionally include in API requests. By default, fields with 2128 // empty values are omitted from API requests. However, any non-pointer, 2129 // non-interface field appearing in ForceSendFields will be sent to the 2130 // server regardless of whether the field is empty or not. This may be 2131 // used to include empty fields in Patch requests. 2132 ForceSendFields []string `json:"-"` 2133 2134 // NullFields is a list of field names (e.g. "FormattedType") to include 2135 // in API requests with the JSON null value. By default, fields with 2136 // empty values are omitted from API requests. However, any field with 2137 // an empty value appearing in NullFields will be sent to the server as 2138 // null. It is an error if a field in this list has a non-empty value. 2139 // This may be used to include null fields in Patch requests. 2140 NullFields []string `json:"-"` 2141} 2142 2143func (s *Relation) MarshalJSON() ([]byte, error) { 2144 type NoMethod Relation 2145 raw := NoMethod(*s) 2146 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2147} 2148 2149// RelationshipInterest: **DEPRECATED**: No data will be returned 2150// A person's relationship interest . 2151type RelationshipInterest struct { 2152 // FormattedValue: Output only. The value of the relationship interest 2153 // translated and formatted 2154 // in the viewer's account locale or the locale specified in 2155 // the 2156 // Accept-Language HTTP header. 2157 FormattedValue string `json:"formattedValue,omitempty"` 2158 2159 // Metadata: Metadata about the relationship interest. 2160 Metadata *FieldMetadata `json:"metadata,omitempty"` 2161 2162 // Value: The kind of relationship the person is looking for. The value 2163 // can be custom 2164 // or one of these predefined values: 2165 // 2166 // * `friend` 2167 // * `date` 2168 // * `relationship` 2169 // * `networking` 2170 Value string `json:"value,omitempty"` 2171 2172 // ForceSendFields is a list of field names (e.g. "FormattedValue") to 2173 // unconditionally include in API requests. By default, fields with 2174 // empty values are omitted from API requests. However, any non-pointer, 2175 // non-interface field appearing in ForceSendFields will be sent to the 2176 // server regardless of whether the field is empty or not. This may be 2177 // used to include empty fields in Patch requests. 2178 ForceSendFields []string `json:"-"` 2179 2180 // NullFields is a list of field names (e.g. "FormattedValue") to 2181 // include in API requests with the JSON null value. By default, fields 2182 // with empty values are omitted from API requests. However, any field 2183 // with an empty value appearing in NullFields will be sent to the 2184 // server as null. It is an error if a field in this list has a 2185 // non-empty value. This may be used to include null fields in Patch 2186 // requests. 2187 NullFields []string `json:"-"` 2188} 2189 2190func (s *RelationshipInterest) MarshalJSON() ([]byte, error) { 2191 type NoMethod RelationshipInterest 2192 raw := NoMethod(*s) 2193 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2194} 2195 2196// RelationshipStatus: **DEPRECATED**: No data will be returned 2197// A person's relationship status. 2198type RelationshipStatus struct { 2199 // FormattedValue: Output only. The value of the relationship status 2200 // translated and formatted in 2201 // the viewer's account locale or the `Accept-Language` HTTP header 2202 // locale. 2203 FormattedValue string `json:"formattedValue,omitempty"` 2204 2205 // Metadata: Metadata about the relationship status. 2206 Metadata *FieldMetadata `json:"metadata,omitempty"` 2207 2208 // Value: The relationship status. The value can be custom or one of 2209 // these 2210 // predefined values: 2211 // 2212 // * `single` 2213 // * `inARelationship` 2214 // * `engaged` 2215 // * `married` 2216 // * `itsComplicated` 2217 // * `openRelationship` 2218 // * `widowed` 2219 // * `inDomesticPartnership` 2220 // * `inCivilUnion` 2221 Value string `json:"value,omitempty"` 2222 2223 // ForceSendFields is a list of field names (e.g. "FormattedValue") to 2224 // unconditionally include in API requests. By default, fields with 2225 // empty values are omitted from API requests. However, any non-pointer, 2226 // non-interface field appearing in ForceSendFields will be sent to the 2227 // server regardless of whether the field is empty or not. This may be 2228 // used to include empty fields in Patch requests. 2229 ForceSendFields []string `json:"-"` 2230 2231 // NullFields is a list of field names (e.g. "FormattedValue") to 2232 // include in API requests with the JSON null value. By default, fields 2233 // with empty values are omitted from API requests. However, any field 2234 // with an empty value appearing in NullFields will be sent to the 2235 // server as null. It is an error if a field in this list has a 2236 // non-empty value. This may be used to include null fields in Patch 2237 // requests. 2238 NullFields []string `json:"-"` 2239} 2240 2241func (s *RelationshipStatus) MarshalJSON() ([]byte, error) { 2242 type NoMethod RelationshipStatus 2243 raw := NoMethod(*s) 2244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2245} 2246 2247// Residence: A person's past or current residence. 2248type Residence struct { 2249 // Current: True if the residence is the person's current 2250 // residence; 2251 // false if the residence is a past residence. 2252 Current bool `json:"current,omitempty"` 2253 2254 // Metadata: Metadata about the residence. 2255 Metadata *FieldMetadata `json:"metadata,omitempty"` 2256 2257 // Value: The address of the residence. 2258 Value string `json:"value,omitempty"` 2259 2260 // ForceSendFields is a list of field names (e.g. "Current") to 2261 // unconditionally include in API requests. By default, fields with 2262 // empty values are omitted from API requests. However, any non-pointer, 2263 // non-interface field appearing in ForceSendFields will be sent to the 2264 // server regardless of whether the field is empty or not. This may be 2265 // used to include empty fields in Patch requests. 2266 ForceSendFields []string `json:"-"` 2267 2268 // NullFields is a list of field names (e.g. "Current") to include in 2269 // API requests with the JSON null value. By default, fields with empty 2270 // values are omitted from API requests. However, any field with an 2271 // empty value appearing in NullFields will be sent to the server as 2272 // null. It is an error if a field in this list has a non-empty value. 2273 // This may be used to include null fields in Patch requests. 2274 NullFields []string `json:"-"` 2275} 2276 2277func (s *Residence) MarshalJSON() ([]byte, error) { 2278 type NoMethod Residence 2279 raw := NoMethod(*s) 2280 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2281} 2282 2283// SipAddress: A person's SIP address. Session Initial Protocol 2284// addresses are used for VoIP 2285// communications to make voice or video calls over the internet. 2286type SipAddress struct { 2287 // FormattedType: Output only. The type of the SIP address translated 2288 // and formatted in the 2289 // viewer's account locale or the `Accept-Language` HTTP header locale. 2290 FormattedType string `json:"formattedType,omitempty"` 2291 2292 // Metadata: Metadata about the SIP address. 2293 Metadata *FieldMetadata `json:"metadata,omitempty"` 2294 2295 // Type: The type of the SIP address. The type can be custom or or one 2296 // of these 2297 // predefined values: 2298 // 2299 // * `home` 2300 // * `work` 2301 // * `mobile` 2302 // * `other` 2303 Type string `json:"type,omitempty"` 2304 2305 // Value: The SIP address in the 2306 // [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP 2307 // URI 2308 // format. 2309 Value string `json:"value,omitempty"` 2310 2311 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2312 // unconditionally include in API requests. By default, fields with 2313 // empty values are omitted from API requests. However, any non-pointer, 2314 // non-interface field appearing in ForceSendFields will be sent to the 2315 // server regardless of whether the field is empty or not. This may be 2316 // used to include empty fields in Patch requests. 2317 ForceSendFields []string `json:"-"` 2318 2319 // NullFields is a list of field names (e.g. "FormattedType") to include 2320 // in API requests with the JSON null value. By default, fields with 2321 // empty values are omitted from API requests. However, any field with 2322 // an empty value appearing in NullFields will be sent to the server as 2323 // null. It is an error if a field in this list has a non-empty value. 2324 // This may be used to include null fields in Patch requests. 2325 NullFields []string `json:"-"` 2326} 2327 2328func (s *SipAddress) MarshalJSON() ([]byte, error) { 2329 type NoMethod SipAddress 2330 raw := NoMethod(*s) 2331 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2332} 2333 2334// Skill: A skill that the person has. 2335type Skill struct { 2336 // Metadata: Metadata about the skill. 2337 Metadata *FieldMetadata `json:"metadata,omitempty"` 2338 2339 // Value: The skill; for example, `underwater basket weaving`. 2340 Value string `json:"value,omitempty"` 2341 2342 // ForceSendFields is a list of field names (e.g. "Metadata") to 2343 // unconditionally include in API requests. By default, fields with 2344 // empty values are omitted from API requests. However, any non-pointer, 2345 // non-interface field appearing in ForceSendFields will be sent to the 2346 // server regardless of whether the field is empty or not. This may be 2347 // used to include empty fields in Patch requests. 2348 ForceSendFields []string `json:"-"` 2349 2350 // NullFields is a list of field names (e.g. "Metadata") to include in 2351 // API requests with the JSON null value. By default, fields with empty 2352 // values are omitted from API requests. However, any field with an 2353 // empty value appearing in NullFields will be sent to the server as 2354 // null. It is an error if a field in this list has a non-empty value. 2355 // This may be used to include null fields in Patch requests. 2356 NullFields []string `json:"-"` 2357} 2358 2359func (s *Skill) MarshalJSON() ([]byte, error) { 2360 type NoMethod Skill 2361 raw := NoMethod(*s) 2362 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2363} 2364 2365// Source: The source of a field. 2366type Source struct { 2367 // Etag: **Only populated in `person.metadata.sources`.** 2368 // 2369 // The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of 2370 // the 2371 // source. Used for web cache validation. 2372 Etag string `json:"etag,omitempty"` 2373 2374 // Id: The unique identifier within the source type generated by the 2375 // server. 2376 Id string `json:"id,omitempty"` 2377 2378 // ProfileMetadata: Output only. **Only populated in 2379 // `person.metadata.sources`.** 2380 // 2381 // Metadata about a source of type PROFILE. 2382 ProfileMetadata *ProfileMetadata `json:"profileMetadata,omitempty"` 2383 2384 // Type: The source type. 2385 // 2386 // Possible values: 2387 // "SOURCE_TYPE_UNSPECIFIED" - Unspecified. 2388 // "ACCOUNT" - [Google Account](https://accounts.google.com). 2389 // "PROFILE" - [Google profile](https://profiles.google.com). You can 2390 // view the 2391 // profile 2392 // at 2393 // [https://profiles.google.com/](https://profiles.google.com/){id}, 2394 // where 2395 // {id} is the source id. 2396 // "DOMAIN_PROFILE" - [G Suite domain 2397 // profile](https://support.google.com/a/answer/1628008). 2398 // "CONTACT" - [Google contact](https://contacts.google.com). You can 2399 // view the 2400 // contact 2401 // at 2402 // [https://contact.google.com/](https://contact.google.com/){id}, 2403 // where 2404 // {id} is the source id. 2405 Type string `json:"type,omitempty"` 2406 2407 // UpdateTime: Output only. **Only populated in 2408 // `person.metadata.sources`.** 2409 // 2410 // Last update timestamp of this source. 2411 UpdateTime string `json:"updateTime,omitempty"` 2412 2413 // ForceSendFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API 2422 // requests with the JSON null value. By default, fields with empty 2423 // values are omitted from API requests. However, any field with an 2424 // empty value appearing in NullFields will be sent to the server as 2425 // null. It is an error if a field in this list has a non-empty value. 2426 // This may be used to include null fields in Patch requests. 2427 NullFields []string `json:"-"` 2428} 2429 2430func (s *Source) MarshalJSON() ([]byte, error) { 2431 type NoMethod Source 2432 raw := NoMethod(*s) 2433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2434} 2435 2436// Status: The `Status` type defines a logical error model that is 2437// suitable for 2438// different programming environments, including REST APIs and RPC APIs. 2439// It is 2440// used by [gRPC](https://github.com/grpc). Each `Status` message 2441// contains 2442// three pieces of data: error code, error message, and error 2443// details. 2444// 2445// You can find out more about this error model and how to work with it 2446// in the 2447// [API Design Guide](https://cloud.google.com/apis/design/errors). 2448type Status struct { 2449 // Code: The status code, which should be an enum value of 2450 // google.rpc.Code. 2451 Code int64 `json:"code,omitempty"` 2452 2453 // Details: A list of messages that carry the error details. There is a 2454 // common set of 2455 // message types for APIs to use. 2456 Details []googleapi.RawMessage `json:"details,omitempty"` 2457 2458 // Message: A developer-facing error message, which should be in 2459 // English. Any 2460 // user-facing error message should be localized and sent in 2461 // the 2462 // google.rpc.Status.details field, or localized by the client. 2463 Message string `json:"message,omitempty"` 2464 2465 // ForceSendFields is a list of field names (e.g. "Code") to 2466 // unconditionally include in API requests. By default, fields with 2467 // empty values are omitted from API requests. However, any non-pointer, 2468 // non-interface field appearing in ForceSendFields will be sent to the 2469 // server regardless of whether the field is empty or not. This may be 2470 // used to include empty fields in Patch requests. 2471 ForceSendFields []string `json:"-"` 2472 2473 // NullFields is a list of field names (e.g. "Code") to include in API 2474 // requests with the JSON null value. By default, fields with empty 2475 // values are omitted from API requests. However, any field with an 2476 // empty value appearing in NullFields will be sent to the server as 2477 // null. It is an error if a field in this list has a non-empty value. 2478 // This may be used to include null fields in Patch requests. 2479 NullFields []string `json:"-"` 2480} 2481 2482func (s *Status) MarshalJSON() ([]byte, error) { 2483 type NoMethod Status 2484 raw := NoMethod(*s) 2485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2486} 2487 2488// Tagline: **DEPRECATED**: No data will be returned 2489// A brief one-line description of the person. 2490type Tagline struct { 2491 // Metadata: Metadata about the tagline. 2492 Metadata *FieldMetadata `json:"metadata,omitempty"` 2493 2494 // Value: The tagline. 2495 Value string `json:"value,omitempty"` 2496 2497 // ForceSendFields is a list of field names (e.g. "Metadata") to 2498 // unconditionally include in API requests. By default, fields with 2499 // empty values are omitted from API requests. However, any non-pointer, 2500 // non-interface field appearing in ForceSendFields will be sent to the 2501 // server regardless of whether the field is empty or not. This may be 2502 // used to include empty fields in Patch requests. 2503 ForceSendFields []string `json:"-"` 2504 2505 // NullFields is a list of field names (e.g. "Metadata") to include in 2506 // API requests with the JSON null value. By default, fields with empty 2507 // values are omitted from API requests. However, any field with an 2508 // empty value appearing in NullFields will be sent to the server as 2509 // null. It is an error if a field in this list has a non-empty value. 2510 // This may be used to include null fields in Patch requests. 2511 NullFields []string `json:"-"` 2512} 2513 2514func (s *Tagline) MarshalJSON() ([]byte, error) { 2515 type NoMethod Tagline 2516 raw := NoMethod(*s) 2517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2518} 2519 2520// UpdateContactGroupRequest: A request to update an existing user 2521// contact group. All updated fields will 2522// be replaced. 2523type UpdateContactGroupRequest struct { 2524 // ContactGroup: Required. The contact group to update. 2525 ContactGroup *ContactGroup `json:"contactGroup,omitempty"` 2526 2527 // ForceSendFields is a list of field names (e.g. "ContactGroup") to 2528 // unconditionally include in API requests. By default, fields with 2529 // empty values are omitted from API requests. However, any non-pointer, 2530 // non-interface field appearing in ForceSendFields will be sent to the 2531 // server regardless of whether the field is empty or not. This may be 2532 // used to include empty fields in Patch requests. 2533 ForceSendFields []string `json:"-"` 2534 2535 // NullFields is a list of field names (e.g. "ContactGroup") to include 2536 // in API requests with the JSON null value. By default, fields with 2537 // empty values are omitted from API requests. However, any field with 2538 // an empty value appearing in NullFields will be sent to the server as 2539 // null. It is an error if a field in this list has a non-empty value. 2540 // This may be used to include null fields in Patch requests. 2541 NullFields []string `json:"-"` 2542} 2543 2544func (s *UpdateContactGroupRequest) MarshalJSON() ([]byte, error) { 2545 type NoMethod UpdateContactGroupRequest 2546 raw := NoMethod(*s) 2547 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2548} 2549 2550// UpdateContactPhotoRequest: A request to update an existing contact's 2551// photo. 2552// All requests must have a valid photo format: JPEG or PNG. 2553type UpdateContactPhotoRequest struct { 2554 // PersonFields: Optional. A field mask to restrict which fields on the 2555 // person are returned. Multiple 2556 // fields can be specified by separating them with commas. Defaults to 2557 // empty 2558 // if not set, which will skip the post mutate get. Valid values are: 2559 // 2560 // * addresses 2561 // * ageRanges 2562 // * biographies 2563 // * birthdays 2564 // * coverPhotos 2565 // * emailAddresses 2566 // * events 2567 // * genders 2568 // * imClients 2569 // * interests 2570 // * locales 2571 // * memberships 2572 // * metadata 2573 // * names 2574 // * nicknames 2575 // * occupations 2576 // * organizations 2577 // * phoneNumbers 2578 // * photos 2579 // * relations 2580 // * residences 2581 // * sipAddresses 2582 // * skills 2583 // * urls 2584 // * userDefined 2585 PersonFields string `json:"personFields,omitempty"` 2586 2587 // PhotoBytes: Required. Raw photo bytes 2588 PhotoBytes string `json:"photoBytes,omitempty"` 2589 2590 // ForceSendFields is a list of field names (e.g. "PersonFields") to 2591 // unconditionally include in API requests. By default, fields with 2592 // empty values are omitted from API requests. However, any non-pointer, 2593 // non-interface field appearing in ForceSendFields will be sent to the 2594 // server regardless of whether the field is empty or not. This may be 2595 // used to include empty fields in Patch requests. 2596 ForceSendFields []string `json:"-"` 2597 2598 // NullFields is a list of field names (e.g. "PersonFields") to include 2599 // in API requests with the JSON null value. By default, fields with 2600 // empty values are omitted from API requests. However, any field with 2601 // an empty value appearing in NullFields will be sent to the server as 2602 // null. It is an error if a field in this list has a non-empty value. 2603 // This may be used to include null fields in Patch requests. 2604 NullFields []string `json:"-"` 2605} 2606 2607func (s *UpdateContactPhotoRequest) MarshalJSON() ([]byte, error) { 2608 type NoMethod UpdateContactPhotoRequest 2609 raw := NoMethod(*s) 2610 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2611} 2612 2613// UpdateContactPhotoResponse: The response for updating a contact's 2614// photo. 2615type UpdateContactPhotoResponse struct { 2616 // Person: The updated person, if person_fields is set in 2617 // the 2618 // UpdateContactPhotoRequest; otherwise this will be unset. 2619 Person *Person `json:"person,omitempty"` 2620 2621 // ServerResponse contains the HTTP response code and headers from the 2622 // server. 2623 googleapi.ServerResponse `json:"-"` 2624 2625 // ForceSendFields is a list of field names (e.g. "Person") to 2626 // unconditionally include in API requests. By default, fields with 2627 // empty values are omitted from API requests. However, any non-pointer, 2628 // non-interface field appearing in ForceSendFields will be sent to the 2629 // server regardless of whether the field is empty or not. This may be 2630 // used to include empty fields in Patch requests. 2631 ForceSendFields []string `json:"-"` 2632 2633 // NullFields is a list of field names (e.g. "Person") to include in API 2634 // requests with the JSON null value. By default, fields with empty 2635 // values are omitted from API requests. However, any field with an 2636 // empty value appearing in NullFields will be sent to the server as 2637 // null. It is an error if a field in this list has a non-empty value. 2638 // This may be used to include null fields in Patch requests. 2639 NullFields []string `json:"-"` 2640} 2641 2642func (s *UpdateContactPhotoResponse) MarshalJSON() ([]byte, error) { 2643 type NoMethod UpdateContactPhotoResponse 2644 raw := NoMethod(*s) 2645 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2646} 2647 2648// Url: A person's associated URLs. 2649type Url struct { 2650 // FormattedType: Output only. The type of the URL translated and 2651 // formatted in the viewer's 2652 // account locale or the `Accept-Language` HTTP header locale. 2653 FormattedType string `json:"formattedType,omitempty"` 2654 2655 // Metadata: Metadata about the URL. 2656 Metadata *FieldMetadata `json:"metadata,omitempty"` 2657 2658 // Type: The type of the URL. The type can be custom or one of these 2659 // predefined 2660 // values: 2661 // 2662 // * `home` 2663 // * `work` 2664 // * `blog` 2665 // * `profile` 2666 // * `homePage` 2667 // * `ftp` 2668 // * `reservations` 2669 // * `appInstallPage`: website for a Google+ application. 2670 // * `other` 2671 Type string `json:"type,omitempty"` 2672 2673 // Value: The URL. 2674 Value string `json:"value,omitempty"` 2675 2676 // ForceSendFields is a list of field names (e.g. "FormattedType") to 2677 // unconditionally include in API requests. By default, fields with 2678 // empty values are omitted from API requests. However, any non-pointer, 2679 // non-interface field appearing in ForceSendFields will be sent to the 2680 // server regardless of whether the field is empty or not. This may be 2681 // used to include empty fields in Patch requests. 2682 ForceSendFields []string `json:"-"` 2683 2684 // NullFields is a list of field names (e.g. "FormattedType") to include 2685 // in API requests with the JSON null value. By default, fields with 2686 // empty values are omitted from API requests. However, any field with 2687 // an empty value appearing in NullFields will be sent to the server as 2688 // null. It is an error if a field in this list has a non-empty value. 2689 // This may be used to include null fields in Patch requests. 2690 NullFields []string `json:"-"` 2691} 2692 2693func (s *Url) MarshalJSON() ([]byte, error) { 2694 type NoMethod Url 2695 raw := NoMethod(*s) 2696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2697} 2698 2699// UserDefined: Arbitrary user data that is populated by the end users. 2700type UserDefined struct { 2701 // Key: The end user specified key of the user defined data. 2702 Key string `json:"key,omitempty"` 2703 2704 // Metadata: Metadata about the user defined data. 2705 Metadata *FieldMetadata `json:"metadata,omitempty"` 2706 2707 // Value: The end user specified value of the user defined data. 2708 Value string `json:"value,omitempty"` 2709 2710 // ForceSendFields is a list of field names (e.g. "Key") to 2711 // unconditionally include in API requests. By default, fields with 2712 // empty values are omitted from API requests. However, any non-pointer, 2713 // non-interface field appearing in ForceSendFields will be sent to the 2714 // server regardless of whether the field is empty or not. This may be 2715 // used to include empty fields in Patch requests. 2716 ForceSendFields []string `json:"-"` 2717 2718 // NullFields is a list of field names (e.g. "Key") to include in API 2719 // requests with the JSON null value. By default, fields with empty 2720 // values are omitted from API requests. However, any field with an 2721 // empty value appearing in NullFields will be sent to the server as 2722 // null. It is an error if a field in this list has a non-empty value. 2723 // This may be used to include null fields in Patch requests. 2724 NullFields []string `json:"-"` 2725} 2726 2727func (s *UserDefined) MarshalJSON() ([]byte, error) { 2728 type NoMethod UserDefined 2729 raw := NoMethod(*s) 2730 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2731} 2732 2733// method id "people.contactGroups.batchGet": 2734 2735type ContactGroupsBatchGetCall struct { 2736 s *Service 2737 urlParams_ gensupport.URLParams 2738 ifNoneMatch_ string 2739 ctx_ context.Context 2740 header_ http.Header 2741} 2742 2743// BatchGet: Get a list of contact groups owned by the authenticated 2744// user by specifying 2745// a list of contact group resource names. 2746func (r *ContactGroupsService) BatchGet() *ContactGroupsBatchGetCall { 2747 c := &ContactGroupsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2748 return c 2749} 2750 2751// MaxMembers sets the optional parameter "maxMembers": Specifies the 2752// maximum number of members to return for each group. Defaults 2753// to 0 if not set, which will return zero members. 2754func (c *ContactGroupsBatchGetCall) MaxMembers(maxMembers int64) *ContactGroupsBatchGetCall { 2755 c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers)) 2756 return c 2757} 2758 2759// ResourceNames sets the optional parameter "resourceNames": Required. 2760// The resource names of the contact groups to get. 2761func (c *ContactGroupsBatchGetCall) ResourceNames(resourceNames ...string) *ContactGroupsBatchGetCall { 2762 c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) 2763 return c 2764} 2765 2766// Fields allows partial responses to be retrieved. See 2767// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2768// for more information. 2769func (c *ContactGroupsBatchGetCall) Fields(s ...googleapi.Field) *ContactGroupsBatchGetCall { 2770 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2771 return c 2772} 2773 2774// IfNoneMatch sets the optional parameter which makes the operation 2775// fail if the object's ETag matches the given value. This is useful for 2776// getting updates only after the object has changed since the last 2777// request. Use googleapi.IsNotModified to check whether the response 2778// error from Do is the result of In-None-Match. 2779func (c *ContactGroupsBatchGetCall) IfNoneMatch(entityTag string) *ContactGroupsBatchGetCall { 2780 c.ifNoneMatch_ = entityTag 2781 return c 2782} 2783 2784// Context sets the context to be used in this call's Do method. Any 2785// pending HTTP request will be aborted if the provided context is 2786// canceled. 2787func (c *ContactGroupsBatchGetCall) Context(ctx context.Context) *ContactGroupsBatchGetCall { 2788 c.ctx_ = ctx 2789 return c 2790} 2791 2792// Header returns an http.Header that can be modified by the caller to 2793// add HTTP headers to the request. 2794func (c *ContactGroupsBatchGetCall) Header() http.Header { 2795 if c.header_ == nil { 2796 c.header_ = make(http.Header) 2797 } 2798 return c.header_ 2799} 2800 2801func (c *ContactGroupsBatchGetCall) doRequest(alt string) (*http.Response, error) { 2802 reqHeaders := make(http.Header) 2803 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2804 for k, v := range c.header_ { 2805 reqHeaders[k] = v 2806 } 2807 reqHeaders.Set("User-Agent", c.s.userAgent()) 2808 if c.ifNoneMatch_ != "" { 2809 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2810 } 2811 var body io.Reader = nil 2812 c.urlParams_.Set("alt", alt) 2813 c.urlParams_.Set("prettyPrint", "false") 2814 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups:batchGet") 2815 urls += "?" + c.urlParams_.Encode() 2816 req, err := http.NewRequest("GET", urls, body) 2817 if err != nil { 2818 return nil, err 2819 } 2820 req.Header = reqHeaders 2821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2822} 2823 2824// Do executes the "people.contactGroups.batchGet" call. 2825// Exactly one of *BatchGetContactGroupsResponse or error will be 2826// non-nil. Any non-2xx status code is an error. Response headers are in 2827// either *BatchGetContactGroupsResponse.ServerResponse.Header or (if a 2828// response was returned at all) in error.(*googleapi.Error).Header. Use 2829// googleapi.IsNotModified to check whether the returned error was 2830// because http.StatusNotModified was returned. 2831func (c *ContactGroupsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetContactGroupsResponse, error) { 2832 gensupport.SetOptions(c.urlParams_, opts...) 2833 res, err := c.doRequest("json") 2834 if res != nil && res.StatusCode == http.StatusNotModified { 2835 if res.Body != nil { 2836 res.Body.Close() 2837 } 2838 return nil, &googleapi.Error{ 2839 Code: res.StatusCode, 2840 Header: res.Header, 2841 } 2842 } 2843 if err != nil { 2844 return nil, err 2845 } 2846 defer googleapi.CloseBody(res) 2847 if err := googleapi.CheckResponse(res); err != nil { 2848 return nil, err 2849 } 2850 ret := &BatchGetContactGroupsResponse{ 2851 ServerResponse: googleapi.ServerResponse{ 2852 Header: res.Header, 2853 HTTPStatusCode: res.StatusCode, 2854 }, 2855 } 2856 target := &ret 2857 if err := gensupport.DecodeResponse(target, res); err != nil { 2858 return nil, err 2859 } 2860 return ret, nil 2861 // { 2862 // "description": "Get a list of contact groups owned by the authenticated user by specifying\na list of contact group resource names.", 2863 // "flatPath": "v1/contactGroups:batchGet", 2864 // "httpMethod": "GET", 2865 // "id": "people.contactGroups.batchGet", 2866 // "parameterOrder": [], 2867 // "parameters": { 2868 // "maxMembers": { 2869 // "description": "Optional. Specifies the maximum number of members to return for each group. Defaults\nto 0 if not set, which will return zero members.", 2870 // "format": "int32", 2871 // "location": "query", 2872 // "type": "integer" 2873 // }, 2874 // "resourceNames": { 2875 // "description": "Required. The resource names of the contact groups to get.", 2876 // "location": "query", 2877 // "repeated": true, 2878 // "type": "string" 2879 // } 2880 // }, 2881 // "path": "v1/contactGroups:batchGet", 2882 // "response": { 2883 // "$ref": "BatchGetContactGroupsResponse" 2884 // }, 2885 // "scopes": [ 2886 // "https://www.googleapis.com/auth/contacts", 2887 // "https://www.googleapis.com/auth/contacts.readonly" 2888 // ] 2889 // } 2890 2891} 2892 2893// method id "people.contactGroups.create": 2894 2895type ContactGroupsCreateCall struct { 2896 s *Service 2897 createcontactgrouprequest *CreateContactGroupRequest 2898 urlParams_ gensupport.URLParams 2899 ctx_ context.Context 2900 header_ http.Header 2901} 2902 2903// Create: Create a new contact group owned by the authenticated user. 2904func (r *ContactGroupsService) Create(createcontactgrouprequest *CreateContactGroupRequest) *ContactGroupsCreateCall { 2905 c := &ContactGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2906 c.createcontactgrouprequest = createcontactgrouprequest 2907 return c 2908} 2909 2910// Fields allows partial responses to be retrieved. See 2911// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2912// for more information. 2913func (c *ContactGroupsCreateCall) Fields(s ...googleapi.Field) *ContactGroupsCreateCall { 2914 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2915 return c 2916} 2917 2918// Context sets the context to be used in this call's Do method. Any 2919// pending HTTP request will be aborted if the provided context is 2920// canceled. 2921func (c *ContactGroupsCreateCall) Context(ctx context.Context) *ContactGroupsCreateCall { 2922 c.ctx_ = ctx 2923 return c 2924} 2925 2926// Header returns an http.Header that can be modified by the caller to 2927// add HTTP headers to the request. 2928func (c *ContactGroupsCreateCall) Header() http.Header { 2929 if c.header_ == nil { 2930 c.header_ = make(http.Header) 2931 } 2932 return c.header_ 2933} 2934 2935func (c *ContactGroupsCreateCall) doRequest(alt string) (*http.Response, error) { 2936 reqHeaders := make(http.Header) 2937 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2938 for k, v := range c.header_ { 2939 reqHeaders[k] = v 2940 } 2941 reqHeaders.Set("User-Agent", c.s.userAgent()) 2942 var body io.Reader = nil 2943 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontactgrouprequest) 2944 if err != nil { 2945 return nil, err 2946 } 2947 reqHeaders.Set("Content-Type", "application/json") 2948 c.urlParams_.Set("alt", alt) 2949 c.urlParams_.Set("prettyPrint", "false") 2950 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups") 2951 urls += "?" + c.urlParams_.Encode() 2952 req, err := http.NewRequest("POST", urls, body) 2953 if err != nil { 2954 return nil, err 2955 } 2956 req.Header = reqHeaders 2957 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2958} 2959 2960// Do executes the "people.contactGroups.create" call. 2961// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 2962// status code is an error. Response headers are in either 2963// *ContactGroup.ServerResponse.Header or (if a response was returned at 2964// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2965// to check whether the returned error was because 2966// http.StatusNotModified was returned. 2967func (c *ContactGroupsCreateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 2968 gensupport.SetOptions(c.urlParams_, opts...) 2969 res, err := c.doRequest("json") 2970 if res != nil && res.StatusCode == http.StatusNotModified { 2971 if res.Body != nil { 2972 res.Body.Close() 2973 } 2974 return nil, &googleapi.Error{ 2975 Code: res.StatusCode, 2976 Header: res.Header, 2977 } 2978 } 2979 if err != nil { 2980 return nil, err 2981 } 2982 defer googleapi.CloseBody(res) 2983 if err := googleapi.CheckResponse(res); err != nil { 2984 return nil, err 2985 } 2986 ret := &ContactGroup{ 2987 ServerResponse: googleapi.ServerResponse{ 2988 Header: res.Header, 2989 HTTPStatusCode: res.StatusCode, 2990 }, 2991 } 2992 target := &ret 2993 if err := gensupport.DecodeResponse(target, res); err != nil { 2994 return nil, err 2995 } 2996 return ret, nil 2997 // { 2998 // "description": "Create a new contact group owned by the authenticated user.", 2999 // "flatPath": "v1/contactGroups", 3000 // "httpMethod": "POST", 3001 // "id": "people.contactGroups.create", 3002 // "parameterOrder": [], 3003 // "parameters": {}, 3004 // "path": "v1/contactGroups", 3005 // "request": { 3006 // "$ref": "CreateContactGroupRequest" 3007 // }, 3008 // "response": { 3009 // "$ref": "ContactGroup" 3010 // }, 3011 // "scopes": [ 3012 // "https://www.googleapis.com/auth/contacts" 3013 // ] 3014 // } 3015 3016} 3017 3018// method id "people.contactGroups.delete": 3019 3020type ContactGroupsDeleteCall struct { 3021 s *Service 3022 resourceName string 3023 urlParams_ gensupport.URLParams 3024 ctx_ context.Context 3025 header_ http.Header 3026} 3027 3028// Delete: Delete an existing contact group owned by the authenticated 3029// user by 3030// specifying a contact group resource name. 3031func (r *ContactGroupsService) Delete(resourceName string) *ContactGroupsDeleteCall { 3032 c := &ContactGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3033 c.resourceName = resourceName 3034 return c 3035} 3036 3037// DeleteContacts sets the optional parameter "deleteContacts": Set to 3038// true to also delete the contacts in the specified group. 3039func (c *ContactGroupsDeleteCall) DeleteContacts(deleteContacts bool) *ContactGroupsDeleteCall { 3040 c.urlParams_.Set("deleteContacts", fmt.Sprint(deleteContacts)) 3041 return c 3042} 3043 3044// Fields allows partial responses to be retrieved. See 3045// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3046// for more information. 3047func (c *ContactGroupsDeleteCall) Fields(s ...googleapi.Field) *ContactGroupsDeleteCall { 3048 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3049 return c 3050} 3051 3052// Context sets the context to be used in this call's Do method. Any 3053// pending HTTP request will be aborted if the provided context is 3054// canceled. 3055func (c *ContactGroupsDeleteCall) Context(ctx context.Context) *ContactGroupsDeleteCall { 3056 c.ctx_ = ctx 3057 return c 3058} 3059 3060// Header returns an http.Header that can be modified by the caller to 3061// add HTTP headers to the request. 3062func (c *ContactGroupsDeleteCall) Header() http.Header { 3063 if c.header_ == nil { 3064 c.header_ = make(http.Header) 3065 } 3066 return c.header_ 3067} 3068 3069func (c *ContactGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 3070 reqHeaders := make(http.Header) 3071 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3072 for k, v := range c.header_ { 3073 reqHeaders[k] = v 3074 } 3075 reqHeaders.Set("User-Agent", c.s.userAgent()) 3076 var body io.Reader = nil 3077 c.urlParams_.Set("alt", alt) 3078 c.urlParams_.Set("prettyPrint", "false") 3079 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3080 urls += "?" + c.urlParams_.Encode() 3081 req, err := http.NewRequest("DELETE", urls, body) 3082 if err != nil { 3083 return nil, err 3084 } 3085 req.Header = reqHeaders 3086 googleapi.Expand(req.URL, map[string]string{ 3087 "resourceName": c.resourceName, 3088 }) 3089 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3090} 3091 3092// Do executes the "people.contactGroups.delete" call. 3093// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3094// code is an error. Response headers are in either 3095// *Empty.ServerResponse.Header or (if a response was returned at all) 3096// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3097// check whether the returned error was because http.StatusNotModified 3098// was returned. 3099func (c *ContactGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3100 gensupport.SetOptions(c.urlParams_, opts...) 3101 res, err := c.doRequest("json") 3102 if res != nil && res.StatusCode == http.StatusNotModified { 3103 if res.Body != nil { 3104 res.Body.Close() 3105 } 3106 return nil, &googleapi.Error{ 3107 Code: res.StatusCode, 3108 Header: res.Header, 3109 } 3110 } 3111 if err != nil { 3112 return nil, err 3113 } 3114 defer googleapi.CloseBody(res) 3115 if err := googleapi.CheckResponse(res); err != nil { 3116 return nil, err 3117 } 3118 ret := &Empty{ 3119 ServerResponse: googleapi.ServerResponse{ 3120 Header: res.Header, 3121 HTTPStatusCode: res.StatusCode, 3122 }, 3123 } 3124 target := &ret 3125 if err := gensupport.DecodeResponse(target, res); err != nil { 3126 return nil, err 3127 } 3128 return ret, nil 3129 // { 3130 // "description": "Delete an existing contact group owned by the authenticated user by\nspecifying a contact group resource name.", 3131 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3132 // "httpMethod": "DELETE", 3133 // "id": "people.contactGroups.delete", 3134 // "parameterOrder": [ 3135 // "resourceName" 3136 // ], 3137 // "parameters": { 3138 // "deleteContacts": { 3139 // "description": "Optional. Set to true to also delete the contacts in the specified group.", 3140 // "location": "query", 3141 // "type": "boolean" 3142 // }, 3143 // "resourceName": { 3144 // "description": "Required. The resource name of the contact group to delete.", 3145 // "location": "path", 3146 // "pattern": "^contactGroups/[^/]+$", 3147 // "required": true, 3148 // "type": "string" 3149 // } 3150 // }, 3151 // "path": "v1/{+resourceName}", 3152 // "response": { 3153 // "$ref": "Empty" 3154 // }, 3155 // "scopes": [ 3156 // "https://www.googleapis.com/auth/contacts" 3157 // ] 3158 // } 3159 3160} 3161 3162// method id "people.contactGroups.get": 3163 3164type ContactGroupsGetCall struct { 3165 s *Service 3166 resourceName string 3167 urlParams_ gensupport.URLParams 3168 ifNoneMatch_ string 3169 ctx_ context.Context 3170 header_ http.Header 3171} 3172 3173// Get: Get a specific contact group owned by the authenticated user by 3174// specifying 3175// a contact group resource name. 3176func (r *ContactGroupsService) Get(resourceName string) *ContactGroupsGetCall { 3177 c := &ContactGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3178 c.resourceName = resourceName 3179 return c 3180} 3181 3182// MaxMembers sets the optional parameter "maxMembers": Specifies the 3183// maximum number of members to return. Defaults to 0 if not 3184// set, which will return zero members. 3185func (c *ContactGroupsGetCall) MaxMembers(maxMembers int64) *ContactGroupsGetCall { 3186 c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers)) 3187 return c 3188} 3189 3190// Fields allows partial responses to be retrieved. See 3191// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3192// for more information. 3193func (c *ContactGroupsGetCall) Fields(s ...googleapi.Field) *ContactGroupsGetCall { 3194 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3195 return c 3196} 3197 3198// IfNoneMatch sets the optional parameter which makes the operation 3199// fail if the object's ETag matches the given value. This is useful for 3200// getting updates only after the object has changed since the last 3201// request. Use googleapi.IsNotModified to check whether the response 3202// error from Do is the result of In-None-Match. 3203func (c *ContactGroupsGetCall) IfNoneMatch(entityTag string) *ContactGroupsGetCall { 3204 c.ifNoneMatch_ = entityTag 3205 return c 3206} 3207 3208// Context sets the context to be used in this call's Do method. Any 3209// pending HTTP request will be aborted if the provided context is 3210// canceled. 3211func (c *ContactGroupsGetCall) Context(ctx context.Context) *ContactGroupsGetCall { 3212 c.ctx_ = ctx 3213 return c 3214} 3215 3216// Header returns an http.Header that can be modified by the caller to 3217// add HTTP headers to the request. 3218func (c *ContactGroupsGetCall) Header() http.Header { 3219 if c.header_ == nil { 3220 c.header_ = make(http.Header) 3221 } 3222 return c.header_ 3223} 3224 3225func (c *ContactGroupsGetCall) doRequest(alt string) (*http.Response, error) { 3226 reqHeaders := make(http.Header) 3227 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3228 for k, v := range c.header_ { 3229 reqHeaders[k] = v 3230 } 3231 reqHeaders.Set("User-Agent", c.s.userAgent()) 3232 if c.ifNoneMatch_ != "" { 3233 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3234 } 3235 var body io.Reader = nil 3236 c.urlParams_.Set("alt", alt) 3237 c.urlParams_.Set("prettyPrint", "false") 3238 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3239 urls += "?" + c.urlParams_.Encode() 3240 req, err := http.NewRequest("GET", urls, body) 3241 if err != nil { 3242 return nil, err 3243 } 3244 req.Header = reqHeaders 3245 googleapi.Expand(req.URL, map[string]string{ 3246 "resourceName": c.resourceName, 3247 }) 3248 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3249} 3250 3251// Do executes the "people.contactGroups.get" call. 3252// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 3253// status code is an error. Response headers are in either 3254// *ContactGroup.ServerResponse.Header or (if a response was returned at 3255// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3256// to check whether the returned error was because 3257// http.StatusNotModified was returned. 3258func (c *ContactGroupsGetCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 3259 gensupport.SetOptions(c.urlParams_, opts...) 3260 res, err := c.doRequest("json") 3261 if res != nil && res.StatusCode == http.StatusNotModified { 3262 if res.Body != nil { 3263 res.Body.Close() 3264 } 3265 return nil, &googleapi.Error{ 3266 Code: res.StatusCode, 3267 Header: res.Header, 3268 } 3269 } 3270 if err != nil { 3271 return nil, err 3272 } 3273 defer googleapi.CloseBody(res) 3274 if err := googleapi.CheckResponse(res); err != nil { 3275 return nil, err 3276 } 3277 ret := &ContactGroup{ 3278 ServerResponse: googleapi.ServerResponse{ 3279 Header: res.Header, 3280 HTTPStatusCode: res.StatusCode, 3281 }, 3282 } 3283 target := &ret 3284 if err := gensupport.DecodeResponse(target, res); err != nil { 3285 return nil, err 3286 } 3287 return ret, nil 3288 // { 3289 // "description": "Get a specific contact group owned by the authenticated user by specifying\na contact group resource name.", 3290 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3291 // "httpMethod": "GET", 3292 // "id": "people.contactGroups.get", 3293 // "parameterOrder": [ 3294 // "resourceName" 3295 // ], 3296 // "parameters": { 3297 // "maxMembers": { 3298 // "description": "Optional. Specifies the maximum number of members to return. Defaults to 0 if not\nset, which will return zero members.", 3299 // "format": "int32", 3300 // "location": "query", 3301 // "type": "integer" 3302 // }, 3303 // "resourceName": { 3304 // "description": "Required. The resource name of the contact group to get.", 3305 // "location": "path", 3306 // "pattern": "^contactGroups/[^/]+$", 3307 // "required": true, 3308 // "type": "string" 3309 // } 3310 // }, 3311 // "path": "v1/{+resourceName}", 3312 // "response": { 3313 // "$ref": "ContactGroup" 3314 // }, 3315 // "scopes": [ 3316 // "https://www.googleapis.com/auth/contacts", 3317 // "https://www.googleapis.com/auth/contacts.readonly" 3318 // ] 3319 // } 3320 3321} 3322 3323// method id "people.contactGroups.list": 3324 3325type ContactGroupsListCall struct { 3326 s *Service 3327 urlParams_ gensupport.URLParams 3328 ifNoneMatch_ string 3329 ctx_ context.Context 3330 header_ http.Header 3331} 3332 3333// List: List all contact groups owned by the authenticated user. 3334// Members of the 3335// contact groups are not populated. 3336func (r *ContactGroupsService) List() *ContactGroupsListCall { 3337 c := &ContactGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3338 return c 3339} 3340 3341// PageSize sets the optional parameter "pageSize": The maximum number 3342// of resources to return. Valid values are between 1 and 3343// 1000, inclusive. Defaults to 30 if not set or set to 0. 3344func (c *ContactGroupsListCall) PageSize(pageSize int64) *ContactGroupsListCall { 3345 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3346 return c 3347} 3348 3349// PageToken sets the optional parameter "pageToken": The 3350// next_page_token value returned from a previous call 3351// to 3352// [ListContactGroups](/people/api/rest/v1/contactgroups/list). 3353// Reques 3354// ts the next page of resources. 3355func (c *ContactGroupsListCall) PageToken(pageToken string) *ContactGroupsListCall { 3356 c.urlParams_.Set("pageToken", pageToken) 3357 return c 3358} 3359 3360// SyncToken sets the optional parameter "syncToken": A sync token, 3361// returned by a previous call to `contactgroups.list`. 3362// Only resources changed since the sync token was created will be 3363// returned. 3364func (c *ContactGroupsListCall) SyncToken(syncToken string) *ContactGroupsListCall { 3365 c.urlParams_.Set("syncToken", syncToken) 3366 return c 3367} 3368 3369// Fields allows partial responses to be retrieved. See 3370// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3371// for more information. 3372func (c *ContactGroupsListCall) Fields(s ...googleapi.Field) *ContactGroupsListCall { 3373 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3374 return c 3375} 3376 3377// IfNoneMatch sets the optional parameter which makes the operation 3378// fail if the object's ETag matches the given value. This is useful for 3379// getting updates only after the object has changed since the last 3380// request. Use googleapi.IsNotModified to check whether the response 3381// error from Do is the result of In-None-Match. 3382func (c *ContactGroupsListCall) IfNoneMatch(entityTag string) *ContactGroupsListCall { 3383 c.ifNoneMatch_ = entityTag 3384 return c 3385} 3386 3387// Context sets the context to be used in this call's Do method. Any 3388// pending HTTP request will be aborted if the provided context is 3389// canceled. 3390func (c *ContactGroupsListCall) Context(ctx context.Context) *ContactGroupsListCall { 3391 c.ctx_ = ctx 3392 return c 3393} 3394 3395// Header returns an http.Header that can be modified by the caller to 3396// add HTTP headers to the request. 3397func (c *ContactGroupsListCall) Header() http.Header { 3398 if c.header_ == nil { 3399 c.header_ = make(http.Header) 3400 } 3401 return c.header_ 3402} 3403 3404func (c *ContactGroupsListCall) doRequest(alt string) (*http.Response, error) { 3405 reqHeaders := make(http.Header) 3406 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3407 for k, v := range c.header_ { 3408 reqHeaders[k] = v 3409 } 3410 reqHeaders.Set("User-Agent", c.s.userAgent()) 3411 if c.ifNoneMatch_ != "" { 3412 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3413 } 3414 var body io.Reader = nil 3415 c.urlParams_.Set("alt", alt) 3416 c.urlParams_.Set("prettyPrint", "false") 3417 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups") 3418 urls += "?" + c.urlParams_.Encode() 3419 req, err := http.NewRequest("GET", urls, body) 3420 if err != nil { 3421 return nil, err 3422 } 3423 req.Header = reqHeaders 3424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3425} 3426 3427// Do executes the "people.contactGroups.list" call. 3428// Exactly one of *ListContactGroupsResponse or error will be non-nil. 3429// Any non-2xx status code is an error. Response headers are in either 3430// *ListContactGroupsResponse.ServerResponse.Header or (if a response 3431// was returned at all) in error.(*googleapi.Error).Header. Use 3432// googleapi.IsNotModified to check whether the returned error was 3433// because http.StatusNotModified was returned. 3434func (c *ContactGroupsListCall) Do(opts ...googleapi.CallOption) (*ListContactGroupsResponse, error) { 3435 gensupport.SetOptions(c.urlParams_, opts...) 3436 res, err := c.doRequest("json") 3437 if res != nil && res.StatusCode == http.StatusNotModified { 3438 if res.Body != nil { 3439 res.Body.Close() 3440 } 3441 return nil, &googleapi.Error{ 3442 Code: res.StatusCode, 3443 Header: res.Header, 3444 } 3445 } 3446 if err != nil { 3447 return nil, err 3448 } 3449 defer googleapi.CloseBody(res) 3450 if err := googleapi.CheckResponse(res); err != nil { 3451 return nil, err 3452 } 3453 ret := &ListContactGroupsResponse{ 3454 ServerResponse: googleapi.ServerResponse{ 3455 Header: res.Header, 3456 HTTPStatusCode: res.StatusCode, 3457 }, 3458 } 3459 target := &ret 3460 if err := gensupport.DecodeResponse(target, res); err != nil { 3461 return nil, err 3462 } 3463 return ret, nil 3464 // { 3465 // "description": "List all contact groups owned by the authenticated user. Members of the\ncontact groups are not populated.", 3466 // "flatPath": "v1/contactGroups", 3467 // "httpMethod": "GET", 3468 // "id": "people.contactGroups.list", 3469 // "parameterOrder": [], 3470 // "parameters": { 3471 // "pageSize": { 3472 // "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.", 3473 // "format": "int32", 3474 // "location": "query", 3475 // "type": "integer" 3476 // }, 3477 // "pageToken": { 3478 // "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.", 3479 // "location": "query", 3480 // "type": "string" 3481 // }, 3482 // "syncToken": { 3483 // "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.", 3484 // "location": "query", 3485 // "type": "string" 3486 // } 3487 // }, 3488 // "path": "v1/contactGroups", 3489 // "response": { 3490 // "$ref": "ListContactGroupsResponse" 3491 // }, 3492 // "scopes": [ 3493 // "https://www.googleapis.com/auth/contacts", 3494 // "https://www.googleapis.com/auth/contacts.readonly" 3495 // ] 3496 // } 3497 3498} 3499 3500// Pages invokes f for each page of results. 3501// A non-nil error returned from f will halt the iteration. 3502// The provided context supersedes any context provided to the Context method. 3503func (c *ContactGroupsListCall) Pages(ctx context.Context, f func(*ListContactGroupsResponse) error) error { 3504 c.ctx_ = ctx 3505 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3506 for { 3507 x, err := c.Do() 3508 if err != nil { 3509 return err 3510 } 3511 if err := f(x); err != nil { 3512 return err 3513 } 3514 if x.NextPageToken == "" { 3515 return nil 3516 } 3517 c.PageToken(x.NextPageToken) 3518 } 3519} 3520 3521// method id "people.contactGroups.update": 3522 3523type ContactGroupsUpdateCall struct { 3524 s *Service 3525 resourceName string 3526 updatecontactgrouprequest *UpdateContactGroupRequest 3527 urlParams_ gensupport.URLParams 3528 ctx_ context.Context 3529 header_ http.Header 3530} 3531 3532// Update: Update the name of an existing contact group owned by the 3533// authenticated 3534// user. 3535func (r *ContactGroupsService) Update(resourceName string, updatecontactgrouprequest *UpdateContactGroupRequest) *ContactGroupsUpdateCall { 3536 c := &ContactGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3537 c.resourceName = resourceName 3538 c.updatecontactgrouprequest = updatecontactgrouprequest 3539 return c 3540} 3541 3542// Fields allows partial responses to be retrieved. See 3543// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3544// for more information. 3545func (c *ContactGroupsUpdateCall) Fields(s ...googleapi.Field) *ContactGroupsUpdateCall { 3546 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3547 return c 3548} 3549 3550// Context sets the context to be used in this call's Do method. Any 3551// pending HTTP request will be aborted if the provided context is 3552// canceled. 3553func (c *ContactGroupsUpdateCall) Context(ctx context.Context) *ContactGroupsUpdateCall { 3554 c.ctx_ = ctx 3555 return c 3556} 3557 3558// Header returns an http.Header that can be modified by the caller to 3559// add HTTP headers to the request. 3560func (c *ContactGroupsUpdateCall) Header() http.Header { 3561 if c.header_ == nil { 3562 c.header_ = make(http.Header) 3563 } 3564 return c.header_ 3565} 3566 3567func (c *ContactGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 3568 reqHeaders := make(http.Header) 3569 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3570 for k, v := range c.header_ { 3571 reqHeaders[k] = v 3572 } 3573 reqHeaders.Set("User-Agent", c.s.userAgent()) 3574 var body io.Reader = nil 3575 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactgrouprequest) 3576 if err != nil { 3577 return nil, err 3578 } 3579 reqHeaders.Set("Content-Type", "application/json") 3580 c.urlParams_.Set("alt", alt) 3581 c.urlParams_.Set("prettyPrint", "false") 3582 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 3583 urls += "?" + c.urlParams_.Encode() 3584 req, err := http.NewRequest("PUT", urls, body) 3585 if err != nil { 3586 return nil, err 3587 } 3588 req.Header = reqHeaders 3589 googleapi.Expand(req.URL, map[string]string{ 3590 "resourceName": c.resourceName, 3591 }) 3592 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3593} 3594 3595// Do executes the "people.contactGroups.update" call. 3596// Exactly one of *ContactGroup or error will be non-nil. Any non-2xx 3597// status code is an error. Response headers are in either 3598// *ContactGroup.ServerResponse.Header or (if a response was returned at 3599// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3600// to check whether the returned error was because 3601// http.StatusNotModified was returned. 3602func (c *ContactGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) { 3603 gensupport.SetOptions(c.urlParams_, opts...) 3604 res, err := c.doRequest("json") 3605 if res != nil && res.StatusCode == http.StatusNotModified { 3606 if res.Body != nil { 3607 res.Body.Close() 3608 } 3609 return nil, &googleapi.Error{ 3610 Code: res.StatusCode, 3611 Header: res.Header, 3612 } 3613 } 3614 if err != nil { 3615 return nil, err 3616 } 3617 defer googleapi.CloseBody(res) 3618 if err := googleapi.CheckResponse(res); err != nil { 3619 return nil, err 3620 } 3621 ret := &ContactGroup{ 3622 ServerResponse: googleapi.ServerResponse{ 3623 Header: res.Header, 3624 HTTPStatusCode: res.StatusCode, 3625 }, 3626 } 3627 target := &ret 3628 if err := gensupport.DecodeResponse(target, res); err != nil { 3629 return nil, err 3630 } 3631 return ret, nil 3632 // { 3633 // "description": "Update the name of an existing contact group owned by the authenticated\nuser.", 3634 // "flatPath": "v1/contactGroups/{contactGroupsId}", 3635 // "httpMethod": "PUT", 3636 // "id": "people.contactGroups.update", 3637 // "parameterOrder": [ 3638 // "resourceName" 3639 // ], 3640 // "parameters": { 3641 // "resourceName": { 3642 // "description": "The resource name for the contact group, assigned by the server. An ASCII\nstring, in the form of `contactGroups/{contact_group_id}`.", 3643 // "location": "path", 3644 // "pattern": "^contactGroups/[^/]+$", 3645 // "required": true, 3646 // "type": "string" 3647 // } 3648 // }, 3649 // "path": "v1/{+resourceName}", 3650 // "request": { 3651 // "$ref": "UpdateContactGroupRequest" 3652 // }, 3653 // "response": { 3654 // "$ref": "ContactGroup" 3655 // }, 3656 // "scopes": [ 3657 // "https://www.googleapis.com/auth/contacts" 3658 // ] 3659 // } 3660 3661} 3662 3663// method id "people.contactGroups.members.modify": 3664 3665type ContactGroupsMembersModifyCall struct { 3666 s *Service 3667 resourceName string 3668 modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest 3669 urlParams_ gensupport.URLParams 3670 ctx_ context.Context 3671 header_ http.Header 3672} 3673 3674// Modify: Modify the members of a contact group owned by the 3675// authenticated user. 3676// 3677// The only system contact groups that can have members added 3678// are 3679// `contactGroups/myContacts` and `contactGroups/starred`. Other 3680// system 3681// contact groups are deprecated and can only have contacts removed. 3682func (r *ContactGroupsMembersService) Modify(resourceName string, modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest) *ContactGroupsMembersModifyCall { 3683 c := &ContactGroupsMembersModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3684 c.resourceName = resourceName 3685 c.modifycontactgroupmembersrequest = modifycontactgroupmembersrequest 3686 return c 3687} 3688 3689// Fields allows partial responses to be retrieved. See 3690// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3691// for more information. 3692func (c *ContactGroupsMembersModifyCall) Fields(s ...googleapi.Field) *ContactGroupsMembersModifyCall { 3693 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3694 return c 3695} 3696 3697// Context sets the context to be used in this call's Do method. Any 3698// pending HTTP request will be aborted if the provided context is 3699// canceled. 3700func (c *ContactGroupsMembersModifyCall) Context(ctx context.Context) *ContactGroupsMembersModifyCall { 3701 c.ctx_ = ctx 3702 return c 3703} 3704 3705// Header returns an http.Header that can be modified by the caller to 3706// add HTTP headers to the request. 3707func (c *ContactGroupsMembersModifyCall) Header() http.Header { 3708 if c.header_ == nil { 3709 c.header_ = make(http.Header) 3710 } 3711 return c.header_ 3712} 3713 3714func (c *ContactGroupsMembersModifyCall) doRequest(alt string) (*http.Response, error) { 3715 reqHeaders := make(http.Header) 3716 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3717 for k, v := range c.header_ { 3718 reqHeaders[k] = v 3719 } 3720 reqHeaders.Set("User-Agent", c.s.userAgent()) 3721 var body io.Reader = nil 3722 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycontactgroupmembersrequest) 3723 if err != nil { 3724 return nil, err 3725 } 3726 reqHeaders.Set("Content-Type", "application/json") 3727 c.urlParams_.Set("alt", alt) 3728 c.urlParams_.Set("prettyPrint", "false") 3729 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/members:modify") 3730 urls += "?" + c.urlParams_.Encode() 3731 req, err := http.NewRequest("POST", urls, body) 3732 if err != nil { 3733 return nil, err 3734 } 3735 req.Header = reqHeaders 3736 googleapi.Expand(req.URL, map[string]string{ 3737 "resourceName": c.resourceName, 3738 }) 3739 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3740} 3741 3742// Do executes the "people.contactGroups.members.modify" call. 3743// Exactly one of *ModifyContactGroupMembersResponse or error will be 3744// non-nil. Any non-2xx status code is an error. Response headers are in 3745// either *ModifyContactGroupMembersResponse.ServerResponse.Header or 3746// (if a response was returned at all) in 3747// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3748// whether the returned error was because http.StatusNotModified was 3749// returned. 3750func (c *ContactGroupsMembersModifyCall) Do(opts ...googleapi.CallOption) (*ModifyContactGroupMembersResponse, error) { 3751 gensupport.SetOptions(c.urlParams_, opts...) 3752 res, err := c.doRequest("json") 3753 if res != nil && res.StatusCode == http.StatusNotModified { 3754 if res.Body != nil { 3755 res.Body.Close() 3756 } 3757 return nil, &googleapi.Error{ 3758 Code: res.StatusCode, 3759 Header: res.Header, 3760 } 3761 } 3762 if err != nil { 3763 return nil, err 3764 } 3765 defer googleapi.CloseBody(res) 3766 if err := googleapi.CheckResponse(res); err != nil { 3767 return nil, err 3768 } 3769 ret := &ModifyContactGroupMembersResponse{ 3770 ServerResponse: googleapi.ServerResponse{ 3771 Header: res.Header, 3772 HTTPStatusCode: res.StatusCode, 3773 }, 3774 } 3775 target := &ret 3776 if err := gensupport.DecodeResponse(target, res); err != nil { 3777 return nil, err 3778 } 3779 return ret, nil 3780 // { 3781 // "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.", 3782 // "flatPath": "v1/contactGroups/{contactGroupsId}/members:modify", 3783 // "httpMethod": "POST", 3784 // "id": "people.contactGroups.members.modify", 3785 // "parameterOrder": [ 3786 // "resourceName" 3787 // ], 3788 // "parameters": { 3789 // "resourceName": { 3790 // "description": "Required. The resource name of the contact group to modify.", 3791 // "location": "path", 3792 // "pattern": "^contactGroups/[^/]+$", 3793 // "required": true, 3794 // "type": "string" 3795 // } 3796 // }, 3797 // "path": "v1/{+resourceName}/members:modify", 3798 // "request": { 3799 // "$ref": "ModifyContactGroupMembersRequest" 3800 // }, 3801 // "response": { 3802 // "$ref": "ModifyContactGroupMembersResponse" 3803 // }, 3804 // "scopes": [ 3805 // "https://www.googleapis.com/auth/contacts" 3806 // ] 3807 // } 3808 3809} 3810 3811// method id "people.people.createContact": 3812 3813type PeopleCreateContactCall struct { 3814 s *Service 3815 person *Person 3816 urlParams_ gensupport.URLParams 3817 ctx_ context.Context 3818 header_ http.Header 3819} 3820 3821// CreateContact: Create a new contact and return the person resource 3822// for that contact. 3823func (r *PeopleService) CreateContact(person *Person) *PeopleCreateContactCall { 3824 c := &PeopleCreateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3825 c.person = person 3826 return c 3827} 3828 3829// Fields allows partial responses to be retrieved. See 3830// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3831// for more information. 3832func (c *PeopleCreateContactCall) Fields(s ...googleapi.Field) *PeopleCreateContactCall { 3833 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3834 return c 3835} 3836 3837// Context sets the context to be used in this call's Do method. Any 3838// pending HTTP request will be aborted if the provided context is 3839// canceled. 3840func (c *PeopleCreateContactCall) Context(ctx context.Context) *PeopleCreateContactCall { 3841 c.ctx_ = ctx 3842 return c 3843} 3844 3845// Header returns an http.Header that can be modified by the caller to 3846// add HTTP headers to the request. 3847func (c *PeopleCreateContactCall) Header() http.Header { 3848 if c.header_ == nil { 3849 c.header_ = make(http.Header) 3850 } 3851 return c.header_ 3852} 3853 3854func (c *PeopleCreateContactCall) doRequest(alt string) (*http.Response, error) { 3855 reqHeaders := make(http.Header) 3856 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3857 for k, v := range c.header_ { 3858 reqHeaders[k] = v 3859 } 3860 reqHeaders.Set("User-Agent", c.s.userAgent()) 3861 var body io.Reader = nil 3862 body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) 3863 if err != nil { 3864 return nil, err 3865 } 3866 reqHeaders.Set("Content-Type", "application/json") 3867 c.urlParams_.Set("alt", alt) 3868 c.urlParams_.Set("prettyPrint", "false") 3869 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:createContact") 3870 urls += "?" + c.urlParams_.Encode() 3871 req, err := http.NewRequest("POST", urls, body) 3872 if err != nil { 3873 return nil, err 3874 } 3875 req.Header = reqHeaders 3876 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3877} 3878 3879// Do executes the "people.people.createContact" call. 3880// Exactly one of *Person or error will be non-nil. Any non-2xx status 3881// code is an error. Response headers are in either 3882// *Person.ServerResponse.Header or (if a response was returned at all) 3883// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3884// check whether the returned error was because http.StatusNotModified 3885// was returned. 3886func (c *PeopleCreateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) { 3887 gensupport.SetOptions(c.urlParams_, opts...) 3888 res, err := c.doRequest("json") 3889 if res != nil && res.StatusCode == http.StatusNotModified { 3890 if res.Body != nil { 3891 res.Body.Close() 3892 } 3893 return nil, &googleapi.Error{ 3894 Code: res.StatusCode, 3895 Header: res.Header, 3896 } 3897 } 3898 if err != nil { 3899 return nil, err 3900 } 3901 defer googleapi.CloseBody(res) 3902 if err := googleapi.CheckResponse(res); err != nil { 3903 return nil, err 3904 } 3905 ret := &Person{ 3906 ServerResponse: googleapi.ServerResponse{ 3907 Header: res.Header, 3908 HTTPStatusCode: res.StatusCode, 3909 }, 3910 } 3911 target := &ret 3912 if err := gensupport.DecodeResponse(target, res); err != nil { 3913 return nil, err 3914 } 3915 return ret, nil 3916 // { 3917 // "description": "Create a new contact and return the person resource for that contact.", 3918 // "flatPath": "v1/people:createContact", 3919 // "httpMethod": "POST", 3920 // "id": "people.people.createContact", 3921 // "parameterOrder": [], 3922 // "parameters": {}, 3923 // "path": "v1/people:createContact", 3924 // "request": { 3925 // "$ref": "Person" 3926 // }, 3927 // "response": { 3928 // "$ref": "Person" 3929 // }, 3930 // "scopes": [ 3931 // "https://www.googleapis.com/auth/contacts" 3932 // ] 3933 // } 3934 3935} 3936 3937// method id "people.people.deleteContact": 3938 3939type PeopleDeleteContactCall struct { 3940 s *Service 3941 resourceName string 3942 urlParams_ gensupport.URLParams 3943 ctx_ context.Context 3944 header_ http.Header 3945} 3946 3947// DeleteContact: Delete a contact person. Any non-contact data will not 3948// be deleted. 3949func (r *PeopleService) DeleteContact(resourceName string) *PeopleDeleteContactCall { 3950 c := &PeopleDeleteContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3951 c.resourceName = resourceName 3952 return c 3953} 3954 3955// Fields allows partial responses to be retrieved. See 3956// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3957// for more information. 3958func (c *PeopleDeleteContactCall) Fields(s ...googleapi.Field) *PeopleDeleteContactCall { 3959 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3960 return c 3961} 3962 3963// Context sets the context to be used in this call's Do method. Any 3964// pending HTTP request will be aborted if the provided context is 3965// canceled. 3966func (c *PeopleDeleteContactCall) Context(ctx context.Context) *PeopleDeleteContactCall { 3967 c.ctx_ = ctx 3968 return c 3969} 3970 3971// Header returns an http.Header that can be modified by the caller to 3972// add HTTP headers to the request. 3973func (c *PeopleDeleteContactCall) Header() http.Header { 3974 if c.header_ == nil { 3975 c.header_ = make(http.Header) 3976 } 3977 return c.header_ 3978} 3979 3980func (c *PeopleDeleteContactCall) doRequest(alt string) (*http.Response, error) { 3981 reqHeaders := make(http.Header) 3982 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 3983 for k, v := range c.header_ { 3984 reqHeaders[k] = v 3985 } 3986 reqHeaders.Set("User-Agent", c.s.userAgent()) 3987 var body io.Reader = nil 3988 c.urlParams_.Set("alt", alt) 3989 c.urlParams_.Set("prettyPrint", "false") 3990 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContact") 3991 urls += "?" + c.urlParams_.Encode() 3992 req, err := http.NewRequest("DELETE", urls, body) 3993 if err != nil { 3994 return nil, err 3995 } 3996 req.Header = reqHeaders 3997 googleapi.Expand(req.URL, map[string]string{ 3998 "resourceName": c.resourceName, 3999 }) 4000 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4001} 4002 4003// Do executes the "people.people.deleteContact" call. 4004// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4005// code is an error. Response headers are in either 4006// *Empty.ServerResponse.Header or (if a response was returned at all) 4007// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4008// check whether the returned error was because http.StatusNotModified 4009// was returned. 4010func (c *PeopleDeleteContactCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4011 gensupport.SetOptions(c.urlParams_, opts...) 4012 res, err := c.doRequest("json") 4013 if res != nil && res.StatusCode == http.StatusNotModified { 4014 if res.Body != nil { 4015 res.Body.Close() 4016 } 4017 return nil, &googleapi.Error{ 4018 Code: res.StatusCode, 4019 Header: res.Header, 4020 } 4021 } 4022 if err != nil { 4023 return nil, err 4024 } 4025 defer googleapi.CloseBody(res) 4026 if err := googleapi.CheckResponse(res); err != nil { 4027 return nil, err 4028 } 4029 ret := &Empty{ 4030 ServerResponse: googleapi.ServerResponse{ 4031 Header: res.Header, 4032 HTTPStatusCode: res.StatusCode, 4033 }, 4034 } 4035 target := &ret 4036 if err := gensupport.DecodeResponse(target, res); err != nil { 4037 return nil, err 4038 } 4039 return ret, nil 4040 // { 4041 // "description": "Delete a contact person. Any non-contact data will not be deleted.", 4042 // "flatPath": "v1/people/{peopleId}:deleteContact", 4043 // "httpMethod": "DELETE", 4044 // "id": "people.people.deleteContact", 4045 // "parameterOrder": [ 4046 // "resourceName" 4047 // ], 4048 // "parameters": { 4049 // "resourceName": { 4050 // "description": "Required. The resource name of the contact to delete.", 4051 // "location": "path", 4052 // "pattern": "^people/[^/]+$", 4053 // "required": true, 4054 // "type": "string" 4055 // } 4056 // }, 4057 // "path": "v1/{+resourceName}:deleteContact", 4058 // "response": { 4059 // "$ref": "Empty" 4060 // }, 4061 // "scopes": [ 4062 // "https://www.googleapis.com/auth/contacts" 4063 // ] 4064 // } 4065 4066} 4067 4068// method id "people.people.deleteContactPhoto": 4069 4070type PeopleDeleteContactPhotoCall struct { 4071 s *Service 4072 resourceName string 4073 urlParams_ gensupport.URLParams 4074 ctx_ context.Context 4075 header_ http.Header 4076} 4077 4078// DeleteContactPhoto: Delete a contact's photo. 4079func (r *PeopleService) DeleteContactPhoto(resourceName string) *PeopleDeleteContactPhotoCall { 4080 c := &PeopleDeleteContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4081 c.resourceName = resourceName 4082 return c 4083} 4084 4085// PersonFields sets the optional parameter "personFields": A field mask 4086// to restrict which fields on the person are returned. Multiple 4087// fields can be specified by separating them with commas. Defaults to 4088// empty 4089// if not set, which will skip the post mutate get. Valid values are: 4090// 4091// * addresses 4092// * ageRanges 4093// * biographies 4094// * birthdays 4095// * coverPhotos 4096// * emailAddresses 4097// * events 4098// * genders 4099// * imClients 4100// * interests 4101// * locales 4102// * memberships 4103// * metadata 4104// * names 4105// * nicknames 4106// * occupations 4107// * organizations 4108// * phoneNumbers 4109// * photos 4110// * relations 4111// * residences 4112// * sipAddresses 4113// * skills 4114// * urls 4115// * userDefined 4116func (c *PeopleDeleteContactPhotoCall) PersonFields(personFields string) *PeopleDeleteContactPhotoCall { 4117 c.urlParams_.Set("personFields", personFields) 4118 return c 4119} 4120 4121// Fields allows partial responses to be retrieved. See 4122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4123// for more information. 4124func (c *PeopleDeleteContactPhotoCall) Fields(s ...googleapi.Field) *PeopleDeleteContactPhotoCall { 4125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4126 return c 4127} 4128 4129// Context sets the context to be used in this call's Do method. Any 4130// pending HTTP request will be aborted if the provided context is 4131// canceled. 4132func (c *PeopleDeleteContactPhotoCall) Context(ctx context.Context) *PeopleDeleteContactPhotoCall { 4133 c.ctx_ = ctx 4134 return c 4135} 4136 4137// Header returns an http.Header that can be modified by the caller to 4138// add HTTP headers to the request. 4139func (c *PeopleDeleteContactPhotoCall) Header() http.Header { 4140 if c.header_ == nil { 4141 c.header_ = make(http.Header) 4142 } 4143 return c.header_ 4144} 4145 4146func (c *PeopleDeleteContactPhotoCall) doRequest(alt string) (*http.Response, error) { 4147 reqHeaders := make(http.Header) 4148 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 4149 for k, v := range c.header_ { 4150 reqHeaders[k] = v 4151 } 4152 reqHeaders.Set("User-Agent", c.s.userAgent()) 4153 var body io.Reader = nil 4154 c.urlParams_.Set("alt", alt) 4155 c.urlParams_.Set("prettyPrint", "false") 4156 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContactPhoto") 4157 urls += "?" + c.urlParams_.Encode() 4158 req, err := http.NewRequest("DELETE", urls, body) 4159 if err != nil { 4160 return nil, err 4161 } 4162 req.Header = reqHeaders 4163 googleapi.Expand(req.URL, map[string]string{ 4164 "resourceName": c.resourceName, 4165 }) 4166 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4167} 4168 4169// Do executes the "people.people.deleteContactPhoto" call. 4170// Exactly one of *DeleteContactPhotoResponse or error will be non-nil. 4171// Any non-2xx status code is an error. Response headers are in either 4172// *DeleteContactPhotoResponse.ServerResponse.Header or (if a response 4173// was returned at all) in error.(*googleapi.Error).Header. Use 4174// googleapi.IsNotModified to check whether the returned error was 4175// because http.StatusNotModified was returned. 4176func (c *PeopleDeleteContactPhotoCall) Do(opts ...googleapi.CallOption) (*DeleteContactPhotoResponse, error) { 4177 gensupport.SetOptions(c.urlParams_, opts...) 4178 res, err := c.doRequest("json") 4179 if res != nil && res.StatusCode == http.StatusNotModified { 4180 if res.Body != nil { 4181 res.Body.Close() 4182 } 4183 return nil, &googleapi.Error{ 4184 Code: res.StatusCode, 4185 Header: res.Header, 4186 } 4187 } 4188 if err != nil { 4189 return nil, err 4190 } 4191 defer googleapi.CloseBody(res) 4192 if err := googleapi.CheckResponse(res); err != nil { 4193 return nil, err 4194 } 4195 ret := &DeleteContactPhotoResponse{ 4196 ServerResponse: googleapi.ServerResponse{ 4197 Header: res.Header, 4198 HTTPStatusCode: res.StatusCode, 4199 }, 4200 } 4201 target := &ret 4202 if err := gensupport.DecodeResponse(target, res); err != nil { 4203 return nil, err 4204 } 4205 return ret, nil 4206 // { 4207 // "description": "Delete a contact's photo.", 4208 // "flatPath": "v1/people/{peopleId}:deleteContactPhoto", 4209 // "httpMethod": "DELETE", 4210 // "id": "people.people.deleteContactPhoto", 4211 // "parameterOrder": [ 4212 // "resourceName" 4213 // ], 4214 // "parameters": { 4215 // "personFields": { 4216 // "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", 4217 // "format": "google-fieldmask", 4218 // "location": "query", 4219 // "type": "string" 4220 // }, 4221 // "resourceName": { 4222 // "description": "Required. The resource name of the contact whose photo will be deleted.", 4223 // "location": "path", 4224 // "pattern": "^people/[^/]+$", 4225 // "required": true, 4226 // "type": "string" 4227 // } 4228 // }, 4229 // "path": "v1/{+resourceName}:deleteContactPhoto", 4230 // "response": { 4231 // "$ref": "DeleteContactPhotoResponse" 4232 // }, 4233 // "scopes": [ 4234 // "https://www.googleapis.com/auth/contacts" 4235 // ] 4236 // } 4237 4238} 4239 4240// method id "people.people.get": 4241 4242type PeopleGetCall struct { 4243 s *Service 4244 resourceName string 4245 urlParams_ gensupport.URLParams 4246 ifNoneMatch_ string 4247 ctx_ context.Context 4248 header_ http.Header 4249} 4250 4251// Get: Provides information about a person by specifying a resource 4252// name. Use 4253// `people/me` to indicate the authenticated user. 4254// 4255// The request throws a 400 error if 'personFields' is not specified. 4256func (r *PeopleService) Get(resourceName string) *PeopleGetCall { 4257 c := &PeopleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4258 c.resourceName = resourceName 4259 return c 4260} 4261 4262// PersonFields sets the optional parameter "personFields": Required. A 4263// field mask to restrict which fields on the person are returned. 4264// Multiple 4265// fields can be specified by separating them with commas. Valid values 4266// are: 4267// 4268// * addresses 4269// * ageRanges 4270// * biographies 4271// * birthdays 4272// * coverPhotos 4273// * emailAddresses 4274// * events 4275// * genders 4276// * imClients 4277// * interests 4278// * locales 4279// * memberships 4280// * metadata 4281// * names 4282// * nicknames 4283// * occupations 4284// * organizations 4285// * phoneNumbers 4286// * photos 4287// * relations 4288// * residences 4289// * sipAddresses 4290// * skills 4291// * urls 4292// * userDefined 4293func (c *PeopleGetCall) PersonFields(personFields string) *PeopleGetCall { 4294 c.urlParams_.Set("personFields", personFields) 4295 return c 4296} 4297 4298// RequestMaskIncludeField sets the optional parameter 4299// "requestMask.includeField": Required. Comma-separated list of person 4300// fields to be included in the response. Each 4301// path should start with `person.`: for example, `person.names` 4302// or 4303// `person.photos`. 4304func (c *PeopleGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetCall { 4305 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 4306 return c 4307} 4308 4309// Fields allows partial responses to be retrieved. See 4310// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4311// for more information. 4312func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall { 4313 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4314 return c 4315} 4316 4317// IfNoneMatch sets the optional parameter which makes the operation 4318// fail if the object's ETag matches the given value. This is useful for 4319// getting updates only after the object has changed since the last 4320// request. Use googleapi.IsNotModified to check whether the response 4321// error from Do is the result of In-None-Match. 4322func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall { 4323 c.ifNoneMatch_ = entityTag 4324 return c 4325} 4326 4327// Context sets the context to be used in this call's Do method. Any 4328// pending HTTP request will be aborted if the provided context is 4329// canceled. 4330func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall { 4331 c.ctx_ = ctx 4332 return c 4333} 4334 4335// Header returns an http.Header that can be modified by the caller to 4336// add HTTP headers to the request. 4337func (c *PeopleGetCall) Header() http.Header { 4338 if c.header_ == nil { 4339 c.header_ = make(http.Header) 4340 } 4341 return c.header_ 4342} 4343 4344func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) { 4345 reqHeaders := make(http.Header) 4346 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 4347 for k, v := range c.header_ { 4348 reqHeaders[k] = v 4349 } 4350 reqHeaders.Set("User-Agent", c.s.userAgent()) 4351 if c.ifNoneMatch_ != "" { 4352 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4353 } 4354 var body io.Reader = nil 4355 c.urlParams_.Set("alt", alt) 4356 c.urlParams_.Set("prettyPrint", "false") 4357 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 4358 urls += "?" + c.urlParams_.Encode() 4359 req, err := http.NewRequest("GET", urls, body) 4360 if err != nil { 4361 return nil, err 4362 } 4363 req.Header = reqHeaders 4364 googleapi.Expand(req.URL, map[string]string{ 4365 "resourceName": c.resourceName, 4366 }) 4367 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4368} 4369 4370// Do executes the "people.people.get" call. 4371// Exactly one of *Person or error will be non-nil. Any non-2xx status 4372// code is an error. Response headers are in either 4373// *Person.ServerResponse.Header or (if a response was returned at all) 4374// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4375// check whether the returned error was because http.StatusNotModified 4376// was returned. 4377func (c *PeopleGetCall) Do(opts ...googleapi.CallOption) (*Person, error) { 4378 gensupport.SetOptions(c.urlParams_, opts...) 4379 res, err := c.doRequest("json") 4380 if res != nil && res.StatusCode == http.StatusNotModified { 4381 if res.Body != nil { 4382 res.Body.Close() 4383 } 4384 return nil, &googleapi.Error{ 4385 Code: res.StatusCode, 4386 Header: res.Header, 4387 } 4388 } 4389 if err != nil { 4390 return nil, err 4391 } 4392 defer googleapi.CloseBody(res) 4393 if err := googleapi.CheckResponse(res); err != nil { 4394 return nil, err 4395 } 4396 ret := &Person{ 4397 ServerResponse: googleapi.ServerResponse{ 4398 Header: res.Header, 4399 HTTPStatusCode: res.StatusCode, 4400 }, 4401 } 4402 target := &ret 4403 if err := gensupport.DecodeResponse(target, res); err != nil { 4404 return nil, err 4405 } 4406 return ret, nil 4407 // { 4408 // "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.", 4409 // "flatPath": "v1/people/{peopleId}", 4410 // "httpMethod": "GET", 4411 // "id": "people.people.get", 4412 // "parameterOrder": [ 4413 // "resourceName" 4414 // ], 4415 // "parameters": { 4416 // "personFields": { 4417 // "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", 4418 // "format": "google-fieldmask", 4419 // "location": "query", 4420 // "type": "string" 4421 // }, 4422 // "requestMask.includeField": { 4423 // "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`.", 4424 // "format": "google-fieldmask", 4425 // "location": "query", 4426 // "type": "string" 4427 // }, 4428 // "resourceName": { 4429 // "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).", 4430 // "location": "path", 4431 // "pattern": "^people/[^/]+$", 4432 // "required": true, 4433 // "type": "string" 4434 // } 4435 // }, 4436 // "path": "v1/{+resourceName}", 4437 // "response": { 4438 // "$ref": "Person" 4439 // }, 4440 // "scopes": [ 4441 // "https://www.googleapis.com/auth/contacts", 4442 // "https://www.googleapis.com/auth/contacts.readonly", 4443 // "https://www.googleapis.com/auth/directory.readonly", 4444 // "https://www.googleapis.com/auth/user.addresses.read", 4445 // "https://www.googleapis.com/auth/user.birthday.read", 4446 // "https://www.googleapis.com/auth/user.emails.read", 4447 // "https://www.googleapis.com/auth/user.gender.read", 4448 // "https://www.googleapis.com/auth/user.organization.read", 4449 // "https://www.googleapis.com/auth/user.phonenumbers.read", 4450 // "https://www.googleapis.com/auth/userinfo.email", 4451 // "https://www.googleapis.com/auth/userinfo.profile" 4452 // ] 4453 // } 4454 4455} 4456 4457// method id "people.people.getBatchGet": 4458 4459type PeopleGetBatchGetCall struct { 4460 s *Service 4461 urlParams_ gensupport.URLParams 4462 ifNoneMatch_ string 4463 ctx_ context.Context 4464 header_ http.Header 4465} 4466 4467// GetBatchGet: Provides information about a list of specific people by 4468// specifying a list 4469// of requested resource names. Use `people/me` to indicate the 4470// authenticated 4471// user. 4472// 4473// The request throws a 400 error if 'personFields' is not specified. 4474func (r *PeopleService) GetBatchGet() *PeopleGetBatchGetCall { 4475 c := &PeopleGetBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4476 return c 4477} 4478 4479// PersonFields sets the optional parameter "personFields": Required. A 4480// field mask to restrict which fields on each person are returned. 4481// Multiple 4482// fields can be specified by separating them with commas. Valid values 4483// are: 4484// 4485// * addresses 4486// * ageRanges 4487// * biographies 4488// * birthdays 4489// * coverPhotos 4490// * emailAddresses 4491// * events 4492// * genders 4493// * imClients 4494// * interests 4495// * locales 4496// * memberships 4497// * metadata 4498// * names 4499// * nicknames 4500// * occupations 4501// * organizations 4502// * phoneNumbers 4503// * photos 4504// * relations 4505// * residences 4506// * sipAddresses 4507// * skills 4508// * urls 4509// * userDefined 4510func (c *PeopleGetBatchGetCall) PersonFields(personFields string) *PeopleGetBatchGetCall { 4511 c.urlParams_.Set("personFields", personFields) 4512 return c 4513} 4514 4515// RequestMaskIncludeField sets the optional parameter 4516// "requestMask.includeField": Required. Comma-separated list of person 4517// fields to be included in the response. Each 4518// path should start with `person.`: for example, `person.names` 4519// or 4520// `person.photos`. 4521func (c *PeopleGetBatchGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetBatchGetCall { 4522 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 4523 return c 4524} 4525 4526// ResourceNames sets the optional parameter "resourceNames": Required. 4527// The resource names of the people to provide information about. 4528// 4529// - To get information about the authenticated user, specify 4530// `people/me`. 4531// - To get information about a google account, specify 4532// `people/{account_id}`. 4533// - To get information about a contact, specify the resource name that 4534// identifies the contact as returned 4535// by 4536// [`people.connections.list`](/people/api/rest/v1/people.connections/ 4537// list). 4538// 4539// You can include up to 50 resource names in one request. 4540func (c *PeopleGetBatchGetCall) ResourceNames(resourceNames ...string) *PeopleGetBatchGetCall { 4541 c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) 4542 return c 4543} 4544 4545// Fields allows partial responses to be retrieved. See 4546// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4547// for more information. 4548func (c *PeopleGetBatchGetCall) Fields(s ...googleapi.Field) *PeopleGetBatchGetCall { 4549 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4550 return c 4551} 4552 4553// IfNoneMatch sets the optional parameter which makes the operation 4554// fail if the object's ETag matches the given value. This is useful for 4555// getting updates only after the object has changed since the last 4556// request. Use googleapi.IsNotModified to check whether the response 4557// error from Do is the result of In-None-Match. 4558func (c *PeopleGetBatchGetCall) IfNoneMatch(entityTag string) *PeopleGetBatchGetCall { 4559 c.ifNoneMatch_ = entityTag 4560 return c 4561} 4562 4563// Context sets the context to be used in this call's Do method. Any 4564// pending HTTP request will be aborted if the provided context is 4565// canceled. 4566func (c *PeopleGetBatchGetCall) Context(ctx context.Context) *PeopleGetBatchGetCall { 4567 c.ctx_ = ctx 4568 return c 4569} 4570 4571// Header returns an http.Header that can be modified by the caller to 4572// add HTTP headers to the request. 4573func (c *PeopleGetBatchGetCall) Header() http.Header { 4574 if c.header_ == nil { 4575 c.header_ = make(http.Header) 4576 } 4577 return c.header_ 4578} 4579 4580func (c *PeopleGetBatchGetCall) doRequest(alt string) (*http.Response, error) { 4581 reqHeaders := make(http.Header) 4582 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 4583 for k, v := range c.header_ { 4584 reqHeaders[k] = v 4585 } 4586 reqHeaders.Set("User-Agent", c.s.userAgent()) 4587 if c.ifNoneMatch_ != "" { 4588 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4589 } 4590 var body io.Reader = nil 4591 c.urlParams_.Set("alt", alt) 4592 c.urlParams_.Set("prettyPrint", "false") 4593 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchGet") 4594 urls += "?" + c.urlParams_.Encode() 4595 req, err := http.NewRequest("GET", urls, body) 4596 if err != nil { 4597 return nil, err 4598 } 4599 req.Header = reqHeaders 4600 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4601} 4602 4603// Do executes the "people.people.getBatchGet" call. 4604// Exactly one of *GetPeopleResponse or error will be non-nil. Any 4605// non-2xx status code is an error. Response headers are in either 4606// *GetPeopleResponse.ServerResponse.Header or (if a response was 4607// returned at all) in error.(*googleapi.Error).Header. Use 4608// googleapi.IsNotModified to check whether the returned error was 4609// because http.StatusNotModified was returned. 4610func (c *PeopleGetBatchGetCall) Do(opts ...googleapi.CallOption) (*GetPeopleResponse, error) { 4611 gensupport.SetOptions(c.urlParams_, opts...) 4612 res, err := c.doRequest("json") 4613 if res != nil && res.StatusCode == http.StatusNotModified { 4614 if res.Body != nil { 4615 res.Body.Close() 4616 } 4617 return nil, &googleapi.Error{ 4618 Code: res.StatusCode, 4619 Header: res.Header, 4620 } 4621 } 4622 if err != nil { 4623 return nil, err 4624 } 4625 defer googleapi.CloseBody(res) 4626 if err := googleapi.CheckResponse(res); err != nil { 4627 return nil, err 4628 } 4629 ret := &GetPeopleResponse{ 4630 ServerResponse: googleapi.ServerResponse{ 4631 Header: res.Header, 4632 HTTPStatusCode: res.StatusCode, 4633 }, 4634 } 4635 target := &ret 4636 if err := gensupport.DecodeResponse(target, res); err != nil { 4637 return nil, err 4638 } 4639 return ret, nil 4640 // { 4641 // "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.", 4642 // "flatPath": "v1/people:batchGet", 4643 // "httpMethod": "GET", 4644 // "id": "people.people.getBatchGet", 4645 // "parameterOrder": [], 4646 // "parameters": { 4647 // "personFields": { 4648 // "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", 4649 // "format": "google-fieldmask", 4650 // "location": "query", 4651 // "type": "string" 4652 // }, 4653 // "requestMask.includeField": { 4654 // "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`.", 4655 // "format": "google-fieldmask", 4656 // "location": "query", 4657 // "type": "string" 4658 // }, 4659 // "resourceNames": { 4660 // "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.", 4661 // "location": "query", 4662 // "repeated": true, 4663 // "type": "string" 4664 // } 4665 // }, 4666 // "path": "v1/people:batchGet", 4667 // "response": { 4668 // "$ref": "GetPeopleResponse" 4669 // }, 4670 // "scopes": [ 4671 // "https://www.googleapis.com/auth/contacts", 4672 // "https://www.googleapis.com/auth/contacts.readonly", 4673 // "https://www.googleapis.com/auth/directory.readonly", 4674 // "https://www.googleapis.com/auth/user.addresses.read", 4675 // "https://www.googleapis.com/auth/user.birthday.read", 4676 // "https://www.googleapis.com/auth/user.emails.read", 4677 // "https://www.googleapis.com/auth/user.gender.read", 4678 // "https://www.googleapis.com/auth/user.organization.read", 4679 // "https://www.googleapis.com/auth/user.phonenumbers.read", 4680 // "https://www.googleapis.com/auth/userinfo.email", 4681 // "https://www.googleapis.com/auth/userinfo.profile" 4682 // ] 4683 // } 4684 4685} 4686 4687// method id "people.people.updateContact": 4688 4689type PeopleUpdateContactCall struct { 4690 s *Service 4691 resourceName string 4692 person *Person 4693 urlParams_ gensupport.URLParams 4694 ctx_ context.Context 4695 header_ http.Header 4696} 4697 4698// UpdateContact: Update contact data for an existing contact person. 4699// Any non-contact data 4700// will not be modified. 4701// 4702// The request throws a 400 error if `updatePersonFields` is not 4703// specified. 4704// 4705// The request throws a 400 error if `person.metadata.sources` is 4706// not 4707// specified for the contact to be updated. 4708// 4709// The request throws a 400 error with an error with 4710// reason 4711// "failedPrecondition" if `person.metadata.sources.etag` is different 4712// than 4713// the contact's etag, which indicates the contact has changed since its 4714// data 4715// was read. Clients should get the latest person and re-apply their 4716// updates 4717// to the latest person. 4718func (r *PeopleService) UpdateContact(resourceName string, person *Person) *PeopleUpdateContactCall { 4719 c := &PeopleUpdateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4720 c.resourceName = resourceName 4721 c.person = person 4722 return c 4723} 4724 4725// UpdatePersonFields sets the optional parameter "updatePersonFields": 4726// Required. A field mask to restrict which fields on the person are 4727// updated. Multiple 4728// fields can be specified by separating them with commas. 4729// All updated fields will be replaced. Valid values are: 4730// 4731// * addresses 4732// * biographies 4733// * birthdays 4734// * emailAddresses 4735// * events 4736// * genders 4737// * imClients 4738// * interests 4739// * locales 4740// * memberships 4741// * names 4742// * nicknames 4743// * occupations 4744// * organizations 4745// * phoneNumbers 4746// * relations 4747// * residences 4748// * sipAddresses 4749// * urls 4750// * userDefined 4751func (c *PeopleUpdateContactCall) UpdatePersonFields(updatePersonFields string) *PeopleUpdateContactCall { 4752 c.urlParams_.Set("updatePersonFields", updatePersonFields) 4753 return c 4754} 4755 4756// Fields allows partial responses to be retrieved. See 4757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4758// for more information. 4759func (c *PeopleUpdateContactCall) Fields(s ...googleapi.Field) *PeopleUpdateContactCall { 4760 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4761 return c 4762} 4763 4764// Context sets the context to be used in this call's Do method. Any 4765// pending HTTP request will be aborted if the provided context is 4766// canceled. 4767func (c *PeopleUpdateContactCall) Context(ctx context.Context) *PeopleUpdateContactCall { 4768 c.ctx_ = ctx 4769 return c 4770} 4771 4772// Header returns an http.Header that can be modified by the caller to 4773// add HTTP headers to the request. 4774func (c *PeopleUpdateContactCall) Header() http.Header { 4775 if c.header_ == nil { 4776 c.header_ = make(http.Header) 4777 } 4778 return c.header_ 4779} 4780 4781func (c *PeopleUpdateContactCall) doRequest(alt string) (*http.Response, error) { 4782 reqHeaders := make(http.Header) 4783 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 4784 for k, v := range c.header_ { 4785 reqHeaders[k] = v 4786 } 4787 reqHeaders.Set("User-Agent", c.s.userAgent()) 4788 var body io.Reader = nil 4789 body, err := googleapi.WithoutDataWrapper.JSONReader(c.person) 4790 if err != nil { 4791 return nil, err 4792 } 4793 reqHeaders.Set("Content-Type", "application/json") 4794 c.urlParams_.Set("alt", alt) 4795 c.urlParams_.Set("prettyPrint", "false") 4796 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContact") 4797 urls += "?" + c.urlParams_.Encode() 4798 req, err := http.NewRequest("PATCH", urls, body) 4799 if err != nil { 4800 return nil, err 4801 } 4802 req.Header = reqHeaders 4803 googleapi.Expand(req.URL, map[string]string{ 4804 "resourceName": c.resourceName, 4805 }) 4806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4807} 4808 4809// Do executes the "people.people.updateContact" call. 4810// Exactly one of *Person or error will be non-nil. Any non-2xx status 4811// code is an error. Response headers are in either 4812// *Person.ServerResponse.Header or (if a response was returned at all) 4813// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4814// check whether the returned error was because http.StatusNotModified 4815// was returned. 4816func (c *PeopleUpdateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) { 4817 gensupport.SetOptions(c.urlParams_, opts...) 4818 res, err := c.doRequest("json") 4819 if res != nil && res.StatusCode == http.StatusNotModified { 4820 if res.Body != nil { 4821 res.Body.Close() 4822 } 4823 return nil, &googleapi.Error{ 4824 Code: res.StatusCode, 4825 Header: res.Header, 4826 } 4827 } 4828 if err != nil { 4829 return nil, err 4830 } 4831 defer googleapi.CloseBody(res) 4832 if err := googleapi.CheckResponse(res); err != nil { 4833 return nil, err 4834 } 4835 ret := &Person{ 4836 ServerResponse: googleapi.ServerResponse{ 4837 Header: res.Header, 4838 HTTPStatusCode: res.StatusCode, 4839 }, 4840 } 4841 target := &ret 4842 if err := gensupport.DecodeResponse(target, res); err != nil { 4843 return nil, err 4844 } 4845 return ret, nil 4846 // { 4847 // "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.", 4848 // "flatPath": "v1/people/{peopleId}:updateContact", 4849 // "httpMethod": "PATCH", 4850 // "id": "people.people.updateContact", 4851 // "parameterOrder": [ 4852 // "resourceName" 4853 // ], 4854 // "parameters": { 4855 // "resourceName": { 4856 // "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}`.", 4857 // "location": "path", 4858 // "pattern": "^people/[^/]+$", 4859 // "required": true, 4860 // "type": "string" 4861 // }, 4862 // "updatePersonFields": { 4863 // "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", 4864 // "format": "google-fieldmask", 4865 // "location": "query", 4866 // "type": "string" 4867 // } 4868 // }, 4869 // "path": "v1/{+resourceName}:updateContact", 4870 // "request": { 4871 // "$ref": "Person" 4872 // }, 4873 // "response": { 4874 // "$ref": "Person" 4875 // }, 4876 // "scopes": [ 4877 // "https://www.googleapis.com/auth/contacts" 4878 // ] 4879 // } 4880 4881} 4882 4883// method id "people.people.updateContactPhoto": 4884 4885type PeopleUpdateContactPhotoCall struct { 4886 s *Service 4887 resourceName string 4888 updatecontactphotorequest *UpdateContactPhotoRequest 4889 urlParams_ gensupport.URLParams 4890 ctx_ context.Context 4891 header_ http.Header 4892} 4893 4894// UpdateContactPhoto: Update a contact's photo. 4895func (r *PeopleService) UpdateContactPhoto(resourceName string, updatecontactphotorequest *UpdateContactPhotoRequest) *PeopleUpdateContactPhotoCall { 4896 c := &PeopleUpdateContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4897 c.resourceName = resourceName 4898 c.updatecontactphotorequest = updatecontactphotorequest 4899 return c 4900} 4901 4902// Fields allows partial responses to be retrieved. See 4903// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4904// for more information. 4905func (c *PeopleUpdateContactPhotoCall) Fields(s ...googleapi.Field) *PeopleUpdateContactPhotoCall { 4906 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4907 return c 4908} 4909 4910// Context sets the context to be used in this call's Do method. Any 4911// pending HTTP request will be aborted if the provided context is 4912// canceled. 4913func (c *PeopleUpdateContactPhotoCall) Context(ctx context.Context) *PeopleUpdateContactPhotoCall { 4914 c.ctx_ = ctx 4915 return c 4916} 4917 4918// Header returns an http.Header that can be modified by the caller to 4919// add HTTP headers to the request. 4920func (c *PeopleUpdateContactPhotoCall) Header() http.Header { 4921 if c.header_ == nil { 4922 c.header_ = make(http.Header) 4923 } 4924 return c.header_ 4925} 4926 4927func (c *PeopleUpdateContactPhotoCall) doRequest(alt string) (*http.Response, error) { 4928 reqHeaders := make(http.Header) 4929 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 4930 for k, v := range c.header_ { 4931 reqHeaders[k] = v 4932 } 4933 reqHeaders.Set("User-Agent", c.s.userAgent()) 4934 var body io.Reader = nil 4935 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactphotorequest) 4936 if err != nil { 4937 return nil, err 4938 } 4939 reqHeaders.Set("Content-Type", "application/json") 4940 c.urlParams_.Set("alt", alt) 4941 c.urlParams_.Set("prettyPrint", "false") 4942 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContactPhoto") 4943 urls += "?" + c.urlParams_.Encode() 4944 req, err := http.NewRequest("PATCH", 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.updateContactPhoto" call. 4956// Exactly one of *UpdateContactPhotoResponse or error will be non-nil. 4957// Any non-2xx status code is an error. Response headers are in either 4958// *UpdateContactPhotoResponse.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 *PeopleUpdateContactPhotoCall) Do(opts ...googleapi.CallOption) (*UpdateContactPhotoResponse, 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 := &UpdateContactPhotoResponse{ 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": "Update a contact's photo.", 4994 // "flatPath": "v1/people/{peopleId}:updateContactPhoto", 4995 // "httpMethod": "PATCH", 4996 // "id": "people.people.updateContactPhoto", 4997 // "parameterOrder": [ 4998 // "resourceName" 4999 // ], 5000 // "parameters": { 5001 // "resourceName": { 5002 // "description": "Required. Person resource name", 5003 // "location": "path", 5004 // "pattern": "^people/[^/]+$", 5005 // "required": true, 5006 // "type": "string" 5007 // } 5008 // }, 5009 // "path": "v1/{+resourceName}:updateContactPhoto", 5010 // "request": { 5011 // "$ref": "UpdateContactPhotoRequest" 5012 // }, 5013 // "response": { 5014 // "$ref": "UpdateContactPhotoResponse" 5015 // }, 5016 // "scopes": [ 5017 // "https://www.googleapis.com/auth/contacts" 5018 // ] 5019 // } 5020 5021} 5022 5023// method id "people.people.connections.list": 5024 5025type PeopleConnectionsListCall struct { 5026 s *Service 5027 resourceName string 5028 urlParams_ gensupport.URLParams 5029 ifNoneMatch_ string 5030 ctx_ context.Context 5031 header_ http.Header 5032} 5033 5034// List: Provides a list of the authenticated user's contacts merged 5035// with any 5036// connected profiles. 5037// 5038// The request throws a 400 error if 'personFields' is not specified. 5039func (r *PeopleConnectionsService) List(resourceName string) *PeopleConnectionsListCall { 5040 c := &PeopleConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5041 c.resourceName = resourceName 5042 return c 5043} 5044 5045// PageSize sets the optional parameter "pageSize": The number of 5046// connections to include in the response. Valid values are 5047// between 1 and 2000, inclusive. Defaults to 100 if not set or set to 5048// 0. 5049func (c *PeopleConnectionsListCall) PageSize(pageSize int64) *PeopleConnectionsListCall { 5050 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5051 return c 5052} 5053 5054// PageToken sets the optional parameter "pageToken": A page token, 5055// received from a previous `ListConnections` call. 5056// Provide this to retrieve the subsequent page. 5057// 5058// When paginating, all other parameters provided to 5059// `ListConnections` 5060// must match the call that provided the page token. 5061func (c *PeopleConnectionsListCall) PageToken(pageToken string) *PeopleConnectionsListCall { 5062 c.urlParams_.Set("pageToken", pageToken) 5063 return c 5064} 5065 5066// PersonFields sets the optional parameter "personFields": Required. A 5067// field mask to restrict which fields on each person are returned. 5068// Multiple 5069// fields can be specified by separating them with commas. Valid values 5070// are: 5071// 5072// * addresses 5073// * ageRanges 5074// * biographies 5075// * birthdays 5076// * coverPhotos 5077// * emailAddresses 5078// * events 5079// * genders 5080// * imClients 5081// * interests 5082// * locales 5083// * memberships 5084// * metadata 5085// * names 5086// * nicknames 5087// * occupations 5088// * organizations 5089// * phoneNumbers 5090// * photos 5091// * relations 5092// * residences 5093// * sipAddresses 5094// * skills 5095// * urls 5096// * userDefined 5097func (c *PeopleConnectionsListCall) PersonFields(personFields string) *PeopleConnectionsListCall { 5098 c.urlParams_.Set("personFields", personFields) 5099 return c 5100} 5101 5102// RequestMaskIncludeField sets the optional parameter 5103// "requestMask.includeField": Required. Comma-separated list of person 5104// fields to be included in the response. Each 5105// path should start with `person.`: for example, `person.names` 5106// or 5107// `person.photos`. 5108func (c *PeopleConnectionsListCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleConnectionsListCall { 5109 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField) 5110 return c 5111} 5112 5113// RequestSyncToken sets the optional parameter "requestSyncToken": 5114// Whether the response should include `next_sync_token`, which can be 5115// used to 5116// get all changes since the last request. For subsequent sync requests 5117// use 5118// the `sync_token` param instead. Initial sync requests that 5119// specify 5120// `request_sync_token` have an additional rate limit. 5121func (c *PeopleConnectionsListCall) RequestSyncToken(requestSyncToken bool) *PeopleConnectionsListCall { 5122 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken)) 5123 return c 5124} 5125 5126// SortOrder sets the optional parameter "sortOrder": The order in which 5127// the connections should be sorted. Defaults 5128// to 5129// `LAST_MODIFIED_ASCENDING`. 5130// 5131// Possible values: 5132// "LAST_MODIFIED_ASCENDING" 5133// "LAST_MODIFIED_DESCENDING" 5134// "FIRST_NAME_ASCENDING" 5135// "LAST_NAME_ASCENDING" 5136func (c *PeopleConnectionsListCall) SortOrder(sortOrder string) *PeopleConnectionsListCall { 5137 c.urlParams_.Set("sortOrder", sortOrder) 5138 return c 5139} 5140 5141// SyncToken sets the optional parameter "syncToken": A sync token, 5142// received from a previous `ListConnections` call. 5143// Provide this to retrieve only the resources changed since the last 5144// request. 5145// Sync requests that specify `sync_token` have an additional rate 5146// limit. 5147// 5148// When syncing, all other parameters provided to `ListConnections` 5149// must match the call that provided the sync token. 5150func (c *PeopleConnectionsListCall) SyncToken(syncToken string) *PeopleConnectionsListCall { 5151 c.urlParams_.Set("syncToken", syncToken) 5152 return c 5153} 5154 5155// Fields allows partial responses to be retrieved. See 5156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5157// for more information. 5158func (c *PeopleConnectionsListCall) Fields(s ...googleapi.Field) *PeopleConnectionsListCall { 5159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5160 return c 5161} 5162 5163// IfNoneMatch sets the optional parameter which makes the operation 5164// fail if the object's ETag matches the given value. This is useful for 5165// getting updates only after the object has changed since the last 5166// request. Use googleapi.IsNotModified to check whether the response 5167// error from Do is the result of In-None-Match. 5168func (c *PeopleConnectionsListCall) IfNoneMatch(entityTag string) *PeopleConnectionsListCall { 5169 c.ifNoneMatch_ = entityTag 5170 return c 5171} 5172 5173// Context sets the context to be used in this call's Do method. Any 5174// pending HTTP request will be aborted if the provided context is 5175// canceled. 5176func (c *PeopleConnectionsListCall) Context(ctx context.Context) *PeopleConnectionsListCall { 5177 c.ctx_ = ctx 5178 return c 5179} 5180 5181// Header returns an http.Header that can be modified by the caller to 5182// add HTTP headers to the request. 5183func (c *PeopleConnectionsListCall) Header() http.Header { 5184 if c.header_ == nil { 5185 c.header_ = make(http.Header) 5186 } 5187 return c.header_ 5188} 5189 5190func (c *PeopleConnectionsListCall) doRequest(alt string) (*http.Response, error) { 5191 reqHeaders := make(http.Header) 5192 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 5193 for k, v := range c.header_ { 5194 reqHeaders[k] = v 5195 } 5196 reqHeaders.Set("User-Agent", c.s.userAgent()) 5197 if c.ifNoneMatch_ != "" { 5198 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5199 } 5200 var body io.Reader = nil 5201 c.urlParams_.Set("alt", alt) 5202 c.urlParams_.Set("prettyPrint", "false") 5203 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/connections") 5204 urls += "?" + c.urlParams_.Encode() 5205 req, err := http.NewRequest("GET", urls, body) 5206 if err != nil { 5207 return nil, err 5208 } 5209 req.Header = reqHeaders 5210 googleapi.Expand(req.URL, map[string]string{ 5211 "resourceName": c.resourceName, 5212 }) 5213 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5214} 5215 5216// Do executes the "people.people.connections.list" call. 5217// Exactly one of *ListConnectionsResponse or error will be non-nil. Any 5218// non-2xx status code is an error. Response headers are in either 5219// *ListConnectionsResponse.ServerResponse.Header or (if a response was 5220// returned at all) in error.(*googleapi.Error).Header. Use 5221// googleapi.IsNotModified to check whether the returned error was 5222// because http.StatusNotModified was returned. 5223func (c *PeopleConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) { 5224 gensupport.SetOptions(c.urlParams_, opts...) 5225 res, err := c.doRequest("json") 5226 if res != nil && res.StatusCode == http.StatusNotModified { 5227 if res.Body != nil { 5228 res.Body.Close() 5229 } 5230 return nil, &googleapi.Error{ 5231 Code: res.StatusCode, 5232 Header: res.Header, 5233 } 5234 } 5235 if err != nil { 5236 return nil, err 5237 } 5238 defer googleapi.CloseBody(res) 5239 if err := googleapi.CheckResponse(res); err != nil { 5240 return nil, err 5241 } 5242 ret := &ListConnectionsResponse{ 5243 ServerResponse: googleapi.ServerResponse{ 5244 Header: res.Header, 5245 HTTPStatusCode: res.StatusCode, 5246 }, 5247 } 5248 target := &ret 5249 if err := gensupport.DecodeResponse(target, res); err != nil { 5250 return nil, err 5251 } 5252 return ret, nil 5253 // { 5254 // "description": "Provides a list of the authenticated user's contacts merged with any\nconnected profiles.\n\nThe request throws a 400 error if 'personFields' is not specified.", 5255 // "flatPath": "v1/people/{peopleId}/connections", 5256 // "httpMethod": "GET", 5257 // "id": "people.people.connections.list", 5258 // "parameterOrder": [ 5259 // "resourceName" 5260 // ], 5261 // "parameters": { 5262 // "pageSize": { 5263 // "description": "Optional. The number of connections to include in the response. Valid values are\nbetween 1 and 2000, inclusive. Defaults to 100 if not set or set to 0.", 5264 // "format": "int32", 5265 // "location": "query", 5266 // "type": "integer" 5267 // }, 5268 // "pageToken": { 5269 // "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.", 5270 // "location": "query", 5271 // "type": "string" 5272 // }, 5273 // "personFields": { 5274 // "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", 5275 // "format": "google-fieldmask", 5276 // "location": "query", 5277 // "type": "string" 5278 // }, 5279 // "requestMask.includeField": { 5280 // "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`.", 5281 // "format": "google-fieldmask", 5282 // "location": "query", 5283 // "type": "string" 5284 // }, 5285 // "requestSyncToken": { 5286 // "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.", 5287 // "location": "query", 5288 // "type": "boolean" 5289 // }, 5290 // "resourceName": { 5291 // "description": "Required. The resource name to return connections for. Only `people/me` is valid.", 5292 // "location": "path", 5293 // "pattern": "^people/[^/]+$", 5294 // "required": true, 5295 // "type": "string" 5296 // }, 5297 // "sortOrder": { 5298 // "description": "Optional. The order in which the connections should be sorted. Defaults to\n`LAST_MODIFIED_ASCENDING`.", 5299 // "enum": [ 5300 // "LAST_MODIFIED_ASCENDING", 5301 // "LAST_MODIFIED_DESCENDING", 5302 // "FIRST_NAME_ASCENDING", 5303 // "LAST_NAME_ASCENDING" 5304 // ], 5305 // "location": "query", 5306 // "type": "string" 5307 // }, 5308 // "syncToken": { 5309 // "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.", 5310 // "location": "query", 5311 // "type": "string" 5312 // } 5313 // }, 5314 // "path": "v1/{+resourceName}/connections", 5315 // "response": { 5316 // "$ref": "ListConnectionsResponse" 5317 // }, 5318 // "scopes": [ 5319 // "https://www.googleapis.com/auth/contacts", 5320 // "https://www.googleapis.com/auth/contacts.readonly" 5321 // ] 5322 // } 5323 5324} 5325 5326// Pages invokes f for each page of results. 5327// A non-nil error returned from f will halt the iteration. 5328// The provided context supersedes any context provided to the Context method. 5329func (c *PeopleConnectionsListCall) Pages(ctx context.Context, f func(*ListConnectionsResponse) error) error { 5330 c.ctx_ = ctx 5331 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5332 for { 5333 x, err := c.Do() 5334 if err != nil { 5335 return err 5336 } 5337 if err := f(x); err != nil { 5338 return err 5339 } 5340 if x.NextPageToken == "" { 5341 return nil 5342 } 5343 c.PageToken(x.NextPageToken) 5344 } 5345} 5346