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