Debian Codegraph @

people/v1/people-gen.go

raw
1 // Copyright 2026 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 "log/slog"
66 "net/http"
67 "net/url"
68 "strconv"
69 "strings"
70
71 "github.com/googleapis/gax-go/v2/internallog"
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80 // Always reference these packages, just in case the auto-generated code
81 // below doesn't.
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95 var _ = internallog.New
96
97 const apiId = "people:v1"
98 const apiName = "people"
99 const apiVersion = "v1"
100 const basePath = "https://people.googleapis.com/"
101 const basePathTemplate = "https://people.UNIVERSE_DOMAIN/"
102 const mtlsBasePath = "https://people.mtls.googleapis.com/"
103
104 // OAuth2 scopes used by this API.
105 const (
106 // See, edit, download, and permanently delete your contacts
107 ContactsScope = "https://www.googleapis.com/auth/contacts"
108
109 // See and download contact info automatically saved in your "Other contacts"
110 ContactsOtherReadonlyScope = "https://www.googleapis.com/auth/contacts.other.readonly"
111
112 // See and download your contacts
113 ContactsReadonlyScope = "https://www.googleapis.com/auth/contacts.readonly"
114
115 // See and download your organization's Google Workspace directory
116 DirectoryReadonlyScope = "https://www.googleapis.com/auth/directory.readonly"
117
118 // View your street addresses
119 UserAddressesReadScope = "https://www.googleapis.com/auth/user.addresses.read"
120
121 // See and download your exact date of birth
122 UserBirthdayReadScope = "https://www.googleapis.com/auth/user.birthday.read"
123
124 // See and download all of your Google Account email addresses
125 UserEmailsReadScope = "https://www.googleapis.com/auth/user.emails.read"
126
127 // See your gender
128 UserGenderReadScope = "https://www.googleapis.com/auth/user.gender.read"
129
130 // See your education, work history and org info
131 UserOrganizationReadScope = "https://www.googleapis.com/auth/user.organization.read"
132
133 // See and download your personal phone numbers
134 UserPhonenumbersReadScope = "https://www.googleapis.com/auth/user.phonenumbers.read"
135
136 // See your primary Google Account email address
137 UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
138
139 // See your personal info, including any personal info you've made publicly
140 // available
141 UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile"
142 )
143
144 // NewService creates a new Service.
145 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
146 scopesOption := internaloption.WithDefaultScopes(
147 "https://www.googleapis.com/auth/contacts",
148 "https://www.googleapis.com/auth/contacts.other.readonly",
149 "https://www.googleapis.com/auth/contacts.readonly",
150 "https://www.googleapis.com/auth/directory.readonly",
151 "https://www.googleapis.com/auth/user.addresses.read",
152 "https://www.googleapis.com/auth/user.birthday.read",
153 "https://www.googleapis.com/auth/user.emails.read",
154 "https://www.googleapis.com/auth/user.gender.read",
155 "https://www.googleapis.com/auth/user.organization.read",
156 "https://www.googleapis.com/auth/user.phonenumbers.read",
157 "https://www.googleapis.com/auth/userinfo.email",
158 "https://www.googleapis.com/auth/userinfo.profile",
159 )
160 // NOTE: prepend, so we don't override user-specified scopes.
161 opts = append([]option.ClientOption{scopesOption}, opts...)
162 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
163 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
164 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
165 opts = append(opts, internaloption.EnableNewAuthLibrary())
166 client, endpoint, err := htransport.NewClient(ctx, opts...)
167 if err != nil {
168 return nil, err
169 }
170 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
171 s.ContactGroups = NewContactGroupsService(s)
172 s.OtherContacts = NewOtherContactsService(s)
173 s.People = NewPeopleService(s)
174 if endpoint != "" {
175 s.BasePath = endpoint
176 }
177 return s, nil
178 }
179
180 // New creates a new Service. It uses the provided http.Client for requests.
181 //
182 // Deprecated: please use NewService instead.
183 // To provide a custom HTTP client, use option.WithHTTPClient.
184 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
185 func New(client *http.Client) (*Service, error) {
186 if client == nil {
187 return nil, errors.New("client is nil")
188 }
189 return NewService(context.TODO(), option.WithHTTPClient(client))
190 }
191
192 type Service struct {
193 client *http.Client
194 logger *slog.Logger
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 c.urlParams_.Set("alt", alt)
2778 c.urlParams_.Set("prettyPrint", "false")
2779 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups:batchGet")
2780 urls += "?" + c.urlParams_.Encode()
2781 req, err := http.NewRequest("GET", urls, nil)
2782 if err != nil {
2783 return nil, err
2784 }
2785 req.Header = reqHeaders
2786 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.batchGet", "request", internallog.HTTPRequest(req, nil))
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 b, err := gensupport.DecodeResponseBytes(target, res)
2823 if err != nil {
2824 return nil, err
2825 }
2826 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.batchGet", "response", internallog.HTTPResponse(res, b))
2827 return ret, nil
2828 }
2829
2830 type ContactGroupsCreateCall struct {
2831 s *Service
2832 createcontactgrouprequest *CreateContactGroupRequest
2833 urlParams_ gensupport.URLParams
2834 ctx_ context.Context
2835 header_ http.Header
2836 }
2837
2838 // Create: Create a new contact group owned by the authenticated user. Created
2839 // contact group names must be unique to the users contact groups. Attempting
2840 // to create a group with a duplicate name will return a HTTP 409 error. Mutate
2841 // requests for the same user should be sent sequentially to avoid increased
2842 // latency and failures.
2843 func (r *ContactGroupsService) Create(createcontactgrouprequest *CreateContactGroupRequest) *ContactGroupsCreateCall {
2844 c := &ContactGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2845 c.createcontactgrouprequest = createcontactgrouprequest
2846 return c
2847 }
2848
2849 // Fields allows partial responses to be retrieved. See
2850 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2851 // details.
2852 func (c *ContactGroupsCreateCall) Fields(s ...googleapi.Field) *ContactGroupsCreateCall {
2853 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2854 return c
2855 }
2856
2857 // Context sets the context to be used in this call's Do method.
2858 func (c *ContactGroupsCreateCall) Context(ctx context.Context) *ContactGroupsCreateCall {
2859 c.ctx_ = ctx
2860 return c
2861 }
2862
2863 // Header returns a http.Header that can be modified by the caller to add
2864 // headers to the request.
2865 func (c *ContactGroupsCreateCall) Header() http.Header {
2866 if c.header_ == nil {
2867 c.header_ = make(http.Header)
2868 }
2869 return c.header_
2870 }
2871
2872 func (c *ContactGroupsCreateCall) doRequest(alt string) (*http.Response, error) {
2873 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2874 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.createcontactgrouprequest)
2875 if err != nil {
2876 return nil, err
2877 }
2878 c.urlParams_.Set("alt", alt)
2879 c.urlParams_.Set("prettyPrint", "false")
2880 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups")
2881 urls += "?" + c.urlParams_.Encode()
2882 req, err := http.NewRequest("POST", urls, body)
2883 if err != nil {
2884 return nil, err
2885 }
2886 req.Header = reqHeaders
2887 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2888 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2889 }
2890
2891 // Do executes the "people.contactGroups.create" call.
2892 // Any non-2xx status code is an error. Response headers are in either
2893 // *ContactGroup.ServerResponse.Header or (if a response was returned at all)
2894 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2895 // whether the returned error was because http.StatusNotModified was returned.
2896 func (c *ContactGroupsCreateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
2897 gensupport.SetOptions(c.urlParams_, opts...)
2898 res, err := c.doRequest("json")
2899 if res != nil && res.StatusCode == http.StatusNotModified {
2900 if res.Body != nil {
2901 res.Body.Close()
2902 }
2903 return nil, gensupport.WrapError(&googleapi.Error{
2904 Code: res.StatusCode,
2905 Header: res.Header,
2906 })
2907 }
2908 if err != nil {
2909 return nil, err
2910 }
2911 defer googleapi.CloseBody(res)
2912 if err := googleapi.CheckResponse(res); err != nil {
2913 return nil, gensupport.WrapError(err)
2914 }
2915 ret := &ContactGroup{
2916 ServerResponse: googleapi.ServerResponse{
2917 Header: res.Header,
2918 HTTPStatusCode: res.StatusCode,
2919 },
2920 }
2921 target := &ret
2922 b, err := gensupport.DecodeResponseBytes(target, res)
2923 if err != nil {
2924 return nil, err
2925 }
2926 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.create", "response", internallog.HTTPResponse(res, b))
2927 return ret, nil
2928 }
2929
2930 type ContactGroupsDeleteCall struct {
2931 s *Service
2932 resourceName string
2933 urlParams_ gensupport.URLParams
2934 ctx_ context.Context
2935 header_ http.Header
2936 }
2937
2938 // Delete: Delete an existing contact group owned by the authenticated user by
2939 // specifying a contact group resource name. Mutate requests for the same user
2940 // should be sent sequentially to avoid increased latency and failures.
2941 //
2942 // - resourceName: The resource name of the contact group to delete.
2943 func (r *ContactGroupsService) Delete(resourceName string) *ContactGroupsDeleteCall {
2944 c := &ContactGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2945 c.resourceName = resourceName
2946 return c
2947 }
2948
2949 // DeleteContacts sets the optional parameter "deleteContacts": Set to true to
2950 // also delete the contacts in the specified group.
2951 func (c *ContactGroupsDeleteCall) DeleteContacts(deleteContacts bool) *ContactGroupsDeleteCall {
2952 c.urlParams_.Set("deleteContacts", fmt.Sprint(deleteContacts))
2953 return c
2954 }
2955
2956 // Fields allows partial responses to be retrieved. See
2957 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2958 // details.
2959 func (c *ContactGroupsDeleteCall) Fields(s ...googleapi.Field) *ContactGroupsDeleteCall {
2960 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2961 return c
2962 }
2963
2964 // Context sets the context to be used in this call's Do method.
2965 func (c *ContactGroupsDeleteCall) Context(ctx context.Context) *ContactGroupsDeleteCall {
2966 c.ctx_ = ctx
2967 return c
2968 }
2969
2970 // Header returns a http.Header that can be modified by the caller to add
2971 // headers to the request.
2972 func (c *ContactGroupsDeleteCall) Header() http.Header {
2973 if c.header_ == nil {
2974 c.header_ = make(http.Header)
2975 }
2976 return c.header_
2977 }
2978
2979 func (c *ContactGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
2980 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2981 c.urlParams_.Set("alt", alt)
2982 c.urlParams_.Set("prettyPrint", "false")
2983 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
2984 urls += "?" + c.urlParams_.Encode()
2985 req, err := http.NewRequest("DELETE", urls, nil)
2986 if err != nil {
2987 return nil, err
2988 }
2989 req.Header = reqHeaders
2990 googleapi.Expand(req.URL, map[string]string{
2991 "resourceName": c.resourceName,
2992 })
2993 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.delete", "request", internallog.HTTPRequest(req, nil))
2994 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2995 }
2996
2997 // Do executes the "people.contactGroups.delete" call.
2998 // Any non-2xx status code is an error. Response headers are in either
2999 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3000 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3001 // whether the returned error was because http.StatusNotModified was returned.
3002 func (c *ContactGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3003 gensupport.SetOptions(c.urlParams_, opts...)
3004 res, err := c.doRequest("json")
3005 if res != nil && res.StatusCode == http.StatusNotModified {
3006 if res.Body != nil {
3007 res.Body.Close()
3008 }
3009 return nil, gensupport.WrapError(&googleapi.Error{
3010 Code: res.StatusCode,
3011 Header: res.Header,
3012 })
3013 }
3014 if err != nil {
3015 return nil, err
3016 }
3017 defer googleapi.CloseBody(res)
3018 if err := googleapi.CheckResponse(res); err != nil {
3019 return nil, gensupport.WrapError(err)
3020 }
3021 ret := &Empty{
3022 ServerResponse: googleapi.ServerResponse{
3023 Header: res.Header,
3024 HTTPStatusCode: res.StatusCode,
3025 },
3026 }
3027 target := &ret
3028 b, err := gensupport.DecodeResponseBytes(target, res)
3029 if err != nil {
3030 return nil, err
3031 }
3032 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.delete", "response", internallog.HTTPResponse(res, b))
3033 return ret, nil
3034 }
3035
3036 type ContactGroupsGetCall struct {
3037 s *Service
3038 resourceName string
3039 urlParams_ gensupport.URLParams
3040 ifNoneMatch_ string
3041 ctx_ context.Context
3042 header_ http.Header
3043 }
3044
3045 // Get: Get a specific contact group owned by the authenticated user by
3046 // specifying a contact group resource name.
3047 //
3048 // - resourceName: The resource name of the contact group to get.
3049 func (r *ContactGroupsService) Get(resourceName string) *ContactGroupsGetCall {
3050 c := &ContactGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3051 c.resourceName = resourceName
3052 return c
3053 }
3054
3055 // GroupFields sets the optional parameter "groupFields": A field mask to
3056 // restrict which fields on the group are returned. Defaults to `metadata`,
3057 // `groupType`, `memberCount`, and `name` if not set or set to empty. Valid
3058 // fields are: * clientData * groupType * memberCount * metadata * name
3059 func (c *ContactGroupsGetCall) GroupFields(groupFields string) *ContactGroupsGetCall {
3060 c.urlParams_.Set("groupFields", groupFields)
3061 return c
3062 }
3063
3064 // MaxMembers sets the optional parameter "maxMembers": Specifies the maximum
3065 // number of members to return. Defaults to 0 if not set, which will return
3066 // zero members.
3067 func (c *ContactGroupsGetCall) MaxMembers(maxMembers int64) *ContactGroupsGetCall {
3068 c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers))
3069 return c
3070 }
3071
3072 // Fields allows partial responses to be retrieved. See
3073 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3074 // details.
3075 func (c *ContactGroupsGetCall) Fields(s ...googleapi.Field) *ContactGroupsGetCall {
3076 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3077 return c
3078 }
3079
3080 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3081 // object's ETag matches the given value. This is useful for getting updates
3082 // only after the object has changed since the last request.
3083 func (c *ContactGroupsGetCall) IfNoneMatch(entityTag string) *ContactGroupsGetCall {
3084 c.ifNoneMatch_ = entityTag
3085 return c
3086 }
3087
3088 // Context sets the context to be used in this call's Do method.
3089 func (c *ContactGroupsGetCall) Context(ctx context.Context) *ContactGroupsGetCall {
3090 c.ctx_ = ctx
3091 return c
3092 }
3093
3094 // Header returns a http.Header that can be modified by the caller to add
3095 // headers to the request.
3096 func (c *ContactGroupsGetCall) Header() http.Header {
3097 if c.header_ == nil {
3098 c.header_ = make(http.Header)
3099 }
3100 return c.header_
3101 }
3102
3103 func (c *ContactGroupsGetCall) doRequest(alt string) (*http.Response, error) {
3104 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3105 if c.ifNoneMatch_ != "" {
3106 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3107 }
3108 c.urlParams_.Set("alt", alt)
3109 c.urlParams_.Set("prettyPrint", "false")
3110 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
3111 urls += "?" + c.urlParams_.Encode()
3112 req, err := http.NewRequest("GET", urls, nil)
3113 if err != nil {
3114 return nil, err
3115 }
3116 req.Header = reqHeaders
3117 googleapi.Expand(req.URL, map[string]string{
3118 "resourceName": c.resourceName,
3119 })
3120 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.get", "request", internallog.HTTPRequest(req, nil))
3121 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3122 }
3123
3124 // Do executes the "people.contactGroups.get" call.
3125 // Any non-2xx status code is an error. Response headers are in either
3126 // *ContactGroup.ServerResponse.Header or (if a response was returned at all)
3127 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3128 // whether the returned error was because http.StatusNotModified was returned.
3129 func (c *ContactGroupsGetCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
3130 gensupport.SetOptions(c.urlParams_, opts...)
3131 res, err := c.doRequest("json")
3132 if res != nil && res.StatusCode == http.StatusNotModified {
3133 if res.Body != nil {
3134 res.Body.Close()
3135 }
3136 return nil, gensupport.WrapError(&googleapi.Error{
3137 Code: res.StatusCode,
3138 Header: res.Header,
3139 })
3140 }
3141 if err != nil {
3142 return nil, err
3143 }
3144 defer googleapi.CloseBody(res)
3145 if err := googleapi.CheckResponse(res); err != nil {
3146 return nil, gensupport.WrapError(err)
3147 }
3148 ret := &ContactGroup{
3149 ServerResponse: googleapi.ServerResponse{
3150 Header: res.Header,
3151 HTTPStatusCode: res.StatusCode,
3152 },
3153 }
3154 target := &ret
3155 b, err := gensupport.DecodeResponseBytes(target, res)
3156 if err != nil {
3157 return nil, err
3158 }
3159 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.get", "response", internallog.HTTPResponse(res, b))
3160 return ret, nil
3161 }
3162
3163 type ContactGroupsListCall struct {
3164 s *Service
3165 urlParams_ gensupport.URLParams
3166 ifNoneMatch_ string
3167 ctx_ context.Context
3168 header_ http.Header
3169 }
3170
3171 // List: List all contact groups owned by the authenticated user. Members of
3172 // the contact groups are not populated.
3173 func (r *ContactGroupsService) List() *ContactGroupsListCall {
3174 c := &ContactGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3175 return c
3176 }
3177
3178 // GroupFields sets the optional parameter "groupFields": A field mask to
3179 // restrict which fields on the group are returned. Defaults to `metadata`,
3180 // `groupType`, `memberCount`, and `name` if not set or set to empty. Valid
3181 // fields are: * clientData * groupType * memberCount * metadata * name
3182 func (c *ContactGroupsListCall) GroupFields(groupFields string) *ContactGroupsListCall {
3183 c.urlParams_.Set("groupFields", groupFields)
3184 return c
3185 }
3186
3187 // PageSize sets the optional parameter "pageSize": The maximum number of
3188 // resources to return. Valid values are between 1 and 1000, inclusive.
3189 // Defaults to 30 if not set or set to 0.
3190 func (c *ContactGroupsListCall) PageSize(pageSize int64) *ContactGroupsListCall {
3191 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3192 return c
3193 }
3194
3195 // PageToken sets the optional parameter "pageToken": The next_page_token value
3196 // returned from a previous call to ListContactGroups
3197 // (/people/api/rest/v1/contactgroups/list). Requests the next page of
3198 // resources.
3199 func (c *ContactGroupsListCall) PageToken(pageToken string) *ContactGroupsListCall {
3200 c.urlParams_.Set("pageToken", pageToken)
3201 return c
3202 }
3203
3204 // SyncToken sets the optional parameter "syncToken": A sync token, returned by
3205 // a previous call to `contactgroups.list`. Only resources changed since the
3206 // sync token was created will be returned.
3207 func (c *ContactGroupsListCall) SyncToken(syncToken string) *ContactGroupsListCall {
3208 c.urlParams_.Set("syncToken", syncToken)
3209 return c
3210 }
3211
3212 // Fields allows partial responses to be retrieved. See
3213 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3214 // details.
3215 func (c *ContactGroupsListCall) Fields(s ...googleapi.Field) *ContactGroupsListCall {
3216 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3217 return c
3218 }
3219
3220 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3221 // object's ETag matches the given value. This is useful for getting updates
3222 // only after the object has changed since the last request.
3223 func (c *ContactGroupsListCall) IfNoneMatch(entityTag string) *ContactGroupsListCall {
3224 c.ifNoneMatch_ = entityTag
3225 return c
3226 }
3227
3228 // Context sets the context to be used in this call's Do method.
3229 func (c *ContactGroupsListCall) Context(ctx context.Context) *ContactGroupsListCall {
3230 c.ctx_ = ctx
3231 return c
3232 }
3233
3234 // Header returns a http.Header that can be modified by the caller to add
3235 // headers to the request.
3236 func (c *ContactGroupsListCall) Header() http.Header {
3237 if c.header_ == nil {
3238 c.header_ = make(http.Header)
3239 }
3240 return c.header_
3241 }
3242
3243 func (c *ContactGroupsListCall) doRequest(alt string) (*http.Response, error) {
3244 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3245 if c.ifNoneMatch_ != "" {
3246 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3247 }
3248 c.urlParams_.Set("alt", alt)
3249 c.urlParams_.Set("prettyPrint", "false")
3250 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups")
3251 urls += "?" + c.urlParams_.Encode()
3252 req, err := http.NewRequest("GET", urls, nil)
3253 if err != nil {
3254 return nil, err
3255 }
3256 req.Header = reqHeaders
3257 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.list", "request", internallog.HTTPRequest(req, nil))
3258 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3259 }
3260
3261 // Do executes the "people.contactGroups.list" call.
3262 // Any non-2xx status code is an error. Response headers are in either
3263 // *ListContactGroupsResponse.ServerResponse.Header or (if a response was
3264 // returned at all) in error.(*googleapi.Error).Header. Use
3265 // googleapi.IsNotModified to check whether the returned error was because
3266 // http.StatusNotModified was returned.
3267 func (c *ContactGroupsListCall) Do(opts ...googleapi.CallOption) (*ListContactGroupsResponse, error) {
3268 gensupport.SetOptions(c.urlParams_, opts...)
3269 res, err := c.doRequest("json")
3270 if res != nil && res.StatusCode == http.StatusNotModified {
3271 if res.Body != nil {
3272 res.Body.Close()
3273 }
3274 return nil, gensupport.WrapError(&googleapi.Error{
3275 Code: res.StatusCode,
3276 Header: res.Header,
3277 })
3278 }
3279 if err != nil {
3280 return nil, err
3281 }
3282 defer googleapi.CloseBody(res)
3283 if err := googleapi.CheckResponse(res); err != nil {
3284 return nil, gensupport.WrapError(err)
3285 }
3286 ret := &ListContactGroupsResponse{
3287 ServerResponse: googleapi.ServerResponse{
3288 Header: res.Header,
3289 HTTPStatusCode: res.StatusCode,
3290 },
3291 }
3292 target := &ret
3293 b, err := gensupport.DecodeResponseBytes(target, res)
3294 if err != nil {
3295 return nil, err
3296 }
3297 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.list", "response", internallog.HTTPResponse(res, b))
3298 return ret, nil
3299 }
3300
3301 // Pages invokes f for each page of results.
3302 // A non-nil error returned from f will halt the iteration.
3303 // The provided context supersedes any context provided to the Context method.
3304 func (c *ContactGroupsListCall) Pages(ctx context.Context, f func(*ListContactGroupsResponse) error) error {
3305 c.ctx_ = ctx
3306 defer c.PageToken(c.urlParams_.Get("pageToken"))
3307 for {
3308 x, err := c.Do()
3309 if err != nil {
3310 return err
3311 }
3312 if err := f(x); err != nil {
3313 return err
3314 }
3315 if x.NextPageToken == "" {
3316 return nil
3317 }
3318 c.PageToken(x.NextPageToken)
3319 }
3320 }
3321
3322 type ContactGroupsUpdateCall struct {
3323 s *Service
3324 resourceName string
3325 updatecontactgrouprequest *UpdateContactGroupRequest
3326 urlParams_ gensupport.URLParams
3327 ctx_ context.Context
3328 header_ http.Header
3329 }
3330
3331 // Update: Update the name of an existing contact group owned by the
3332 // authenticated user. Updated contact group names must be unique to the users
3333 // contact groups. Attempting to create a group with a duplicate name will
3334 // return a HTTP 409 error. Mutate requests for the same user should be sent
3335 // sequentially to avoid increased latency and failures.
3336 //
3337 // - resourceName: The resource name for the contact group, assigned by the
3338 // server. An ASCII string, in the form of
3339 // `contactGroups/{contact_group_id}`.
3340 func (r *ContactGroupsService) Update(resourceName string, updatecontactgrouprequest *UpdateContactGroupRequest) *ContactGroupsUpdateCall {
3341 c := &ContactGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3342 c.resourceName = resourceName
3343 c.updatecontactgrouprequest = updatecontactgrouprequest
3344 return c
3345 }
3346
3347 // Fields allows partial responses to be retrieved. See
3348 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3349 // details.
3350 func (c *ContactGroupsUpdateCall) Fields(s ...googleapi.Field) *ContactGroupsUpdateCall {
3351 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3352 return c
3353 }
3354
3355 // Context sets the context to be used in this call's Do method.
3356 func (c *ContactGroupsUpdateCall) Context(ctx context.Context) *ContactGroupsUpdateCall {
3357 c.ctx_ = ctx
3358 return c
3359 }
3360
3361 // Header returns a http.Header that can be modified by the caller to add
3362 // headers to the request.
3363 func (c *ContactGroupsUpdateCall) Header() http.Header {
3364 if c.header_ == nil {
3365 c.header_ = make(http.Header)
3366 }
3367 return c.header_
3368 }
3369
3370 func (c *ContactGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
3371 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3372 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecontactgrouprequest)
3373 if err != nil {
3374 return nil, err
3375 }
3376 c.urlParams_.Set("alt", alt)
3377 c.urlParams_.Set("prettyPrint", "false")
3378 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
3379 urls += "?" + c.urlParams_.Encode()
3380 req, err := http.NewRequest("PUT", urls, body)
3381 if err != nil {
3382 return nil, err
3383 }
3384 req.Header = reqHeaders
3385 googleapi.Expand(req.URL, map[string]string{
3386 "resourceName": c.resourceName,
3387 })
3388 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.update", "request", internallog.HTTPRequest(req, body.Bytes()))
3389 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3390 }
3391
3392 // Do executes the "people.contactGroups.update" call.
3393 // Any non-2xx status code is an error. Response headers are in either
3394 // *ContactGroup.ServerResponse.Header or (if a response was returned at all)
3395 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3396 // whether the returned error was because http.StatusNotModified was returned.
3397 func (c *ContactGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
3398 gensupport.SetOptions(c.urlParams_, opts...)
3399 res, err := c.doRequest("json")
3400 if res != nil && res.StatusCode == http.StatusNotModified {
3401 if res.Body != nil {
3402 res.Body.Close()
3403 }
3404 return nil, gensupport.WrapError(&googleapi.Error{
3405 Code: res.StatusCode,
3406 Header: res.Header,
3407 })
3408 }
3409 if err != nil {
3410 return nil, err
3411 }
3412 defer googleapi.CloseBody(res)
3413 if err := googleapi.CheckResponse(res); err != nil {
3414 return nil, gensupport.WrapError(err)
3415 }
3416 ret := &ContactGroup{
3417 ServerResponse: googleapi.ServerResponse{
3418 Header: res.Header,
3419 HTTPStatusCode: res.StatusCode,
3420 },
3421 }
3422 target := &ret
3423 b, err := gensupport.DecodeResponseBytes(target, res)
3424 if err != nil {
3425 return nil, err
3426 }
3427 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.update", "response", internallog.HTTPResponse(res, b))
3428 return ret, nil
3429 }
3430
3431 type ContactGroupsMembersModifyCall struct {
3432 s *Service
3433 resourceName string
3434 modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest
3435 urlParams_ gensupport.URLParams
3436 ctx_ context.Context
3437 header_ http.Header
3438 }
3439
3440 // Modify: Modify the members of a contact group owned by the authenticated
3441 // user. The only system contact groups that can have members added are
3442 // `contactGroups/myContacts` and `contactGroups/starred`. Other system contact
3443 // groups are deprecated and can only have contacts removed.
3444 //
3445 // - resourceName: The resource name of the contact group to modify.
3446 func (r *ContactGroupsMembersService) Modify(resourceName string, modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest) *ContactGroupsMembersModifyCall {
3447 c := &ContactGroupsMembersModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3448 c.resourceName = resourceName
3449 c.modifycontactgroupmembersrequest = modifycontactgroupmembersrequest
3450 return c
3451 }
3452
3453 // Fields allows partial responses to be retrieved. See
3454 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3455 // details.
3456 func (c *ContactGroupsMembersModifyCall) Fields(s ...googleapi.Field) *ContactGroupsMembersModifyCall {
3457 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3458 return c
3459 }
3460
3461 // Context sets the context to be used in this call's Do method.
3462 func (c *ContactGroupsMembersModifyCall) Context(ctx context.Context) *ContactGroupsMembersModifyCall {
3463 c.ctx_ = ctx
3464 return c
3465 }
3466
3467 // Header returns a http.Header that can be modified by the caller to add
3468 // headers to the request.
3469 func (c *ContactGroupsMembersModifyCall) Header() http.Header {
3470 if c.header_ == nil {
3471 c.header_ = make(http.Header)
3472 }
3473 return c.header_
3474 }
3475
3476 func (c *ContactGroupsMembersModifyCall) doRequest(alt string) (*http.Response, error) {
3477 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3478 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.modifycontactgroupmembersrequest)
3479 if err != nil {
3480 return nil, err
3481 }
3482 c.urlParams_.Set("alt", alt)
3483 c.urlParams_.Set("prettyPrint", "false")
3484 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/members:modify")
3485 urls += "?" + c.urlParams_.Encode()
3486 req, err := http.NewRequest("POST", urls, body)
3487 if err != nil {
3488 return nil, err
3489 }
3490 req.Header = reqHeaders
3491 googleapi.Expand(req.URL, map[string]string{
3492 "resourceName": c.resourceName,
3493 })
3494 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.contactGroups.members.modify", "request", internallog.HTTPRequest(req, body.Bytes()))
3495 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3496 }
3497
3498 // Do executes the "people.contactGroups.members.modify" call.
3499 // Any non-2xx status code is an error. Response headers are in either
3500 // *ModifyContactGroupMembersResponse.ServerResponse.Header or (if a response
3501 // was returned at all) in error.(*googleapi.Error).Header. Use
3502 // googleapi.IsNotModified to check whether the returned error was because
3503 // http.StatusNotModified was returned.
3504 func (c *ContactGroupsMembersModifyCall) Do(opts ...googleapi.CallOption) (*ModifyContactGroupMembersResponse, error) {
3505 gensupport.SetOptions(c.urlParams_, opts...)
3506 res, err := c.doRequest("json")
3507 if res != nil && res.StatusCode == http.StatusNotModified {
3508 if res.Body != nil {
3509 res.Body.Close()
3510 }
3511 return nil, gensupport.WrapError(&googleapi.Error{
3512 Code: res.StatusCode,
3513 Header: res.Header,
3514 })
3515 }
3516 if err != nil {
3517 return nil, err
3518 }
3519 defer googleapi.CloseBody(res)
3520 if err := googleapi.CheckResponse(res); err != nil {
3521 return nil, gensupport.WrapError(err)
3522 }
3523 ret := &ModifyContactGroupMembersResponse{
3524 ServerResponse: googleapi.ServerResponse{
3525 Header: res.Header,
3526 HTTPStatusCode: res.StatusCode,
3527 },
3528 }
3529 target := &ret
3530 b, err := gensupport.DecodeResponseBytes(target, res)
3531 if err != nil {
3532 return nil, err
3533 }
3534 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.contactGroups.members.modify", "response", internallog.HTTPResponse(res, b))
3535 return ret, nil
3536 }
3537
3538 type OtherContactsCopyOtherContactToMyContactsGroupCall struct {
3539 s *Service
3540 resourceName string
3541 copyothercontacttomycontactsgrouprequest *CopyOtherContactToMyContactsGroupRequest
3542 urlParams_ gensupport.URLParams
3543 ctx_ context.Context
3544 header_ http.Header
3545 }
3546
3547 // CopyOtherContactToMyContactsGroup: Copies an "Other contact" to a new
3548 // contact in the user's "myContacts" group Mutate requests for the same user
3549 // should be sent sequentially to avoid increased latency and failures.
3550 //
3551 // - resourceName: The resource name of the "Other contact" to copy.
3552 func (r *OtherContactsService) CopyOtherContactToMyContactsGroup(resourceName string, copyothercontacttomycontactsgrouprequest *CopyOtherContactToMyContactsGroupRequest) *OtherContactsCopyOtherContactToMyContactsGroupCall {
3553 c := &OtherContactsCopyOtherContactToMyContactsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3554 c.resourceName = resourceName
3555 c.copyothercontacttomycontactsgrouprequest = copyothercontacttomycontactsgrouprequest
3556 return c
3557 }
3558
3559 // Fields allows partial responses to be retrieved. See
3560 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3561 // details.
3562 func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Fields(s ...googleapi.Field) *OtherContactsCopyOtherContactToMyContactsGroupCall {
3563 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3564 return c
3565 }
3566
3567 // Context sets the context to be used in this call's Do method.
3568 func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Context(ctx context.Context) *OtherContactsCopyOtherContactToMyContactsGroupCall {
3569 c.ctx_ = ctx
3570 return c
3571 }
3572
3573 // Header returns a http.Header that can be modified by the caller to add
3574 // headers to the request.
3575 func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Header() http.Header {
3576 if c.header_ == nil {
3577 c.header_ = make(http.Header)
3578 }
3579 return c.header_
3580 }
3581
3582 func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) doRequest(alt string) (*http.Response, error) {
3583 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3584 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.copyothercontacttomycontactsgrouprequest)
3585 if err != nil {
3586 return nil, err
3587 }
3588 c.urlParams_.Set("alt", alt)
3589 c.urlParams_.Set("prettyPrint", "false")
3590 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:copyOtherContactToMyContactsGroup")
3591 urls += "?" + c.urlParams_.Encode()
3592 req, err := http.NewRequest("POST", urls, body)
3593 if err != nil {
3594 return nil, err
3595 }
3596 req.Header = reqHeaders
3597 googleapi.Expand(req.URL, map[string]string{
3598 "resourceName": c.resourceName,
3599 })
3600 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.otherContacts.copyOtherContactToMyContactsGroup", "request", internallog.HTTPRequest(req, body.Bytes()))
3601 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3602 }
3603
3604 // Do executes the "people.otherContacts.copyOtherContactToMyContactsGroup" call.
3605 // Any non-2xx status code is an error. Response headers are in either
3606 // *Person.ServerResponse.Header or (if a response was returned at all) in
3607 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3608 // whether the returned error was because http.StatusNotModified was returned.
3609 func (c *OtherContactsCopyOtherContactToMyContactsGroupCall) Do(opts ...googleapi.CallOption) (*Person, error) {
3610 gensupport.SetOptions(c.urlParams_, opts...)
3611 res, err := c.doRequest("json")
3612 if res != nil && res.StatusCode == http.StatusNotModified {
3613 if res.Body != nil {
3614 res.Body.Close()
3615 }
3616 return nil, gensupport.WrapError(&googleapi.Error{
3617 Code: res.StatusCode,
3618 Header: res.Header,
3619 })
3620 }
3621 if err != nil {
3622 return nil, err
3623 }
3624 defer googleapi.CloseBody(res)
3625 if err := googleapi.CheckResponse(res); err != nil {
3626 return nil, gensupport.WrapError(err)
3627 }
3628 ret := &Person{
3629 ServerResponse: googleapi.ServerResponse{
3630 Header: res.Header,
3631 HTTPStatusCode: res.StatusCode,
3632 },
3633 }
3634 target := &ret
3635 b, err := gensupport.DecodeResponseBytes(target, res)
3636 if err != nil {
3637 return nil, err
3638 }
3639 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.otherContacts.copyOtherContactToMyContactsGroup", "response", internallog.HTTPResponse(res, b))
3640 return ret, nil
3641 }
3642
3643 type OtherContactsListCall struct {
3644 s *Service
3645 urlParams_ gensupport.URLParams
3646 ifNoneMatch_ string
3647 ctx_ context.Context
3648 header_ http.Header
3649 }
3650
3651 // List: List all "Other contacts", that is contacts that are not in a contact
3652 // group. "Other contacts" are typically auto created contacts from
3653 // interactions. Sync tokens expire 7 days after the full sync. A request with
3654 // an expired sync token will get an error with an google.rpc.ErrorInfo
3655 // (https://cloud.google.com/apis/design/errors#error_info) with reason
3656 // "EXPIRED_SYNC_TOKEN". In the case of such an error clients should make a
3657 // full sync request without a `sync_token`. The first page of a full sync
3658 // request has an additional quota. If the quota is exceeded, a 429 error will
3659 // be returned. This quota is fixed and can not be increased. When the
3660 // `sync_token` is specified, resources deleted since the last sync will be
3661 // returned as a person with `PersonMetadata.deleted` set to true. When the
3662 // `page_token` or `sync_token` is specified, all other request parameters must
3663 // match the first call. Writes may have a propagation delay of several minutes
3664 // for sync requests. Incremental syncs are not intended for read-after-write
3665 // use cases. See example usage at List the user's other contacts that have
3666 // changed
3667 // (/people/v1/other-contacts#list_the_users_other_contacts_that_have_changed).
3668 func (r *OtherContactsService) List() *OtherContactsListCall {
3669 c := &OtherContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3670 return c
3671 }
3672
3673 // PageSize sets the optional parameter "pageSize": The number of "Other
3674 // contacts" to include in the response. Valid values are between 1 and 1000,
3675 // inclusive. Defaults to 100 if not set or set to 0.
3676 func (c *OtherContactsListCall) PageSize(pageSize int64) *OtherContactsListCall {
3677 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3678 return c
3679 }
3680
3681 // PageToken sets the optional parameter "pageToken": A page token, received
3682 // from a previous response `next_page_token`. Provide this to retrieve the
3683 // subsequent page. When paginating, all other parameters provided to
3684 // `otherContacts.list` must match the first call that provided the page token.
3685 func (c *OtherContactsListCall) PageToken(pageToken string) *OtherContactsListCall {
3686 c.urlParams_.Set("pageToken", pageToken)
3687 return c
3688 }
3689
3690 // ReadMask sets the optional parameter "readMask": Required. A field mask to
3691 // restrict which fields on each person are returned. Multiple fields can be
3692 // specified by separating them with commas. What values are valid depend on
3693 // what ReadSourceType is used. If READ_SOURCE_TYPE_CONTACT is used, valid
3694 // values are: * emailAddresses * metadata * names * phoneNumbers * photos If
3695 // READ_SOURCE_TYPE_PROFILE is used, valid values are: * addresses * ageRanges
3696 // * biographies * birthdays * calendarUrls * clientData * coverPhotos *
3697 // emailAddresses * events * externalIds * genders * imClients * interests *
3698 // locales * locations * memberships * metadata * miscKeywords * names *
3699 // nicknames * occupations * organizations * phoneNumbers * photos * relations
3700 // * sipAddresses * skills * urls * userDefined
3701 func (c *OtherContactsListCall) ReadMask(readMask string) *OtherContactsListCall {
3702 c.urlParams_.Set("readMask", readMask)
3703 return c
3704 }
3705
3706 // RequestSyncToken sets the optional parameter "requestSyncToken": Whether the
3707 // response should return `next_sync_token` on the last page of results. It can
3708 // be used to get incremental changes since the last request by setting it on
3709 // the request `sync_token`. More details about sync behavior at
3710 // `otherContacts.list`.
3711 func (c *OtherContactsListCall) RequestSyncToken(requestSyncToken bool) *OtherContactsListCall {
3712 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken))
3713 return c
3714 }
3715
3716 // Sources sets the optional parameter "sources": A mask of what source types
3717 // to return. Defaults to READ_SOURCE_TYPE_CONTACT if not set. Possible values
3718 // for this field are: * READ_SOURCE_TYPE_CONTACT *
3719 // READ_SOURCE_TYPE_CONTACT,READ_SOURCE_TYPE_PROFILE Specifying
3720 // READ_SOURCE_TYPE_PROFILE without specifying READ_SOURCE_TYPE_CONTACT is not
3721 // permitted.
3722 //
3723 // Possible values:
3724 //
3725 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
3726 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
3727 //
3728 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
3729 //
3730 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
3731 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
3732 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
3733 func (c *OtherContactsListCall) Sources(sources ...string) *OtherContactsListCall {
3734 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
3735 return c
3736 }
3737
3738 // SyncToken sets the optional parameter "syncToken": A sync token, received
3739 // from a previous response `next_sync_token` Provide this to retrieve only the
3740 // resources changed since the last request. When syncing, all other parameters
3741 // provided to `otherContacts.list` must match the first call that provided the
3742 // sync token. More details about sync behavior at `otherContacts.list`.
3743 func (c *OtherContactsListCall) SyncToken(syncToken string) *OtherContactsListCall {
3744 c.urlParams_.Set("syncToken", syncToken)
3745 return c
3746 }
3747
3748 // Fields allows partial responses to be retrieved. See
3749 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3750 // details.
3751 func (c *OtherContactsListCall) Fields(s ...googleapi.Field) *OtherContactsListCall {
3752 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3753 return c
3754 }
3755
3756 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3757 // object's ETag matches the given value. This is useful for getting updates
3758 // only after the object has changed since the last request.
3759 func (c *OtherContactsListCall) IfNoneMatch(entityTag string) *OtherContactsListCall {
3760 c.ifNoneMatch_ = entityTag
3761 return c
3762 }
3763
3764 // Context sets the context to be used in this call's Do method.
3765 func (c *OtherContactsListCall) Context(ctx context.Context) *OtherContactsListCall {
3766 c.ctx_ = ctx
3767 return c
3768 }
3769
3770 // Header returns a http.Header that can be modified by the caller to add
3771 // headers to the request.
3772 func (c *OtherContactsListCall) Header() http.Header {
3773 if c.header_ == nil {
3774 c.header_ = make(http.Header)
3775 }
3776 return c.header_
3777 }
3778
3779 func (c *OtherContactsListCall) doRequest(alt string) (*http.Response, error) {
3780 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3781 if c.ifNoneMatch_ != "" {
3782 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3783 }
3784 c.urlParams_.Set("alt", alt)
3785 c.urlParams_.Set("prettyPrint", "false")
3786 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/otherContacts")
3787 urls += "?" + c.urlParams_.Encode()
3788 req, err := http.NewRequest("GET", urls, nil)
3789 if err != nil {
3790 return nil, err
3791 }
3792 req.Header = reqHeaders
3793 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.otherContacts.list", "request", internallog.HTTPRequest(req, nil))
3794 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3795 }
3796
3797 // Do executes the "people.otherContacts.list" call.
3798 // Any non-2xx status code is an error. Response headers are in either
3799 // *ListOtherContactsResponse.ServerResponse.Header or (if a response was
3800 // returned at all) in error.(*googleapi.Error).Header. Use
3801 // googleapi.IsNotModified to check whether the returned error was because
3802 // http.StatusNotModified was returned.
3803 func (c *OtherContactsListCall) Do(opts ...googleapi.CallOption) (*ListOtherContactsResponse, error) {
3804 gensupport.SetOptions(c.urlParams_, opts...)
3805 res, err := c.doRequest("json")
3806 if res != nil && res.StatusCode == http.StatusNotModified {
3807 if res.Body != nil {
3808 res.Body.Close()
3809 }
3810 return nil, gensupport.WrapError(&googleapi.Error{
3811 Code: res.StatusCode,
3812 Header: res.Header,
3813 })
3814 }
3815 if err != nil {
3816 return nil, err
3817 }
3818 defer googleapi.CloseBody(res)
3819 if err := googleapi.CheckResponse(res); err != nil {
3820 return nil, gensupport.WrapError(err)
3821 }
3822 ret := &ListOtherContactsResponse{
3823 ServerResponse: googleapi.ServerResponse{
3824 Header: res.Header,
3825 HTTPStatusCode: res.StatusCode,
3826 },
3827 }
3828 target := &ret
3829 b, err := gensupport.DecodeResponseBytes(target, res)
3830 if err != nil {
3831 return nil, err
3832 }
3833 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.otherContacts.list", "response", internallog.HTTPResponse(res, b))
3834 return ret, nil
3835 }
3836
3837 // Pages invokes f for each page of results.
3838 // A non-nil error returned from f will halt the iteration.
3839 // The provided context supersedes any context provided to the Context method.
3840 func (c *OtherContactsListCall) Pages(ctx context.Context, f func(*ListOtherContactsResponse) error) error {
3841 c.ctx_ = ctx
3842 defer c.PageToken(c.urlParams_.Get("pageToken"))
3843 for {
3844 x, err := c.Do()
3845 if err != nil {
3846 return err
3847 }
3848 if err := f(x); err != nil {
3849 return err
3850 }
3851 if x.NextPageToken == "" {
3852 return nil
3853 }
3854 c.PageToken(x.NextPageToken)
3855 }
3856 }
3857
3858 type OtherContactsSearchCall struct {
3859 s *Service
3860 urlParams_ gensupport.URLParams
3861 ifNoneMatch_ string
3862 ctx_ context.Context
3863 header_ http.Header
3864 }
3865
3866 // Search: Provides a list of contacts in the authenticated user's other
3867 // contacts that matches the search query. The query matches on a contact's
3868 // `names`, `emailAddresses`, and `phoneNumbers` fields that are from the
3869 // OTHER_CONTACT source. **IMPORTANT**: Before searching, clients should send a
3870 // warmup request with an empty query to update the cache. See
3871 // https://developers.google.com/people/v1/other-contacts#search_the_users_other_contacts
3872 func (r *OtherContactsService) Search() *OtherContactsSearchCall {
3873 c := &OtherContactsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3874 return c
3875 }
3876
3877 // PageSize sets the optional parameter "pageSize": The number of results to
3878 // return. Defaults to 10 if field is not set, or set to 0. Values greater than
3879 // 30 will be capped to 30.
3880 func (c *OtherContactsSearchCall) PageSize(pageSize int64) *OtherContactsSearchCall {
3881 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3882 return c
3883 }
3884
3885 // Query sets the optional parameter "query": Required. The plain-text query
3886 // for the request. The query is used to match prefix phrases of the fields on
3887 // a person. For example, a person with name "foo name" matches queries such as
3888 // "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".
3889 func (c *OtherContactsSearchCall) Query(query string) *OtherContactsSearchCall {
3890 c.urlParams_.Set("query", query)
3891 return c
3892 }
3893
3894 // ReadMask sets the optional parameter "readMask": Required. A field mask to
3895 // restrict which fields on each person are returned. Multiple fields can be
3896 // specified by separating them with commas. Valid values are: * emailAddresses
3897 // * metadata * names * phoneNumbers
3898 func (c *OtherContactsSearchCall) ReadMask(readMask string) *OtherContactsSearchCall {
3899 c.urlParams_.Set("readMask", readMask)
3900 return c
3901 }
3902
3903 // Fields allows partial responses to be retrieved. See
3904 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3905 // details.
3906 func (c *OtherContactsSearchCall) Fields(s ...googleapi.Field) *OtherContactsSearchCall {
3907 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3908 return c
3909 }
3910
3911 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3912 // object's ETag matches the given value. This is useful for getting updates
3913 // only after the object has changed since the last request.
3914 func (c *OtherContactsSearchCall) IfNoneMatch(entityTag string) *OtherContactsSearchCall {
3915 c.ifNoneMatch_ = entityTag
3916 return c
3917 }
3918
3919 // Context sets the context to be used in this call's Do method.
3920 func (c *OtherContactsSearchCall) Context(ctx context.Context) *OtherContactsSearchCall {
3921 c.ctx_ = ctx
3922 return c
3923 }
3924
3925 // Header returns a http.Header that can be modified by the caller to add
3926 // headers to the request.
3927 func (c *OtherContactsSearchCall) Header() http.Header {
3928 if c.header_ == nil {
3929 c.header_ = make(http.Header)
3930 }
3931 return c.header_
3932 }
3933
3934 func (c *OtherContactsSearchCall) doRequest(alt string) (*http.Response, error) {
3935 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3936 if c.ifNoneMatch_ != "" {
3937 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3938 }
3939 c.urlParams_.Set("alt", alt)
3940 c.urlParams_.Set("prettyPrint", "false")
3941 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/otherContacts:search")
3942 urls += "?" + c.urlParams_.Encode()
3943 req, err := http.NewRequest("GET", urls, nil)
3944 if err != nil {
3945 return nil, err
3946 }
3947 req.Header = reqHeaders
3948 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.otherContacts.search", "request", internallog.HTTPRequest(req, nil))
3949 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3950 }
3951
3952 // Do executes the "people.otherContacts.search" call.
3953 // Any non-2xx status code is an error. Response headers are in either
3954 // *SearchResponse.ServerResponse.Header or (if a response was returned at all)
3955 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3956 // whether the returned error was because http.StatusNotModified was returned.
3957 func (c *OtherContactsSearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error) {
3958 gensupport.SetOptions(c.urlParams_, opts...)
3959 res, err := c.doRequest("json")
3960 if res != nil && res.StatusCode == http.StatusNotModified {
3961 if res.Body != nil {
3962 res.Body.Close()
3963 }
3964 return nil, gensupport.WrapError(&googleapi.Error{
3965 Code: res.StatusCode,
3966 Header: res.Header,
3967 })
3968 }
3969 if err != nil {
3970 return nil, err
3971 }
3972 defer googleapi.CloseBody(res)
3973 if err := googleapi.CheckResponse(res); err != nil {
3974 return nil, gensupport.WrapError(err)
3975 }
3976 ret := &SearchResponse{
3977 ServerResponse: googleapi.ServerResponse{
3978 Header: res.Header,
3979 HTTPStatusCode: res.StatusCode,
3980 },
3981 }
3982 target := &ret
3983 b, err := gensupport.DecodeResponseBytes(target, res)
3984 if err != nil {
3985 return nil, err
3986 }
3987 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.otherContacts.search", "response", internallog.HTTPResponse(res, b))
3988 return ret, nil
3989 }
3990
3991 type PeopleBatchCreateContactsCall struct {
3992 s *Service
3993 batchcreatecontactsrequest *BatchCreateContactsRequest
3994 urlParams_ gensupport.URLParams
3995 ctx_ context.Context
3996 header_ http.Header
3997 }
3998
3999 // BatchCreateContacts: Create a batch of new contacts and return the
4000 // PersonResponses for the newly Mutate requests for the same user should be
4001 // sent sequentially to avoid increased latency and failures.
4002 func (r *PeopleService) BatchCreateContacts(batchcreatecontactsrequest *BatchCreateContactsRequest) *PeopleBatchCreateContactsCall {
4003 c := &PeopleBatchCreateContactsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4004 c.batchcreatecontactsrequest = batchcreatecontactsrequest
4005 return c
4006 }
4007
4008 // Fields allows partial responses to be retrieved. See
4009 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4010 // details.
4011 func (c *PeopleBatchCreateContactsCall) Fields(s ...googleapi.Field) *PeopleBatchCreateContactsCall {
4012 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4013 return c
4014 }
4015
4016 // Context sets the context to be used in this call's Do method.
4017 func (c *PeopleBatchCreateContactsCall) Context(ctx context.Context) *PeopleBatchCreateContactsCall {
4018 c.ctx_ = ctx
4019 return c
4020 }
4021
4022 // Header returns a http.Header that can be modified by the caller to add
4023 // headers to the request.
4024 func (c *PeopleBatchCreateContactsCall) Header() http.Header {
4025 if c.header_ == nil {
4026 c.header_ = make(http.Header)
4027 }
4028 return c.header_
4029 }
4030
4031 func (c *PeopleBatchCreateContactsCall) doRequest(alt string) (*http.Response, error) {
4032 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4033 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchcreatecontactsrequest)
4034 if err != nil {
4035 return nil, err
4036 }
4037 c.urlParams_.Set("alt", alt)
4038 c.urlParams_.Set("prettyPrint", "false")
4039 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchCreateContacts")
4040 urls += "?" + c.urlParams_.Encode()
4041 req, err := http.NewRequest("POST", urls, body)
4042 if err != nil {
4043 return nil, err
4044 }
4045 req.Header = reqHeaders
4046 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.batchCreateContacts", "request", internallog.HTTPRequest(req, body.Bytes()))
4047 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4048 }
4049
4050 // Do executes the "people.people.batchCreateContacts" call.
4051 // Any non-2xx status code is an error. Response headers are in either
4052 // *BatchCreateContactsResponse.ServerResponse.Header or (if a response was
4053 // returned at all) in error.(*googleapi.Error).Header. Use
4054 // googleapi.IsNotModified to check whether the returned error was because
4055 // http.StatusNotModified was returned.
4056 func (c *PeopleBatchCreateContactsCall) Do(opts ...googleapi.CallOption) (*BatchCreateContactsResponse, error) {
4057 gensupport.SetOptions(c.urlParams_, opts...)
4058 res, err := c.doRequest("json")
4059 if res != nil && res.StatusCode == http.StatusNotModified {
4060 if res.Body != nil {
4061 res.Body.Close()
4062 }
4063 return nil, gensupport.WrapError(&googleapi.Error{
4064 Code: res.StatusCode,
4065 Header: res.Header,
4066 })
4067 }
4068 if err != nil {
4069 return nil, err
4070 }
4071 defer googleapi.CloseBody(res)
4072 if err := googleapi.CheckResponse(res); err != nil {
4073 return nil, gensupport.WrapError(err)
4074 }
4075 ret := &BatchCreateContactsResponse{
4076 ServerResponse: googleapi.ServerResponse{
4077 Header: res.Header,
4078 HTTPStatusCode: res.StatusCode,
4079 },
4080 }
4081 target := &ret
4082 b, err := gensupport.DecodeResponseBytes(target, res)
4083 if err != nil {
4084 return nil, err
4085 }
4086 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.batchCreateContacts", "response", internallog.HTTPResponse(res, b))
4087 return ret, nil
4088 }
4089
4090 type PeopleBatchDeleteContactsCall struct {
4091 s *Service
4092 batchdeletecontactsrequest *BatchDeleteContactsRequest
4093 urlParams_ gensupport.URLParams
4094 ctx_ context.Context
4095 header_ http.Header
4096 }
4097
4098 // BatchDeleteContacts: Delete a batch of contacts. Any non-contact data will
4099 // not be deleted. Mutate requests for the same user should be sent
4100 // sequentially to avoid increased latency and failures.
4101 func (r *PeopleService) BatchDeleteContacts(batchdeletecontactsrequest *BatchDeleteContactsRequest) *PeopleBatchDeleteContactsCall {
4102 c := &PeopleBatchDeleteContactsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4103 c.batchdeletecontactsrequest = batchdeletecontactsrequest
4104 return c
4105 }
4106
4107 // Fields allows partial responses to be retrieved. See
4108 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4109 // details.
4110 func (c *PeopleBatchDeleteContactsCall) Fields(s ...googleapi.Field) *PeopleBatchDeleteContactsCall {
4111 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4112 return c
4113 }
4114
4115 // Context sets the context to be used in this call's Do method.
4116 func (c *PeopleBatchDeleteContactsCall) Context(ctx context.Context) *PeopleBatchDeleteContactsCall {
4117 c.ctx_ = ctx
4118 return c
4119 }
4120
4121 // Header returns a http.Header that can be modified by the caller to add
4122 // headers to the request.
4123 func (c *PeopleBatchDeleteContactsCall) Header() http.Header {
4124 if c.header_ == nil {
4125 c.header_ = make(http.Header)
4126 }
4127 return c.header_
4128 }
4129
4130 func (c *PeopleBatchDeleteContactsCall) doRequest(alt string) (*http.Response, error) {
4131 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4132 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletecontactsrequest)
4133 if err != nil {
4134 return nil, err
4135 }
4136 c.urlParams_.Set("alt", alt)
4137 c.urlParams_.Set("prettyPrint", "false")
4138 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchDeleteContacts")
4139 urls += "?" + c.urlParams_.Encode()
4140 req, err := http.NewRequest("POST", urls, body)
4141 if err != nil {
4142 return nil, err
4143 }
4144 req.Header = reqHeaders
4145 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.batchDeleteContacts", "request", internallog.HTTPRequest(req, body.Bytes()))
4146 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4147 }
4148
4149 // Do executes the "people.people.batchDeleteContacts" call.
4150 // Any non-2xx status code is an error. Response headers are in either
4151 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4152 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4153 // whether the returned error was because http.StatusNotModified was returned.
4154 func (c *PeopleBatchDeleteContactsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4155 gensupport.SetOptions(c.urlParams_, opts...)
4156 res, err := c.doRequest("json")
4157 if res != nil && res.StatusCode == http.StatusNotModified {
4158 if res.Body != nil {
4159 res.Body.Close()
4160 }
4161 return nil, gensupport.WrapError(&googleapi.Error{
4162 Code: res.StatusCode,
4163 Header: res.Header,
4164 })
4165 }
4166 if err != nil {
4167 return nil, err
4168 }
4169 defer googleapi.CloseBody(res)
4170 if err := googleapi.CheckResponse(res); err != nil {
4171 return nil, gensupport.WrapError(err)
4172 }
4173 ret := &Empty{
4174 ServerResponse: googleapi.ServerResponse{
4175 Header: res.Header,
4176 HTTPStatusCode: res.StatusCode,
4177 },
4178 }
4179 target := &ret
4180 b, err := gensupport.DecodeResponseBytes(target, res)
4181 if err != nil {
4182 return nil, err
4183 }
4184 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.batchDeleteContacts", "response", internallog.HTTPResponse(res, b))
4185 return ret, nil
4186 }
4187
4188 type PeopleBatchUpdateContactsCall struct {
4189 s *Service
4190 batchupdatecontactsrequest *BatchUpdateContactsRequest
4191 urlParams_ gensupport.URLParams
4192 ctx_ context.Context
4193 header_ http.Header
4194 }
4195
4196 // BatchUpdateContacts: Update a batch of contacts and return a map of resource
4197 // names to PersonResponses for the updated contacts. Mutate requests for the
4198 // same user should be sent sequentially to avoid increased latency and
4199 // failures.
4200 func (r *PeopleService) BatchUpdateContacts(batchupdatecontactsrequest *BatchUpdateContactsRequest) *PeopleBatchUpdateContactsCall {
4201 c := &PeopleBatchUpdateContactsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4202 c.batchupdatecontactsrequest = batchupdatecontactsrequest
4203 return c
4204 }
4205
4206 // Fields allows partial responses to be retrieved. See
4207 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4208 // details.
4209 func (c *PeopleBatchUpdateContactsCall) Fields(s ...googleapi.Field) *PeopleBatchUpdateContactsCall {
4210 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4211 return c
4212 }
4213
4214 // Context sets the context to be used in this call's Do method.
4215 func (c *PeopleBatchUpdateContactsCall) Context(ctx context.Context) *PeopleBatchUpdateContactsCall {
4216 c.ctx_ = ctx
4217 return c
4218 }
4219
4220 // Header returns a http.Header that can be modified by the caller to add
4221 // headers to the request.
4222 func (c *PeopleBatchUpdateContactsCall) Header() http.Header {
4223 if c.header_ == nil {
4224 c.header_ = make(http.Header)
4225 }
4226 return c.header_
4227 }
4228
4229 func (c *PeopleBatchUpdateContactsCall) doRequest(alt string) (*http.Response, error) {
4230 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4231 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatecontactsrequest)
4232 if err != nil {
4233 return nil, err
4234 }
4235 c.urlParams_.Set("alt", alt)
4236 c.urlParams_.Set("prettyPrint", "false")
4237 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchUpdateContacts")
4238 urls += "?" + c.urlParams_.Encode()
4239 req, err := http.NewRequest("POST", urls, body)
4240 if err != nil {
4241 return nil, err
4242 }
4243 req.Header = reqHeaders
4244 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.batchUpdateContacts", "request", internallog.HTTPRequest(req, body.Bytes()))
4245 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4246 }
4247
4248 // Do executes the "people.people.batchUpdateContacts" call.
4249 // Any non-2xx status code is an error. Response headers are in either
4250 // *BatchUpdateContactsResponse.ServerResponse.Header or (if a response was
4251 // returned at all) in error.(*googleapi.Error).Header. Use
4252 // googleapi.IsNotModified to check whether the returned error was because
4253 // http.StatusNotModified was returned.
4254 func (c *PeopleBatchUpdateContactsCall) Do(opts ...googleapi.CallOption) (*BatchUpdateContactsResponse, error) {
4255 gensupport.SetOptions(c.urlParams_, opts...)
4256 res, err := c.doRequest("json")
4257 if res != nil && res.StatusCode == http.StatusNotModified {
4258 if res.Body != nil {
4259 res.Body.Close()
4260 }
4261 return nil, gensupport.WrapError(&googleapi.Error{
4262 Code: res.StatusCode,
4263 Header: res.Header,
4264 })
4265 }
4266 if err != nil {
4267 return nil, err
4268 }
4269 defer googleapi.CloseBody(res)
4270 if err := googleapi.CheckResponse(res); err != nil {
4271 return nil, gensupport.WrapError(err)
4272 }
4273 ret := &BatchUpdateContactsResponse{
4274 ServerResponse: googleapi.ServerResponse{
4275 Header: res.Header,
4276 HTTPStatusCode: res.StatusCode,
4277 },
4278 }
4279 target := &ret
4280 b, err := gensupport.DecodeResponseBytes(target, res)
4281 if err != nil {
4282 return nil, err
4283 }
4284 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.batchUpdateContacts", "response", internallog.HTTPResponse(res, b))
4285 return ret, nil
4286 }
4287
4288 type PeopleCreateContactCall struct {
4289 s *Service
4290 person *Person
4291 urlParams_ gensupport.URLParams
4292 ctx_ context.Context
4293 header_ http.Header
4294 }
4295
4296 // CreateContact: Create a new contact and return the person resource for that
4297 // contact. The request returns a 400 error if more than one field is specified
4298 // on a field that is a singleton for contact sources: * biographies *
4299 // birthdays * genders * names Mutate requests for the same user should be sent
4300 // sequentially to avoid increased latency and failures.
4301 func (r *PeopleService) CreateContact(person *Person) *PeopleCreateContactCall {
4302 c := &PeopleCreateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4303 c.person = person
4304 return c
4305 }
4306
4307 // PersonFields sets the optional parameter "personFields": Required. A field
4308 // mask to restrict which fields on each person are returned. Multiple fields
4309 // can be specified by separating them with commas. Defaults to all fields if
4310 // not set. Valid values are: * addresses * ageRanges * biographies * birthdays
4311 // * calendarUrls * clientData * coverPhotos * emailAddresses * events *
4312 // externalIds * genders * imClients * interests * locales * locations *
4313 // memberships * metadata * miscKeywords * names * nicknames * occupations *
4314 // organizations * phoneNumbers * photos * relations * sipAddresses * skills *
4315 // urls * userDefined
4316 func (c *PeopleCreateContactCall) PersonFields(personFields string) *PeopleCreateContactCall {
4317 c.urlParams_.Set("personFields", personFields)
4318 return c
4319 }
4320
4321 // Sources sets the optional parameter "sources": A mask of what source types
4322 // to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE
4323 // if not set.
4324 //
4325 // Possible values:
4326 //
4327 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
4328 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
4329 //
4330 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
4331 //
4332 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
4333 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
4334 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
4335 func (c *PeopleCreateContactCall) Sources(sources ...string) *PeopleCreateContactCall {
4336 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
4337 return c
4338 }
4339
4340 // Fields allows partial responses to be retrieved. See
4341 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4342 // details.
4343 func (c *PeopleCreateContactCall) Fields(s ...googleapi.Field) *PeopleCreateContactCall {
4344 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4345 return c
4346 }
4347
4348 // Context sets the context to be used in this call's Do method.
4349 func (c *PeopleCreateContactCall) Context(ctx context.Context) *PeopleCreateContactCall {
4350 c.ctx_ = ctx
4351 return c
4352 }
4353
4354 // Header returns a http.Header that can be modified by the caller to add
4355 // headers to the request.
4356 func (c *PeopleCreateContactCall) Header() http.Header {
4357 if c.header_ == nil {
4358 c.header_ = make(http.Header)
4359 }
4360 return c.header_
4361 }
4362
4363 func (c *PeopleCreateContactCall) doRequest(alt string) (*http.Response, error) {
4364 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4365 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.person)
4366 if err != nil {
4367 return nil, err
4368 }
4369 c.urlParams_.Set("alt", alt)
4370 c.urlParams_.Set("prettyPrint", "false")
4371 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:createContact")
4372 urls += "?" + c.urlParams_.Encode()
4373 req, err := http.NewRequest("POST", urls, body)
4374 if err != nil {
4375 return nil, err
4376 }
4377 req.Header = reqHeaders
4378 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.createContact", "request", internallog.HTTPRequest(req, body.Bytes()))
4379 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4380 }
4381
4382 // Do executes the "people.people.createContact" call.
4383 // Any non-2xx status code is an error. Response headers are in either
4384 // *Person.ServerResponse.Header or (if a response was returned at all) in
4385 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4386 // whether the returned error was because http.StatusNotModified was returned.
4387 func (c *PeopleCreateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) {
4388 gensupport.SetOptions(c.urlParams_, opts...)
4389 res, err := c.doRequest("json")
4390 if res != nil && res.StatusCode == http.StatusNotModified {
4391 if res.Body != nil {
4392 res.Body.Close()
4393 }
4394 return nil, gensupport.WrapError(&googleapi.Error{
4395 Code: res.StatusCode,
4396 Header: res.Header,
4397 })
4398 }
4399 if err != nil {
4400 return nil, err
4401 }
4402 defer googleapi.CloseBody(res)
4403 if err := googleapi.CheckResponse(res); err != nil {
4404 return nil, gensupport.WrapError(err)
4405 }
4406 ret := &Person{
4407 ServerResponse: googleapi.ServerResponse{
4408 Header: res.Header,
4409 HTTPStatusCode: res.StatusCode,
4410 },
4411 }
4412 target := &ret
4413 b, err := gensupport.DecodeResponseBytes(target, res)
4414 if err != nil {
4415 return nil, err
4416 }
4417 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.createContact", "response", internallog.HTTPResponse(res, b))
4418 return ret, nil
4419 }
4420
4421 type PeopleDeleteContactCall struct {
4422 s *Service
4423 resourceName string
4424 urlParams_ gensupport.URLParams
4425 ctx_ context.Context
4426 header_ http.Header
4427 }
4428
4429 // DeleteContact: Delete a contact person. Any non-contact data will not be
4430 // deleted. Mutate requests for the same user should be sent sequentially to
4431 // avoid increased latency and failures.
4432 //
4433 // - resourceName: The resource name of the contact to delete.
4434 func (r *PeopleService) DeleteContact(resourceName string) *PeopleDeleteContactCall {
4435 c := &PeopleDeleteContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4436 c.resourceName = resourceName
4437 return c
4438 }
4439
4440 // Fields allows partial responses to be retrieved. See
4441 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4442 // details.
4443 func (c *PeopleDeleteContactCall) Fields(s ...googleapi.Field) *PeopleDeleteContactCall {
4444 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4445 return c
4446 }
4447
4448 // Context sets the context to be used in this call's Do method.
4449 func (c *PeopleDeleteContactCall) Context(ctx context.Context) *PeopleDeleteContactCall {
4450 c.ctx_ = ctx
4451 return c
4452 }
4453
4454 // Header returns a http.Header that can be modified by the caller to add
4455 // headers to the request.
4456 func (c *PeopleDeleteContactCall) Header() http.Header {
4457 if c.header_ == nil {
4458 c.header_ = make(http.Header)
4459 }
4460 return c.header_
4461 }
4462
4463 func (c *PeopleDeleteContactCall) doRequest(alt string) (*http.Response, error) {
4464 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4465 c.urlParams_.Set("alt", alt)
4466 c.urlParams_.Set("prettyPrint", "false")
4467 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContact")
4468 urls += "?" + c.urlParams_.Encode()
4469 req, err := http.NewRequest("DELETE", urls, nil)
4470 if err != nil {
4471 return nil, err
4472 }
4473 req.Header = reqHeaders
4474 googleapi.Expand(req.URL, map[string]string{
4475 "resourceName": c.resourceName,
4476 })
4477 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.deleteContact", "request", internallog.HTTPRequest(req, nil))
4478 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4479 }
4480
4481 // Do executes the "people.people.deleteContact" call.
4482 // Any non-2xx status code is an error. Response headers are in either
4483 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4484 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4485 // whether the returned error was because http.StatusNotModified was returned.
4486 func (c *PeopleDeleteContactCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4487 gensupport.SetOptions(c.urlParams_, opts...)
4488 res, err := c.doRequest("json")
4489 if res != nil && res.StatusCode == http.StatusNotModified {
4490 if res.Body != nil {
4491 res.Body.Close()
4492 }
4493 return nil, gensupport.WrapError(&googleapi.Error{
4494 Code: res.StatusCode,
4495 Header: res.Header,
4496 })
4497 }
4498 if err != nil {
4499 return nil, err
4500 }
4501 defer googleapi.CloseBody(res)
4502 if err := googleapi.CheckResponse(res); err != nil {
4503 return nil, gensupport.WrapError(err)
4504 }
4505 ret := &Empty{
4506 ServerResponse: googleapi.ServerResponse{
4507 Header: res.Header,
4508 HTTPStatusCode: res.StatusCode,
4509 },
4510 }
4511 target := &ret
4512 b, err := gensupport.DecodeResponseBytes(target, res)
4513 if err != nil {
4514 return nil, err
4515 }
4516 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.deleteContact", "response", internallog.HTTPResponse(res, b))
4517 return ret, nil
4518 }
4519
4520 type PeopleDeleteContactPhotoCall struct {
4521 s *Service
4522 resourceName string
4523 urlParams_ gensupport.URLParams
4524 ctx_ context.Context
4525 header_ http.Header
4526 }
4527
4528 // DeleteContactPhoto: Delete a contact's photo. Mutate requests for the same
4529 // user should be done sequentially to avoid // lock contention.
4530 //
4531 // - resourceName: The resource name of the contact whose photo will be
4532 // deleted.
4533 func (r *PeopleService) DeleteContactPhoto(resourceName string) *PeopleDeleteContactPhotoCall {
4534 c := &PeopleDeleteContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4535 c.resourceName = resourceName
4536 return c
4537 }
4538
4539 // PersonFields sets the optional parameter "personFields": A field mask to
4540 // restrict which fields on the person are returned. Multiple fields can be
4541 // specified by separating them with commas. Defaults to empty if not set,
4542 // which will skip the post mutate get. Valid values are: * addresses *
4543 // ageRanges * biographies * birthdays * calendarUrls * clientData *
4544 // coverPhotos * emailAddresses * events * externalIds * genders * imClients *
4545 // interests * locales * locations * memberships * metadata * miscKeywords *
4546 // names * nicknames * occupations * organizations * phoneNumbers * photos *
4547 // relations * sipAddresses * skills * urls * userDefined
4548 func (c *PeopleDeleteContactPhotoCall) PersonFields(personFields string) *PeopleDeleteContactPhotoCall {
4549 c.urlParams_.Set("personFields", personFields)
4550 return c
4551 }
4552
4553 // Sources sets the optional parameter "sources": A mask of what source types
4554 // to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE
4555 // if not set.
4556 //
4557 // Possible values:
4558 //
4559 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
4560 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
4561 //
4562 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
4563 //
4564 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
4565 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
4566 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
4567 func (c *PeopleDeleteContactPhotoCall) Sources(sources ...string) *PeopleDeleteContactPhotoCall {
4568 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
4569 return c
4570 }
4571
4572 // Fields allows partial responses to be retrieved. See
4573 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4574 // details.
4575 func (c *PeopleDeleteContactPhotoCall) Fields(s ...googleapi.Field) *PeopleDeleteContactPhotoCall {
4576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4577 return c
4578 }
4579
4580 // Context sets the context to be used in this call's Do method.
4581 func (c *PeopleDeleteContactPhotoCall) Context(ctx context.Context) *PeopleDeleteContactPhotoCall {
4582 c.ctx_ = ctx
4583 return c
4584 }
4585
4586 // Header returns a http.Header that can be modified by the caller to add
4587 // headers to the request.
4588 func (c *PeopleDeleteContactPhotoCall) Header() http.Header {
4589 if c.header_ == nil {
4590 c.header_ = make(http.Header)
4591 }
4592 return c.header_
4593 }
4594
4595 func (c *PeopleDeleteContactPhotoCall) doRequest(alt string) (*http.Response, error) {
4596 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4597 c.urlParams_.Set("alt", alt)
4598 c.urlParams_.Set("prettyPrint", "false")
4599 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContactPhoto")
4600 urls += "?" + c.urlParams_.Encode()
4601 req, err := http.NewRequest("DELETE", urls, nil)
4602 if err != nil {
4603 return nil, err
4604 }
4605 req.Header = reqHeaders
4606 googleapi.Expand(req.URL, map[string]string{
4607 "resourceName": c.resourceName,
4608 })
4609 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.deleteContactPhoto", "request", internallog.HTTPRequest(req, nil))
4610 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4611 }
4612
4613 // Do executes the "people.people.deleteContactPhoto" call.
4614 // Any non-2xx status code is an error. Response headers are in either
4615 // *DeleteContactPhotoResponse.ServerResponse.Header or (if a response was
4616 // returned at all) in error.(*googleapi.Error).Header. Use
4617 // googleapi.IsNotModified to check whether the returned error was because
4618 // http.StatusNotModified was returned.
4619 func (c *PeopleDeleteContactPhotoCall) Do(opts ...googleapi.CallOption) (*DeleteContactPhotoResponse, error) {
4620 gensupport.SetOptions(c.urlParams_, opts...)
4621 res, err := c.doRequest("json")
4622 if res != nil && res.StatusCode == http.StatusNotModified {
4623 if res.Body != nil {
4624 res.Body.Close()
4625 }
4626 return nil, gensupport.WrapError(&googleapi.Error{
4627 Code: res.StatusCode,
4628 Header: res.Header,
4629 })
4630 }
4631 if err != nil {
4632 return nil, err
4633 }
4634 defer googleapi.CloseBody(res)
4635 if err := googleapi.CheckResponse(res); err != nil {
4636 return nil, gensupport.WrapError(err)
4637 }
4638 ret := &DeleteContactPhotoResponse{
4639 ServerResponse: googleapi.ServerResponse{
4640 Header: res.Header,
4641 HTTPStatusCode: res.StatusCode,
4642 },
4643 }
4644 target := &ret
4645 b, err := gensupport.DecodeResponseBytes(target, res)
4646 if err != nil {
4647 return nil, err
4648 }
4649 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.deleteContactPhoto", "response", internallog.HTTPResponse(res, b))
4650 return ret, nil
4651 }
4652
4653 type PeopleGetCall struct {
4654 s *Service
4655 resourceName string
4656 urlParams_ gensupport.URLParams
4657 ifNoneMatch_ string
4658 ctx_ context.Context
4659 header_ http.Header
4660 }
4661
4662 // Get: Provides information about a person by specifying a resource name. Use
4663 // `people/me` to indicate the authenticated user. The request returns a 400
4664 // error if 'personFields' is not specified.
4665 //
4666 // - resourceName: The resource name of the person to provide information
4667 // about. - To get information about the authenticated user, specify
4668 // `people/me`. - To get information about a google account, specify
4669 // `people/{account_id}`. - To get information about a contact, specify the
4670 // resource name that identifies the contact as returned by
4671 // `people.connections.list`.
4672 func (r *PeopleService) Get(resourceName string) *PeopleGetCall {
4673 c := &PeopleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4674 c.resourceName = resourceName
4675 return c
4676 }
4677
4678 // PersonFields sets the optional parameter "personFields": Required. A field
4679 // mask to restrict which fields on the person are returned. Multiple fields
4680 // can be specified by separating them with commas. Valid values are: *
4681 // addresses * ageRanges * biographies * birthdays * calendarUrls * clientData
4682 // * coverPhotos * emailAddresses * events * externalIds * genders * imClients
4683 // * interests * locales * locations * memberships * metadata * miscKeywords *
4684 // names * nicknames * occupations * organizations * phoneNumbers * photos *
4685 // relations * sipAddresses * skills * urls * userDefined
4686 func (c *PeopleGetCall) PersonFields(personFields string) *PeopleGetCall {
4687 c.urlParams_.Set("personFields", personFields)
4688 return c
4689 }
4690
4691 // RequestMaskIncludeField sets the optional parameter
4692 // "requestMask.includeField": Required. Comma-separated list of person fields
4693 // to be included in the response. Each path should start with `person.`: for
4694 // example, `person.names` or `person.photos`.
4695 func (c *PeopleGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetCall {
4696 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
4697 return c
4698 }
4699
4700 // Sources sets the optional parameter "sources": A mask of what source types
4701 // to return. Defaults to READ_SOURCE_TYPE_PROFILE and READ_SOURCE_TYPE_CONTACT
4702 // if not set.
4703 //
4704 // Possible values:
4705 //
4706 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
4707 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
4708 //
4709 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
4710 //
4711 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
4712 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
4713 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
4714 func (c *PeopleGetCall) Sources(sources ...string) *PeopleGetCall {
4715 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
4716 return c
4717 }
4718
4719 // Fields allows partial responses to be retrieved. See
4720 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4721 // details.
4722 func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall {
4723 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4724 return c
4725 }
4726
4727 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4728 // object's ETag matches the given value. This is useful for getting updates
4729 // only after the object has changed since the last request.
4730 func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall {
4731 c.ifNoneMatch_ = entityTag
4732 return c
4733 }
4734
4735 // Context sets the context to be used in this call's Do method.
4736 func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall {
4737 c.ctx_ = ctx
4738 return c
4739 }
4740
4741 // Header returns a http.Header that can be modified by the caller to add
4742 // headers to the request.
4743 func (c *PeopleGetCall) Header() http.Header {
4744 if c.header_ == nil {
4745 c.header_ = make(http.Header)
4746 }
4747 return c.header_
4748 }
4749
4750 func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) {
4751 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4752 if c.ifNoneMatch_ != "" {
4753 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4754 }
4755 c.urlParams_.Set("alt", alt)
4756 c.urlParams_.Set("prettyPrint", "false")
4757 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
4758 urls += "?" + c.urlParams_.Encode()
4759 req, err := http.NewRequest("GET", urls, nil)
4760 if err != nil {
4761 return nil, err
4762 }
4763 req.Header = reqHeaders
4764 googleapi.Expand(req.URL, map[string]string{
4765 "resourceName": c.resourceName,
4766 })
4767 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.get", "request", internallog.HTTPRequest(req, nil))
4768 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4769 }
4770
4771 // Do executes the "people.people.get" call.
4772 // Any non-2xx status code is an error. Response headers are in either
4773 // *Person.ServerResponse.Header or (if a response was returned at all) in
4774 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4775 // whether the returned error was because http.StatusNotModified was returned.
4776 func (c *PeopleGetCall) Do(opts ...googleapi.CallOption) (*Person, error) {
4777 gensupport.SetOptions(c.urlParams_, opts...)
4778 res, err := c.doRequest("json")
4779 if res != nil && res.StatusCode == http.StatusNotModified {
4780 if res.Body != nil {
4781 res.Body.Close()
4782 }
4783 return nil, gensupport.WrapError(&googleapi.Error{
4784 Code: res.StatusCode,
4785 Header: res.Header,
4786 })
4787 }
4788 if err != nil {
4789 return nil, err
4790 }
4791 defer googleapi.CloseBody(res)
4792 if err := googleapi.CheckResponse(res); err != nil {
4793 return nil, gensupport.WrapError(err)
4794 }
4795 ret := &Person{
4796 ServerResponse: googleapi.ServerResponse{
4797 Header: res.Header,
4798 HTTPStatusCode: res.StatusCode,
4799 },
4800 }
4801 target := &ret
4802 b, err := gensupport.DecodeResponseBytes(target, res)
4803 if err != nil {
4804 return nil, err
4805 }
4806 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.get", "response", internallog.HTTPResponse(res, b))
4807 return ret, nil
4808 }
4809
4810 type PeopleGetBatchGetCall struct {
4811 s *Service
4812 urlParams_ gensupport.URLParams
4813 ifNoneMatch_ string
4814 ctx_ context.Context
4815 header_ http.Header
4816 }
4817
4818 // GetBatchGet: Provides information about a list of specific people by
4819 // specifying a list of requested resource names. Use `people/me` to indicate
4820 // the authenticated user. The request returns a 400 error if 'personFields' is
4821 // not specified.
4822 func (r *PeopleService) GetBatchGet() *PeopleGetBatchGetCall {
4823 c := &PeopleGetBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4824 return c
4825 }
4826
4827 // PersonFields sets the optional parameter "personFields": Required. A field
4828 // mask to restrict which fields on each person are returned. Multiple fields
4829 // can be specified by separating them with commas. Valid values are: *
4830 // addresses * ageRanges * biographies * birthdays * calendarUrls * clientData
4831 // * coverPhotos * emailAddresses * events * externalIds * genders * imClients
4832 // * interests * locales * locations * memberships * metadata * miscKeywords *
4833 // names * nicknames * occupations * organizations * phoneNumbers * photos *
4834 // relations * sipAddresses * skills * urls * userDefined
4835 func (c *PeopleGetBatchGetCall) PersonFields(personFields string) *PeopleGetBatchGetCall {
4836 c.urlParams_.Set("personFields", personFields)
4837 return c
4838 }
4839
4840 // RequestMaskIncludeField sets the optional parameter
4841 // "requestMask.includeField": Required. Comma-separated list of person fields
4842 // to be included in the response. Each path should start with `person.`: for
4843 // example, `person.names` or `person.photos`.
4844 func (c *PeopleGetBatchGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetBatchGetCall {
4845 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
4846 return c
4847 }
4848
4849 // ResourceNames sets the optional parameter "resourceNames": Required. The
4850 // resource names of the people to provide information about. It's repeatable.
4851 // The URL query parameter should be
4852 // resourceNames=<name1>&resourceNames=<name2>&... - To get information about
4853 // the authenticated user, specify `people/me`. - To get information about a
4854 // google account, specify `people/{account_id}`. - To get information about a
4855 // contact, specify the resource name that identifies the contact as returned
4856 // by `people.connections.list`. There is a maximum of 200 resource names.
4857 func (c *PeopleGetBatchGetCall) ResourceNames(resourceNames ...string) *PeopleGetBatchGetCall {
4858 c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
4859 return c
4860 }
4861
4862 // Sources sets the optional parameter "sources": A mask of what source types
4863 // to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE
4864 // if not set.
4865 //
4866 // Possible values:
4867 //
4868 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
4869 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
4870 //
4871 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
4872 //
4873 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
4874 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
4875 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
4876 func (c *PeopleGetBatchGetCall) Sources(sources ...string) *PeopleGetBatchGetCall {
4877 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
4878 return c
4879 }
4880
4881 // Fields allows partial responses to be retrieved. See
4882 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4883 // details.
4884 func (c *PeopleGetBatchGetCall) Fields(s ...googleapi.Field) *PeopleGetBatchGetCall {
4885 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4886 return c
4887 }
4888
4889 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4890 // object's ETag matches the given value. This is useful for getting updates
4891 // only after the object has changed since the last request.
4892 func (c *PeopleGetBatchGetCall) IfNoneMatch(entityTag string) *PeopleGetBatchGetCall {
4893 c.ifNoneMatch_ = entityTag
4894 return c
4895 }
4896
4897 // Context sets the context to be used in this call's Do method.
4898 func (c *PeopleGetBatchGetCall) Context(ctx context.Context) *PeopleGetBatchGetCall {
4899 c.ctx_ = ctx
4900 return c
4901 }
4902
4903 // Header returns a http.Header that can be modified by the caller to add
4904 // headers to the request.
4905 func (c *PeopleGetBatchGetCall) Header() http.Header {
4906 if c.header_ == nil {
4907 c.header_ = make(http.Header)
4908 }
4909 return c.header_
4910 }
4911
4912 func (c *PeopleGetBatchGetCall) doRequest(alt string) (*http.Response, error) {
4913 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4914 if c.ifNoneMatch_ != "" {
4915 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4916 }
4917 c.urlParams_.Set("alt", alt)
4918 c.urlParams_.Set("prettyPrint", "false")
4919 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchGet")
4920 urls += "?" + c.urlParams_.Encode()
4921 req, err := http.NewRequest("GET", urls, nil)
4922 if err != nil {
4923 return nil, err
4924 }
4925 req.Header = reqHeaders
4926 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.getBatchGet", "request", internallog.HTTPRequest(req, nil))
4927 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4928 }
4929
4930 // Do executes the "people.people.getBatchGet" call.
4931 // Any non-2xx status code is an error. Response headers are in either
4932 // *GetPeopleResponse.ServerResponse.Header or (if a response was returned at
4933 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4934 // check whether the returned error was because http.StatusNotModified was
4935 // returned.
4936 func (c *PeopleGetBatchGetCall) Do(opts ...googleapi.CallOption) (*GetPeopleResponse, error) {
4937 gensupport.SetOptions(c.urlParams_, opts...)
4938 res, err := c.doRequest("json")
4939 if res != nil && res.StatusCode == http.StatusNotModified {
4940 if res.Body != nil {
4941 res.Body.Close()
4942 }
4943 return nil, gensupport.WrapError(&googleapi.Error{
4944 Code: res.StatusCode,
4945 Header: res.Header,
4946 })
4947 }
4948 if err != nil {
4949 return nil, err
4950 }
4951 defer googleapi.CloseBody(res)
4952 if err := googleapi.CheckResponse(res); err != nil {
4953 return nil, gensupport.WrapError(err)
4954 }
4955 ret := &GetPeopleResponse{
4956 ServerResponse: googleapi.ServerResponse{
4957 Header: res.Header,
4958 HTTPStatusCode: res.StatusCode,
4959 },
4960 }
4961 target := &ret
4962 b, err := gensupport.DecodeResponseBytes(target, res)
4963 if err != nil {
4964 return nil, err
4965 }
4966 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.getBatchGet", "response", internallog.HTTPResponse(res, b))
4967 return ret, nil
4968 }
4969
4970 type PeopleListDirectoryPeopleCall struct {
4971 s *Service
4972 urlParams_ gensupport.URLParams
4973 ifNoneMatch_ string
4974 ctx_ context.Context
4975 header_ http.Header
4976 }
4977
4978 // ListDirectoryPeople: Provides a list of domain profiles and domain contacts
4979 // in the authenticated user's domain directory. When the `sync_token` is
4980 // specified, resources deleted since the last sync will be returned as a
4981 // person with `PersonMetadata.deleted` set to true. When the `page_token` or
4982 // `sync_token` is specified, all other request parameters must match the first
4983 // call. Writes may have a propagation delay of several minutes for sync
4984 // requests. Incremental syncs are not intended for read-after-write use cases.
4985 // See example usage at List the directory people that have changed
4986 // (/people/v1/directory#list_the_directory_people_that_have_changed).
4987 func (r *PeopleService) ListDirectoryPeople() *PeopleListDirectoryPeopleCall {
4988 c := &PeopleListDirectoryPeopleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4989 return c
4990 }
4991
4992 // MergeSources sets the optional parameter "mergeSources": Additional data to
4993 // merge into the directory sources if they are connected through verified join
4994 // keys such as email addresses or phone numbers.
4995 //
4996 // Possible values:
4997 //
4998 // "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
4999 // "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" - User owned contact.
5000 func (c *PeopleListDirectoryPeopleCall) MergeSources(mergeSources ...string) *PeopleListDirectoryPeopleCall {
5001 c.urlParams_.SetMulti("mergeSources", append([]string{}, mergeSources...))
5002 return c
5003 }
5004
5005 // PageSize sets the optional parameter "pageSize": The number of people to
5006 // include in the response. Valid values are between 1 and 1000, inclusive.
5007 // Defaults to 100 if not set or set to 0.
5008 func (c *PeopleListDirectoryPeopleCall) PageSize(pageSize int64) *PeopleListDirectoryPeopleCall {
5009 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5010 return c
5011 }
5012
5013 // PageToken sets the optional parameter "pageToken": A page token, received
5014 // from a previous response `next_page_token`. Provide this to retrieve the
5015 // subsequent page. When paginating, all other parameters provided to
5016 // `people.listDirectoryPeople` must match the first call that provided the
5017 // page token.
5018 func (c *PeopleListDirectoryPeopleCall) PageToken(pageToken string) *PeopleListDirectoryPeopleCall {
5019 c.urlParams_.Set("pageToken", pageToken)
5020 return c
5021 }
5022
5023 // ReadMask sets the optional parameter "readMask": Required. A field mask to
5024 // restrict which fields on each person are returned. Multiple fields can be
5025 // specified by separating them with commas. Valid values are: * addresses *
5026 // ageRanges * biographies * birthdays * calendarUrls * clientData *
5027 // coverPhotos * emailAddresses * events * externalIds * genders * imClients *
5028 // interests * locales * locations * memberships * metadata * miscKeywords *
5029 // names * nicknames * occupations * organizations * phoneNumbers * photos *
5030 // relations * sipAddresses * skills * urls * userDefined
5031 func (c *PeopleListDirectoryPeopleCall) ReadMask(readMask string) *PeopleListDirectoryPeopleCall {
5032 c.urlParams_.Set("readMask", readMask)
5033 return c
5034 }
5035
5036 // RequestSyncToken sets the optional parameter "requestSyncToken": Whether the
5037 // response should return `next_sync_token`. It can be used to get incremental
5038 // changes since the last request by setting it on the request `sync_token`.
5039 // More details about sync behavior at `people.listDirectoryPeople`.
5040 func (c *PeopleListDirectoryPeopleCall) RequestSyncToken(requestSyncToken bool) *PeopleListDirectoryPeopleCall {
5041 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken))
5042 return c
5043 }
5044
5045 // Sources sets the optional parameter "sources": Required. Directory sources
5046 // to return.
5047 //
5048 // Possible values:
5049 //
5050 // "DIRECTORY_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5051 // "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT" - Google Workspace domain shared
5052 //
5053 // contact.
5054 //
5055 // "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" - Google Workspace domain profile.
5056 func (c *PeopleListDirectoryPeopleCall) Sources(sources ...string) *PeopleListDirectoryPeopleCall {
5057 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
5058 return c
5059 }
5060
5061 // SyncToken sets the optional parameter "syncToken": A sync token, received
5062 // from a previous response `next_sync_token` Provide this to retrieve only the
5063 // resources changed since the last request. When syncing, all other parameters
5064 // provided to `people.listDirectoryPeople` must match the first call that
5065 // provided the sync token. More details about sync behavior at
5066 // `people.listDirectoryPeople`.
5067 func (c *PeopleListDirectoryPeopleCall) SyncToken(syncToken string) *PeopleListDirectoryPeopleCall {
5068 c.urlParams_.Set("syncToken", syncToken)
5069 return c
5070 }
5071
5072 // Fields allows partial responses to be retrieved. See
5073 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5074 // details.
5075 func (c *PeopleListDirectoryPeopleCall) Fields(s ...googleapi.Field) *PeopleListDirectoryPeopleCall {
5076 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5077 return c
5078 }
5079
5080 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5081 // object's ETag matches the given value. This is useful for getting updates
5082 // only after the object has changed since the last request.
5083 func (c *PeopleListDirectoryPeopleCall) IfNoneMatch(entityTag string) *PeopleListDirectoryPeopleCall {
5084 c.ifNoneMatch_ = entityTag
5085 return c
5086 }
5087
5088 // Context sets the context to be used in this call's Do method.
5089 func (c *PeopleListDirectoryPeopleCall) Context(ctx context.Context) *PeopleListDirectoryPeopleCall {
5090 c.ctx_ = ctx
5091 return c
5092 }
5093
5094 // Header returns a http.Header that can be modified by the caller to add
5095 // headers to the request.
5096 func (c *PeopleListDirectoryPeopleCall) Header() http.Header {
5097 if c.header_ == nil {
5098 c.header_ = make(http.Header)
5099 }
5100 return c.header_
5101 }
5102
5103 func (c *PeopleListDirectoryPeopleCall) doRequest(alt string) (*http.Response, error) {
5104 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5105 if c.ifNoneMatch_ != "" {
5106 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5107 }
5108 c.urlParams_.Set("alt", alt)
5109 c.urlParams_.Set("prettyPrint", "false")
5110 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:listDirectoryPeople")
5111 urls += "?" + c.urlParams_.Encode()
5112 req, err := http.NewRequest("GET", urls, nil)
5113 if err != nil {
5114 return nil, err
5115 }
5116 req.Header = reqHeaders
5117 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.listDirectoryPeople", "request", internallog.HTTPRequest(req, nil))
5118 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5119 }
5120
5121 // Do executes the "people.people.listDirectoryPeople" call.
5122 // Any non-2xx status code is an error. Response headers are in either
5123 // *ListDirectoryPeopleResponse.ServerResponse.Header or (if a response was
5124 // returned at all) in error.(*googleapi.Error).Header. Use
5125 // googleapi.IsNotModified to check whether the returned error was because
5126 // http.StatusNotModified was returned.
5127 func (c *PeopleListDirectoryPeopleCall) Do(opts ...googleapi.CallOption) (*ListDirectoryPeopleResponse, error) {
5128 gensupport.SetOptions(c.urlParams_, opts...)
5129 res, err := c.doRequest("json")
5130 if res != nil && res.StatusCode == http.StatusNotModified {
5131 if res.Body != nil {
5132 res.Body.Close()
5133 }
5134 return nil, gensupport.WrapError(&googleapi.Error{
5135 Code: res.StatusCode,
5136 Header: res.Header,
5137 })
5138 }
5139 if err != nil {
5140 return nil, err
5141 }
5142 defer googleapi.CloseBody(res)
5143 if err := googleapi.CheckResponse(res); err != nil {
5144 return nil, gensupport.WrapError(err)
5145 }
5146 ret := &ListDirectoryPeopleResponse{
5147 ServerResponse: googleapi.ServerResponse{
5148 Header: res.Header,
5149 HTTPStatusCode: res.StatusCode,
5150 },
5151 }
5152 target := &ret
5153 b, err := gensupport.DecodeResponseBytes(target, res)
5154 if err != nil {
5155 return nil, err
5156 }
5157 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.listDirectoryPeople", "response", internallog.HTTPResponse(res, b))
5158 return ret, nil
5159 }
5160
5161 // Pages invokes f for each page of results.
5162 // A non-nil error returned from f will halt the iteration.
5163 // The provided context supersedes any context provided to the Context method.
5164 func (c *PeopleListDirectoryPeopleCall) Pages(ctx context.Context, f func(*ListDirectoryPeopleResponse) error) error {
5165 c.ctx_ = ctx
5166 defer c.PageToken(c.urlParams_.Get("pageToken"))
5167 for {
5168 x, err := c.Do()
5169 if err != nil {
5170 return err
5171 }
5172 if err := f(x); err != nil {
5173 return err
5174 }
5175 if x.NextPageToken == "" {
5176 return nil
5177 }
5178 c.PageToken(x.NextPageToken)
5179 }
5180 }
5181
5182 type PeopleSearchContactsCall struct {
5183 s *Service
5184 urlParams_ gensupport.URLParams
5185 ifNoneMatch_ string
5186 ctx_ context.Context
5187 header_ http.Header
5188 }
5189
5190 // SearchContacts: Provides a list of contacts in the authenticated user's
5191 // grouped contacts that matches the search query. The query matches on a
5192 // contact's `names`, `nickNames`, `emailAddresses`, `phoneNumbers`, and
5193 // `organizations` fields that are from the CONTACT source. **IMPORTANT**:
5194 // Before searching, clients should send a warmup request with an empty query
5195 // to update the cache. See
5196 // https://developers.google.com/people/v1/contacts#search_the_users_contacts
5197 func (r *PeopleService) SearchContacts() *PeopleSearchContactsCall {
5198 c := &PeopleSearchContactsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5199 return c
5200 }
5201
5202 // PageSize sets the optional parameter "pageSize": The number of results to
5203 // return. Defaults to 10 if field is not set, or set to 0. Values greater than
5204 // 30 will be capped to 30.
5205 func (c *PeopleSearchContactsCall) PageSize(pageSize int64) *PeopleSearchContactsCall {
5206 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5207 return c
5208 }
5209
5210 // Query sets the optional parameter "query": Required. The plain-text query
5211 // for the request. The query is used to match prefix phrases of the fields on
5212 // a person. For example, a person with name "foo name" matches queries such as
5213 // "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".
5214 func (c *PeopleSearchContactsCall) Query(query string) *PeopleSearchContactsCall {
5215 c.urlParams_.Set("query", query)
5216 return c
5217 }
5218
5219 // ReadMask sets the optional parameter "readMask": Required. A field mask to
5220 // restrict which fields on each person are returned. Multiple fields can be
5221 // specified by separating them with commas. Valid values are: * addresses *
5222 // ageRanges * biographies * birthdays * calendarUrls * clientData *
5223 // coverPhotos * emailAddresses * events * externalIds * genders * imClients *
5224 // interests * locales * locations * memberships * metadata * miscKeywords *
5225 // names * nicknames * occupations * organizations * phoneNumbers * photos *
5226 // relations * sipAddresses * skills * urls * userDefined
5227 func (c *PeopleSearchContactsCall) ReadMask(readMask string) *PeopleSearchContactsCall {
5228 c.urlParams_.Set("readMask", readMask)
5229 return c
5230 }
5231
5232 // Sources sets the optional parameter "sources": A mask of what source types
5233 // to return. Defaults to READ_SOURCE_TYPE_CONTACT if not set.
5234 //
5235 // Possible values:
5236 //
5237 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5238 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
5239 //
5240 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
5241 //
5242 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
5243 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
5244 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
5245 func (c *PeopleSearchContactsCall) Sources(sources ...string) *PeopleSearchContactsCall {
5246 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
5247 return c
5248 }
5249
5250 // Fields allows partial responses to be retrieved. See
5251 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5252 // details.
5253 func (c *PeopleSearchContactsCall) Fields(s ...googleapi.Field) *PeopleSearchContactsCall {
5254 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5255 return c
5256 }
5257
5258 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5259 // object's ETag matches the given value. This is useful for getting updates
5260 // only after the object has changed since the last request.
5261 func (c *PeopleSearchContactsCall) IfNoneMatch(entityTag string) *PeopleSearchContactsCall {
5262 c.ifNoneMatch_ = entityTag
5263 return c
5264 }
5265
5266 // Context sets the context to be used in this call's Do method.
5267 func (c *PeopleSearchContactsCall) Context(ctx context.Context) *PeopleSearchContactsCall {
5268 c.ctx_ = ctx
5269 return c
5270 }
5271
5272 // Header returns a http.Header that can be modified by the caller to add
5273 // headers to the request.
5274 func (c *PeopleSearchContactsCall) Header() http.Header {
5275 if c.header_ == nil {
5276 c.header_ = make(http.Header)
5277 }
5278 return c.header_
5279 }
5280
5281 func (c *PeopleSearchContactsCall) doRequest(alt string) (*http.Response, error) {
5282 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5283 if c.ifNoneMatch_ != "" {
5284 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5285 }
5286 c.urlParams_.Set("alt", alt)
5287 c.urlParams_.Set("prettyPrint", "false")
5288 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:searchContacts")
5289 urls += "?" + c.urlParams_.Encode()
5290 req, err := http.NewRequest("GET", urls, nil)
5291 if err != nil {
5292 return nil, err
5293 }
5294 req.Header = reqHeaders
5295 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.searchContacts", "request", internallog.HTTPRequest(req, nil))
5296 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5297 }
5298
5299 // Do executes the "people.people.searchContacts" call.
5300 // Any non-2xx status code is an error. Response headers are in either
5301 // *SearchResponse.ServerResponse.Header or (if a response was returned at all)
5302 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5303 // whether the returned error was because http.StatusNotModified was returned.
5304 func (c *PeopleSearchContactsCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error) {
5305 gensupport.SetOptions(c.urlParams_, opts...)
5306 res, err := c.doRequest("json")
5307 if res != nil && res.StatusCode == http.StatusNotModified {
5308 if res.Body != nil {
5309 res.Body.Close()
5310 }
5311 return nil, gensupport.WrapError(&googleapi.Error{
5312 Code: res.StatusCode,
5313 Header: res.Header,
5314 })
5315 }
5316 if err != nil {
5317 return nil, err
5318 }
5319 defer googleapi.CloseBody(res)
5320 if err := googleapi.CheckResponse(res); err != nil {
5321 return nil, gensupport.WrapError(err)
5322 }
5323 ret := &SearchResponse{
5324 ServerResponse: googleapi.ServerResponse{
5325 Header: res.Header,
5326 HTTPStatusCode: res.StatusCode,
5327 },
5328 }
5329 target := &ret
5330 b, err := gensupport.DecodeResponseBytes(target, res)
5331 if err != nil {
5332 return nil, err
5333 }
5334 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.searchContacts", "response", internallog.HTTPResponse(res, b))
5335 return ret, nil
5336 }
5337
5338 type PeopleSearchDirectoryPeopleCall struct {
5339 s *Service
5340 urlParams_ gensupport.URLParams
5341 ifNoneMatch_ string
5342 ctx_ context.Context
5343 header_ http.Header
5344 }
5345
5346 // SearchDirectoryPeople: Provides a list of domain profiles and domain
5347 // contacts in the authenticated user's domain directory that match the search
5348 // query.
5349 func (r *PeopleService) SearchDirectoryPeople() *PeopleSearchDirectoryPeopleCall {
5350 c := &PeopleSearchDirectoryPeopleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5351 return c
5352 }
5353
5354 // MergeSources sets the optional parameter "mergeSources": Additional data to
5355 // merge into the directory sources if they are connected through verified join
5356 // keys such as email addresses or phone numbers.
5357 //
5358 // Possible values:
5359 //
5360 // "DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5361 // "DIRECTORY_MERGE_SOURCE_TYPE_CONTACT" - User owned contact.
5362 func (c *PeopleSearchDirectoryPeopleCall) MergeSources(mergeSources ...string) *PeopleSearchDirectoryPeopleCall {
5363 c.urlParams_.SetMulti("mergeSources", append([]string{}, mergeSources...))
5364 return c
5365 }
5366
5367 // PageSize sets the optional parameter "pageSize": The number of people to
5368 // include in the response. Valid values are between 1 and 500, inclusive.
5369 // Defaults to 100 if not set or set to 0.
5370 func (c *PeopleSearchDirectoryPeopleCall) PageSize(pageSize int64) *PeopleSearchDirectoryPeopleCall {
5371 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5372 return c
5373 }
5374
5375 // PageToken sets the optional parameter "pageToken": A page token, received
5376 // from a previous response `next_page_token`. Provide this to retrieve the
5377 // subsequent page. When paginating, all other parameters provided to
5378 // `SearchDirectoryPeople` must match the first call that provided the page
5379 // token.
5380 func (c *PeopleSearchDirectoryPeopleCall) PageToken(pageToken string) *PeopleSearchDirectoryPeopleCall {
5381 c.urlParams_.Set("pageToken", pageToken)
5382 return c
5383 }
5384
5385 // Query sets the optional parameter "query": Required. Prefix query that
5386 // matches fields in the person. Does NOT use the read_mask for determining
5387 // what fields to match.
5388 func (c *PeopleSearchDirectoryPeopleCall) Query(query string) *PeopleSearchDirectoryPeopleCall {
5389 c.urlParams_.Set("query", query)
5390 return c
5391 }
5392
5393 // ReadMask sets the optional parameter "readMask": Required. A field mask to
5394 // restrict which fields on each person are returned. Multiple fields can be
5395 // specified by separating them with commas. Valid values are: * addresses *
5396 // ageRanges * biographies * birthdays * calendarUrls * clientData *
5397 // coverPhotos * emailAddresses * events * externalIds * genders * imClients *
5398 // interests * locales * locations * memberships * metadata * miscKeywords *
5399 // names * nicknames * occupations * organizations * phoneNumbers * photos *
5400 // relations * sipAddresses * skills * urls * userDefined
5401 func (c *PeopleSearchDirectoryPeopleCall) ReadMask(readMask string) *PeopleSearchDirectoryPeopleCall {
5402 c.urlParams_.Set("readMask", readMask)
5403 return c
5404 }
5405
5406 // Sources sets the optional parameter "sources": Required. Directory sources
5407 // to return.
5408 //
5409 // Possible values:
5410 //
5411 // "DIRECTORY_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5412 // "DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT" - Google Workspace domain shared
5413 //
5414 // contact.
5415 //
5416 // "DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE" - Google Workspace domain profile.
5417 func (c *PeopleSearchDirectoryPeopleCall) Sources(sources ...string) *PeopleSearchDirectoryPeopleCall {
5418 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
5419 return c
5420 }
5421
5422 // Fields allows partial responses to be retrieved. See
5423 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5424 // details.
5425 func (c *PeopleSearchDirectoryPeopleCall) Fields(s ...googleapi.Field) *PeopleSearchDirectoryPeopleCall {
5426 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5427 return c
5428 }
5429
5430 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5431 // object's ETag matches the given value. This is useful for getting updates
5432 // only after the object has changed since the last request.
5433 func (c *PeopleSearchDirectoryPeopleCall) IfNoneMatch(entityTag string) *PeopleSearchDirectoryPeopleCall {
5434 c.ifNoneMatch_ = entityTag
5435 return c
5436 }
5437
5438 // Context sets the context to be used in this call's Do method.
5439 func (c *PeopleSearchDirectoryPeopleCall) Context(ctx context.Context) *PeopleSearchDirectoryPeopleCall {
5440 c.ctx_ = ctx
5441 return c
5442 }
5443
5444 // Header returns a http.Header that can be modified by the caller to add
5445 // headers to the request.
5446 func (c *PeopleSearchDirectoryPeopleCall) Header() http.Header {
5447 if c.header_ == nil {
5448 c.header_ = make(http.Header)
5449 }
5450 return c.header_
5451 }
5452
5453 func (c *PeopleSearchDirectoryPeopleCall) doRequest(alt string) (*http.Response, error) {
5454 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5455 if c.ifNoneMatch_ != "" {
5456 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5457 }
5458 c.urlParams_.Set("alt", alt)
5459 c.urlParams_.Set("prettyPrint", "false")
5460 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:searchDirectoryPeople")
5461 urls += "?" + c.urlParams_.Encode()
5462 req, err := http.NewRequest("GET", urls, nil)
5463 if err != nil {
5464 return nil, err
5465 }
5466 req.Header = reqHeaders
5467 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.searchDirectoryPeople", "request", internallog.HTTPRequest(req, nil))
5468 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5469 }
5470
5471 // Do executes the "people.people.searchDirectoryPeople" call.
5472 // Any non-2xx status code is an error. Response headers are in either
5473 // *SearchDirectoryPeopleResponse.ServerResponse.Header or (if a response was
5474 // returned at all) in error.(*googleapi.Error).Header. Use
5475 // googleapi.IsNotModified to check whether the returned error was because
5476 // http.StatusNotModified was returned.
5477 func (c *PeopleSearchDirectoryPeopleCall) Do(opts ...googleapi.CallOption) (*SearchDirectoryPeopleResponse, error) {
5478 gensupport.SetOptions(c.urlParams_, opts...)
5479 res, err := c.doRequest("json")
5480 if res != nil && res.StatusCode == http.StatusNotModified {
5481 if res.Body != nil {
5482 res.Body.Close()
5483 }
5484 return nil, gensupport.WrapError(&googleapi.Error{
5485 Code: res.StatusCode,
5486 Header: res.Header,
5487 })
5488 }
5489 if err != nil {
5490 return nil, err
5491 }
5492 defer googleapi.CloseBody(res)
5493 if err := googleapi.CheckResponse(res); err != nil {
5494 return nil, gensupport.WrapError(err)
5495 }
5496 ret := &SearchDirectoryPeopleResponse{
5497 ServerResponse: googleapi.ServerResponse{
5498 Header: res.Header,
5499 HTTPStatusCode: res.StatusCode,
5500 },
5501 }
5502 target := &ret
5503 b, err := gensupport.DecodeResponseBytes(target, res)
5504 if err != nil {
5505 return nil, err
5506 }
5507 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.searchDirectoryPeople", "response", internallog.HTTPResponse(res, b))
5508 return ret, nil
5509 }
5510
5511 // Pages invokes f for each page of results.
5512 // A non-nil error returned from f will halt the iteration.
5513 // The provided context supersedes any context provided to the Context method.
5514 func (c *PeopleSearchDirectoryPeopleCall) Pages(ctx context.Context, f func(*SearchDirectoryPeopleResponse) error) error {
5515 c.ctx_ = ctx
5516 defer c.PageToken(c.urlParams_.Get("pageToken"))
5517 for {
5518 x, err := c.Do()
5519 if err != nil {
5520 return err
5521 }
5522 if err := f(x); err != nil {
5523 return err
5524 }
5525 if x.NextPageToken == "" {
5526 return nil
5527 }
5528 c.PageToken(x.NextPageToken)
5529 }
5530 }
5531
5532 type PeopleUpdateContactCall struct {
5533 s *Service
5534 resourceName string
5535 person *Person
5536 urlParams_ gensupport.URLParams
5537 ctx_ context.Context
5538 header_ http.Header
5539 }
5540
5541 // UpdateContact: Update contact data for an existing contact person. Any
5542 // non-contact data will not be modified. Any non-contact data in the person to
5543 // update will be ignored. All fields specified in the `update_mask` will be
5544 // replaced. The server returns a 400 error if `person.metadata.sources` is not
5545 // specified for the contact to be updated or if there is no contact source.
5546 // The server returns a 400 error with reason "failedPrecondition" if
5547 // `person.metadata.sources.etag` is different than the contact's etag, which
5548 // indicates the contact has changed since its data was read. Clients should
5549 // get the latest person and merge their updates into the latest person. If
5550 // making sequential updates to the same person, the etag from the
5551 // `updateContact` response should be used to avoid failures. The server
5552 // returns a 400 error if `memberships` are being updated and there are no
5553 // contact group memberships specified on the person. The server returns a 400
5554 // error if more than one field is specified on a field that is a singleton for
5555 // contact sources: * biographies * birthdays * genders * names Mutate requests
5556 // for the same user should be sent sequentially to avoid increased latency and
5557 // failures.
5558 //
5559 // - resourceName: The resource name for the person, assigned by the server. An
5560 // ASCII string in the form of `people/{person_id}`.
5561 func (r *PeopleService) UpdateContact(resourceName string, person *Person) *PeopleUpdateContactCall {
5562 c := &PeopleUpdateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5563 c.resourceName = resourceName
5564 c.person = person
5565 return c
5566 }
5567
5568 // PersonFields sets the optional parameter "personFields": A field mask to
5569 // restrict which fields on each person are returned. Multiple fields can be
5570 // specified by separating them with commas. Defaults to all fields if not set.
5571 // Valid values are: * addresses * ageRanges * biographies * birthdays *
5572 // calendarUrls * clientData * coverPhotos * emailAddresses * events *
5573 // externalIds * genders * imClients * interests * locales * locations *
5574 // memberships * metadata * miscKeywords * names * nicknames * occupations *
5575 // organizations * phoneNumbers * photos * relations * sipAddresses * skills *
5576 // urls * userDefined
5577 func (c *PeopleUpdateContactCall) PersonFields(personFields string) *PeopleUpdateContactCall {
5578 c.urlParams_.Set("personFields", personFields)
5579 return c
5580 }
5581
5582 // Sources sets the optional parameter "sources": A mask of what source types
5583 // to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE
5584 // if not set.
5585 //
5586 // Possible values:
5587 //
5588 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5589 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
5590 //
5591 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
5592 //
5593 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
5594 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
5595 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
5596 func (c *PeopleUpdateContactCall) Sources(sources ...string) *PeopleUpdateContactCall {
5597 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
5598 return c
5599 }
5600
5601 // UpdatePersonFields sets the optional parameter "updatePersonFields":
5602 // Required. A field mask to restrict which fields on the person are updated.
5603 // Multiple fields can be specified by separating them with commas. All updated
5604 // fields will be replaced. Valid values are: * addresses * biographies *
5605 // birthdays * calendarUrls * clientData * emailAddresses * events *
5606 // externalIds * genders * imClients * interests * locales * locations *
5607 // memberships * miscKeywords * names * nicknames * occupations * organizations
5608 // * phoneNumbers * relations * sipAddresses * urls * userDefined
5609 func (c *PeopleUpdateContactCall) UpdatePersonFields(updatePersonFields string) *PeopleUpdateContactCall {
5610 c.urlParams_.Set("updatePersonFields", updatePersonFields)
5611 return c
5612 }
5613
5614 // Fields allows partial responses to be retrieved. See
5615 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5616 // details.
5617 func (c *PeopleUpdateContactCall) Fields(s ...googleapi.Field) *PeopleUpdateContactCall {
5618 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5619 return c
5620 }
5621
5622 // Context sets the context to be used in this call's Do method.
5623 func (c *PeopleUpdateContactCall) Context(ctx context.Context) *PeopleUpdateContactCall {
5624 c.ctx_ = ctx
5625 return c
5626 }
5627
5628 // Header returns a http.Header that can be modified by the caller to add
5629 // headers to the request.
5630 func (c *PeopleUpdateContactCall) Header() http.Header {
5631 if c.header_ == nil {
5632 c.header_ = make(http.Header)
5633 }
5634 return c.header_
5635 }
5636
5637 func (c *PeopleUpdateContactCall) doRequest(alt string) (*http.Response, error) {
5638 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5639 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.person)
5640 if err != nil {
5641 return nil, err
5642 }
5643 c.urlParams_.Set("alt", alt)
5644 c.urlParams_.Set("prettyPrint", "false")
5645 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContact")
5646 urls += "?" + c.urlParams_.Encode()
5647 req, err := http.NewRequest("PATCH", urls, body)
5648 if err != nil {
5649 return nil, err
5650 }
5651 req.Header = reqHeaders
5652 googleapi.Expand(req.URL, map[string]string{
5653 "resourceName": c.resourceName,
5654 })
5655 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.updateContact", "request", internallog.HTTPRequest(req, body.Bytes()))
5656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5657 }
5658
5659 // Do executes the "people.people.updateContact" call.
5660 // Any non-2xx status code is an error. Response headers are in either
5661 // *Person.ServerResponse.Header or (if a response was returned at all) in
5662 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5663 // whether the returned error was because http.StatusNotModified was returned.
5664 func (c *PeopleUpdateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) {
5665 gensupport.SetOptions(c.urlParams_, opts...)
5666 res, err := c.doRequest("json")
5667 if res != nil && res.StatusCode == http.StatusNotModified {
5668 if res.Body != nil {
5669 res.Body.Close()
5670 }
5671 return nil, gensupport.WrapError(&googleapi.Error{
5672 Code: res.StatusCode,
5673 Header: res.Header,
5674 })
5675 }
5676 if err != nil {
5677 return nil, err
5678 }
5679 defer googleapi.CloseBody(res)
5680 if err := googleapi.CheckResponse(res); err != nil {
5681 return nil, gensupport.WrapError(err)
5682 }
5683 ret := &Person{
5684 ServerResponse: googleapi.ServerResponse{
5685 Header: res.Header,
5686 HTTPStatusCode: res.StatusCode,
5687 },
5688 }
5689 target := &ret
5690 b, err := gensupport.DecodeResponseBytes(target, res)
5691 if err != nil {
5692 return nil, err
5693 }
5694 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.updateContact", "response", internallog.HTTPResponse(res, b))
5695 return ret, nil
5696 }
5697
5698 type PeopleUpdateContactPhotoCall struct {
5699 s *Service
5700 resourceName string
5701 updatecontactphotorequest *UpdateContactPhotoRequest
5702 urlParams_ gensupport.URLParams
5703 ctx_ context.Context
5704 header_ http.Header
5705 }
5706
5707 // UpdateContactPhoto: Update a contact's photo. Mutate requests for the same
5708 // user should be sent sequentially to avoid increased latency and failures.
5709 //
5710 // - resourceName: Person resource name.
5711 func (r *PeopleService) UpdateContactPhoto(resourceName string, updatecontactphotorequest *UpdateContactPhotoRequest) *PeopleUpdateContactPhotoCall {
5712 c := &PeopleUpdateContactPhotoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5713 c.resourceName = resourceName
5714 c.updatecontactphotorequest = updatecontactphotorequest
5715 return c
5716 }
5717
5718 // Fields allows partial responses to be retrieved. See
5719 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5720 // details.
5721 func (c *PeopleUpdateContactPhotoCall) Fields(s ...googleapi.Field) *PeopleUpdateContactPhotoCall {
5722 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5723 return c
5724 }
5725
5726 // Context sets the context to be used in this call's Do method.
5727 func (c *PeopleUpdateContactPhotoCall) Context(ctx context.Context) *PeopleUpdateContactPhotoCall {
5728 c.ctx_ = ctx
5729 return c
5730 }
5731
5732 // Header returns a http.Header that can be modified by the caller to add
5733 // headers to the request.
5734 func (c *PeopleUpdateContactPhotoCall) Header() http.Header {
5735 if c.header_ == nil {
5736 c.header_ = make(http.Header)
5737 }
5738 return c.header_
5739 }
5740
5741 func (c *PeopleUpdateContactPhotoCall) doRequest(alt string) (*http.Response, error) {
5742 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5743 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatecontactphotorequest)
5744 if err != nil {
5745 return nil, err
5746 }
5747 c.urlParams_.Set("alt", alt)
5748 c.urlParams_.Set("prettyPrint", "false")
5749 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContactPhoto")
5750 urls += "?" + c.urlParams_.Encode()
5751 req, err := http.NewRequest("PATCH", urls, body)
5752 if err != nil {
5753 return nil, err
5754 }
5755 req.Header = reqHeaders
5756 googleapi.Expand(req.URL, map[string]string{
5757 "resourceName": c.resourceName,
5758 })
5759 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.updateContactPhoto", "request", internallog.HTTPRequest(req, body.Bytes()))
5760 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5761 }
5762
5763 // Do executes the "people.people.updateContactPhoto" call.
5764 // Any non-2xx status code is an error. Response headers are in either
5765 // *UpdateContactPhotoResponse.ServerResponse.Header or (if a response was
5766 // returned at all) in error.(*googleapi.Error).Header. Use
5767 // googleapi.IsNotModified to check whether the returned error was because
5768 // http.StatusNotModified was returned.
5769 func (c *PeopleUpdateContactPhotoCall) Do(opts ...googleapi.CallOption) (*UpdateContactPhotoResponse, error) {
5770 gensupport.SetOptions(c.urlParams_, opts...)
5771 res, err := c.doRequest("json")
5772 if res != nil && res.StatusCode == http.StatusNotModified {
5773 if res.Body != nil {
5774 res.Body.Close()
5775 }
5776 return nil, gensupport.WrapError(&googleapi.Error{
5777 Code: res.StatusCode,
5778 Header: res.Header,
5779 })
5780 }
5781 if err != nil {
5782 return nil, err
5783 }
5784 defer googleapi.CloseBody(res)
5785 if err := googleapi.CheckResponse(res); err != nil {
5786 return nil, gensupport.WrapError(err)
5787 }
5788 ret := &UpdateContactPhotoResponse{
5789 ServerResponse: googleapi.ServerResponse{
5790 Header: res.Header,
5791 HTTPStatusCode: res.StatusCode,
5792 },
5793 }
5794 target := &ret
5795 b, err := gensupport.DecodeResponseBytes(target, res)
5796 if err != nil {
5797 return nil, err
5798 }
5799 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.updateContactPhoto", "response", internallog.HTTPResponse(res, b))
5800 return ret, nil
5801 }
5802
5803 type PeopleConnectionsListCall struct {
5804 s *Service
5805 resourceName string
5806 urlParams_ gensupport.URLParams
5807 ifNoneMatch_ string
5808 ctx_ context.Context
5809 header_ http.Header
5810 }
5811
5812 // List: Provides a list of the authenticated user's contacts. Sync tokens
5813 // expire 7 days after the full sync. A request with an expired sync token will
5814 // get an error with an google.rpc.ErrorInfo
5815 // (https://cloud.google.com/apis/design/errors#error_info) with reason
5816 // "EXPIRED_SYNC_TOKEN". In the case of such an error clients should make a
5817 // full sync request without a `sync_token`. The first page of a full sync
5818 // request has an additional quota. If the quota is exceeded, a 429 error will
5819 // be returned. This quota is fixed and can not be increased. When the
5820 // `sync_token` is specified, resources deleted since the last sync will be
5821 // returned as a person with `PersonMetadata.deleted` set to true. When the
5822 // `page_token` or `sync_token` is specified, all other request parameters must
5823 // match the first call. Writes may have a propagation delay of several minutes
5824 // for sync requests. Incremental syncs are not intended for read-after-write
5825 // use cases. See example usage at List the user's contacts that have changed
5826 // (/people/v1/contacts#list_the_users_contacts_that_have_changed).
5827 //
5828 // - resourceName: The resource name to return connections for. Only
5829 // `people/me` is valid.
5830 func (r *PeopleConnectionsService) List(resourceName string) *PeopleConnectionsListCall {
5831 c := &PeopleConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5832 c.resourceName = resourceName
5833 return c
5834 }
5835
5836 // PageSize sets the optional parameter "pageSize": The number of connections
5837 // to include in the response. Valid values are between 1 and 1000, inclusive.
5838 // Defaults to 100 if not set or set to 0.
5839 func (c *PeopleConnectionsListCall) PageSize(pageSize int64) *PeopleConnectionsListCall {
5840 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5841 return c
5842 }
5843
5844 // PageToken sets the optional parameter "pageToken": A page token, received
5845 // from a previous response `next_page_token`. Provide this to retrieve the
5846 // subsequent page. When paginating, all other parameters provided to
5847 // `people.connections.list` must match the first call that provided the page
5848 // token.
5849 func (c *PeopleConnectionsListCall) PageToken(pageToken string) *PeopleConnectionsListCall {
5850 c.urlParams_.Set("pageToken", pageToken)
5851 return c
5852 }
5853
5854 // PersonFields sets the optional parameter "personFields": Required. A field
5855 // mask to restrict which fields on each person are returned. Multiple fields
5856 // can be specified by separating them with commas. Valid values are: *
5857 // addresses * ageRanges * biographies * birthdays * calendarUrls * clientData
5858 // * coverPhotos * emailAddresses * events * externalIds * genders * imClients
5859 // * interests * locales * locations * memberships * metadata * miscKeywords *
5860 // names * nicknames * occupations * organizations * phoneNumbers * photos *
5861 // relations * sipAddresses * skills * urls * userDefined
5862 func (c *PeopleConnectionsListCall) PersonFields(personFields string) *PeopleConnectionsListCall {
5863 c.urlParams_.Set("personFields", personFields)
5864 return c
5865 }
5866
5867 // RequestMaskIncludeField sets the optional parameter
5868 // "requestMask.includeField": Required. Comma-separated list of person fields
5869 // to be included in the response. Each path should start with `person.`: for
5870 // example, `person.names` or `person.photos`.
5871 func (c *PeopleConnectionsListCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleConnectionsListCall {
5872 c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
5873 return c
5874 }
5875
5876 // RequestSyncToken sets the optional parameter "requestSyncToken": Whether the
5877 // response should return `next_sync_token` on the last page of results. It can
5878 // be used to get incremental changes since the last request by setting it on
5879 // the request `sync_token`. More details about sync behavior at
5880 // `people.connections.list`.
5881 func (c *PeopleConnectionsListCall) RequestSyncToken(requestSyncToken bool) *PeopleConnectionsListCall {
5882 c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken))
5883 return c
5884 }
5885
5886 // SortOrder sets the optional parameter "sortOrder": The order in which the
5887 // connections should be sorted. Defaults to `LAST_MODIFIED_ASCENDING`.
5888 //
5889 // Possible values:
5890 //
5891 // "LAST_MODIFIED_ASCENDING" - Sort people by when they were changed; older
5892 //
5893 // entries first.
5894 //
5895 // "LAST_MODIFIED_DESCENDING" - Sort people by when they were changed; newer
5896 //
5897 // entries first.
5898 //
5899 // "FIRST_NAME_ASCENDING" - Sort people by first name.
5900 // "LAST_NAME_ASCENDING" - Sort people by last name.
5901 func (c *PeopleConnectionsListCall) SortOrder(sortOrder string) *PeopleConnectionsListCall {
5902 c.urlParams_.Set("sortOrder", sortOrder)
5903 return c
5904 }
5905
5906 // Sources sets the optional parameter "sources": A mask of what source types
5907 // to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE
5908 // if not set.
5909 //
5910 // Possible values:
5911 //
5912 // "READ_SOURCE_TYPE_UNSPECIFIED" - Unspecified.
5913 // "READ_SOURCE_TYPE_PROFILE" - Returns SourceType.ACCOUNT,
5914 //
5915 // SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
5916 //
5917 // "READ_SOURCE_TYPE_CONTACT" - Returns SourceType.CONTACT.
5918 // "READ_SOURCE_TYPE_DOMAIN_CONTACT" - Returns SourceType.DOMAIN_CONTACT.
5919 // "READ_SOURCE_TYPE_OTHER_CONTACT" - Returns SourceType.OTHER_CONTACT.
5920 func (c *PeopleConnectionsListCall) Sources(sources ...string) *PeopleConnectionsListCall {
5921 c.urlParams_.SetMulti("sources", append([]string{}, sources...))
5922 return c
5923 }
5924
5925 // SyncToken sets the optional parameter "syncToken": A sync token, received
5926 // from a previous response `next_sync_token` Provide this to retrieve only the
5927 // resources changed since the last request. When syncing, all other parameters
5928 // provided to `people.connections.list` must match the first call that
5929 // provided the sync token. More details about sync behavior at
5930 // `people.connections.list`.
5931 func (c *PeopleConnectionsListCall) SyncToken(syncToken string) *PeopleConnectionsListCall {
5932 c.urlParams_.Set("syncToken", syncToken)
5933 return c
5934 }
5935
5936 // Fields allows partial responses to be retrieved. See
5937 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5938 // details.
5939 func (c *PeopleConnectionsListCall) Fields(s ...googleapi.Field) *PeopleConnectionsListCall {
5940 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5941 return c
5942 }
5943
5944 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5945 // object's ETag matches the given value. This is useful for getting updates
5946 // only after the object has changed since the last request.
5947 func (c *PeopleConnectionsListCall) IfNoneMatch(entityTag string) *PeopleConnectionsListCall {
5948 c.ifNoneMatch_ = entityTag
5949 return c
5950 }
5951
5952 // Context sets the context to be used in this call's Do method.
5953 func (c *PeopleConnectionsListCall) Context(ctx context.Context) *PeopleConnectionsListCall {
5954 c.ctx_ = ctx
5955 return c
5956 }
5957
5958 // Header returns a http.Header that can be modified by the caller to add
5959 // headers to the request.
5960 func (c *PeopleConnectionsListCall) Header() http.Header {
5961 if c.header_ == nil {
5962 c.header_ = make(http.Header)
5963 }
5964 return c.header_
5965 }
5966
5967 func (c *PeopleConnectionsListCall) doRequest(alt string) (*http.Response, error) {
5968 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5969 if c.ifNoneMatch_ != "" {
5970 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5971 }
5972 c.urlParams_.Set("alt", alt)
5973 c.urlParams_.Set("prettyPrint", "false")
5974 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/connections")
5975 urls += "?" + c.urlParams_.Encode()
5976 req, err := http.NewRequest("GET", urls, nil)
5977 if err != nil {
5978 return nil, err
5979 }
5980 req.Header = reqHeaders
5981 googleapi.Expand(req.URL, map[string]string{
5982 "resourceName": c.resourceName,
5983 })
5984 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "people.people.connections.list", "request", internallog.HTTPRequest(req, nil))
5985 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5986 }
5987
5988 // Do executes the "people.people.connections.list" call.
5989 // Any non-2xx status code is an error. Response headers are in either
5990 // *ListConnectionsResponse.ServerResponse.Header or (if a response was
5991 // returned at all) in error.(*googleapi.Error).Header. Use
5992 // googleapi.IsNotModified to check whether the returned error was because
5993 // http.StatusNotModified was returned.
5994 func (c *PeopleConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) {
5995 gensupport.SetOptions(c.urlParams_, opts...)
5996 res, err := c.doRequest("json")
5997 if res != nil && res.StatusCode == http.StatusNotModified {
5998 if res.Body != nil {
5999 res.Body.Close()
6000 }
6001 return nil, gensupport.WrapError(&googleapi.Error{
6002 Code: res.StatusCode,
6003 Header: res.Header,
6004 })
6005 }
6006 if err != nil {
6007 return nil, err
6008 }
6009 defer googleapi.CloseBody(res)
6010 if err := googleapi.CheckResponse(res); err != nil {
6011 return nil, gensupport.WrapError(err)
6012 }
6013 ret := &ListConnectionsResponse{
6014 ServerResponse: googleapi.ServerResponse{
6015 Header: res.Header,
6016 HTTPStatusCode: res.StatusCode,
6017 },
6018 }
6019 target := &ret
6020 b, err := gensupport.DecodeResponseBytes(target, res)
6021 if err != nil {
6022 return nil, err
6023 }
6024 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "people.people.connections.list", "response", internallog.HTTPResponse(res, b))
6025 return ret, nil
6026 }
6027
6028 // Pages invokes f for each page of results.
6029 // A non-nil error returned from f will halt the iteration.
6030 // The provided context supersedes any context provided to the Context method.
6031 func (c *PeopleConnectionsListCall) Pages(ctx context.Context, f func(*ListConnectionsResponse) error) error {
6032 c.ctx_ = ctx
6033 defer c.PageToken(c.urlParams_.Get("pageToken"))
6034 for {
6035 x, err := c.Do()
6036 if err != nil {
6037 return err
6038 }
6039 if err := f(x); err != nil {
6040 return err
6041 }
6042 if x.NextPageToken == "" {
6043 return nil
6044 }
6045 c.PageToken(x.NextPageToken)
6046 }
6047 }