Class: Google::Apis::PeopleV1::PeopleServiceService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/people_v1/service.rb

Overview

People API

Provides access to information about profiles and contacts.

Examples:

require 'google/apis/people_v1'

People = Google::Apis::PeopleV1 # Alias the module
service = People::PeopleServiceService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializePeopleServiceService

Returns a new instance of PeopleServiceService



45
46
47
48
# File 'generated/google/apis/people_v1/service.rb', line 45

def initialize
  super('https://people.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'generated/google/apis/people_v1/service.rb', line 38

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



43
44
45
# File 'generated/google/apis/people_v1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#batch_contact_group_get(max_members: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::BatchGetContactGroupsResponse

Get a list of contact groups owned by the authenticated user by specifying a list of contact group resource names.

Parameters:

  • max_members (Fixnum)

    Specifies the maximum number of members to return for each group.

  • resource_names (Array<String>, String)

    The resource names of the contact groups to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



73
74
75
76
77
78
79
80
81
82
# File 'generated/google/apis/people_v1/service.rb', line 73

def batch_contact_group_get(max_members: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/contactGroups:batchGet', options)
  command.response_representation = Google::Apis::PeopleV1::BatchGetContactGroupsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::BatchGetContactGroupsResponse
  command.query['maxMembers'] = max_members unless max_members.nil?
  command.query['resourceNames'] = resource_names unless resource_names.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_contact_group(create_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ContactGroup

Create a new contact group owned by the authenticated user.

Parameters:

  • create_contact_group_request_object (Google::Apis::PeopleV1::CreateContactGroupRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



103
104
105
106
107
108
109
110
111
112
# File 'generated/google/apis/people_v1/service.rb', line 103

def create_contact_group(create_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/contactGroups', options)
  command.request_representation = Google::Apis::PeopleV1::CreateContactGroupRequest::Representation
  command.request_object = create_contact_group_request_object
  command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
  command.response_class = Google::Apis::PeopleV1::ContactGroup
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_person_contact(person_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::Person

Create a new contact and return the person resource for that contact.

Parameters:

  • person_object (Google::Apis::PeopleV1::Person) (defaults to: nil)
  • parent (String)

    The resource name of the owning person resource.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



311
312
313
314
315
316
317
318
319
320
321
# File 'generated/google/apis/people_v1/service.rb', line 311

def create_person_contact(person_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/people:createContact', options)
  command.request_representation = Google::Apis::PeopleV1::Person::Representation
  command.request_object = person_object
  command.response_representation = Google::Apis::PeopleV1::Person::Representation
  command.response_class = Google::Apis::PeopleV1::Person
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_contact_group(resource_name, delete_contacts: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::Empty

Delete an existing contact group owned by the authenticated user by specifying a contact group resource name.

Parameters:

  • resource_name (String)

    The resource name of the contact group to delete.

  • delete_contacts (Boolean)

    Set to true to also delete the contacts in the specified group.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



137
138
139
140
141
142
143
144
145
146
# File 'generated/google/apis/people_v1/service.rb', line 137

def delete_contact_group(resource_name, delete_contacts: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1/{+resourceName}', options)
  command.response_representation = Google::Apis::PeopleV1::Empty::Representation
  command.response_class = Google::Apis::PeopleV1::Empty
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['deleteContacts'] = delete_contacts unless delete_contacts.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_person_contact(resource_name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::Empty

Delete a contact person. Any non-contact data will not be deleted.

Parameters:

  • resource_name (String)

    The resource name of the contact to delete.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



343
344
345
346
347
348
349
350
351
# File 'generated/google/apis/people_v1/service.rb', line 343

def delete_person_contact(resource_name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1/{+resourceName}:deleteContact', options)
  command.response_representation = Google::Apis::PeopleV1::Empty::Representation
  command.response_class = Google::Apis::PeopleV1::Empty
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_contact_group(resource_name, max_members: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ContactGroup

Get a specific contact group owned by the authenticated user by specifying a contact group resource name.

Parameters:

  • resource_name (String)

    The resource name of the contact group to get.

  • max_members (Fixnum)

    Specifies the maximum number of members to return.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



171
172
173
174
175
176
177
178
179
180
# File 'generated/google/apis/people_v1/service.rb', line 171

def get_contact_group(resource_name, max_members: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resourceName}', options)
  command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
  command.response_class = Google::Apis::PeopleV1::ContactGroup
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['maxMembers'] = max_members unless max_members.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_people(person_fields: nil, request_mask_include_field: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::GetPeopleResponse

Provides information about a list of specific people by specifying a list of requested resource names. Use people/me to indicate the authenticated user.
The request throws a 400 error if 'personFields' is not specified.

Parameters:

  • person_fields (String)

    Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are:

    • addresses
    • ageRanges
    • biographies
    • birthdays
    • braggingRights
    • coverPhotos
    • emailAddresses
    • events
    • genders
    • imClients
    • interests
    • locales
    • memberships
    • metadata
    • names
    • nicknames
    • occupations
    • organizations
    • phoneNumbers
    • photos
    • relations
    • relationshipInterests
    • relationshipStatuses
    • residences
    • skills
    • taglines
    • urls
  • request_mask_include_field (String)

    Required. Comma-separated list of person fields to be included in the response. Each path should start with person.: for example, person.names or person.photos.

  • resource_names (Array<String>, String)

    The resource names of the people to provide information about.

    • To get information about the authenticated user, specify people/me.
    • To get information about a google account, specify people/account_id.
    • To get information about a contact, specify the resource name that identifies the contact as returned by people.connections.list. You can include up to 50 resource names in one request.
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



495
496
497
498
499
500
501
502
503
504
505
# File 'generated/google/apis/people_v1/service.rb', line 495

def get_people(person_fields: nil, request_mask_include_field: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/people:batchGet', options)
  command.response_representation = Google::Apis::PeopleV1::GetPeopleResponse::Representation
  command.response_class = Google::Apis::PeopleV1::GetPeopleResponse
  command.query['personFields'] = person_fields unless person_fields.nil?
  command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
  command.query['resourceNames'] = resource_names unless resource_names.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_person(resource_name, person_fields: nil, request_mask_include_field: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::Person

Provides information about a person by specifying a resource name. Use people/me to indicate the authenticated user.
The request throws a 400 error if 'personFields' is not specified.

Parameters:

  • resource_name (String)

    The resource name of the person to provide information about.

    • To get information about the authenticated user, specify people/me.
    • To get information about a google account, specify people/account_id.
    • To get information about a contact, specify the resource name that identifies the contact as returned by people.connections.list.
  • person_fields (String)

    Required. A field mask to restrict which fields on the person are returned. Multiple fields can be specified by separating them with commas. Valid values are:

    • addresses
    • ageRanges
    • biographies
    • birthdays
    • braggingRights
    • coverPhotos
    • emailAddresses
    • events
    • genders
    • imClients
    • interests
    • locales
    • memberships
    • metadata
    • names
    • nicknames
    • occupations
    • organizations
    • phoneNumbers
    • photos
    • relations
    • relationshipInterests
    • relationshipStatuses
    • residences
    • skills
    • taglines
    • urls
  • request_mask_include_field (String)

    Required. Comma-separated list of person fields to be included in the response. Each path should start with person.: for example, person.names or person.photos.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



417
418
419
420
421
422
423
424
425
426
427
# File 'generated/google/apis/people_v1/service.rb', line 417

def get_person(resource_name, person_fields: nil, request_mask_include_field: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resourceName}', options)
  command.response_representation = Google::Apis::PeopleV1::Person::Representation
  command.response_class = Google::Apis::PeopleV1::Person
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['personFields'] = person_fields unless person_fields.nil?
  command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_contact_groups(page_size: nil, page_token: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ListContactGroupsResponse

List all contact groups owned by the authenticated user. Members of the contact groups are not populated.

Parameters:

  • page_size (Fixnum)

    The maximum number of resources to return.

  • page_token (String)

    The next_page_token value returned from a previous call to ListContactGroups. Requests the next page of resources.

  • sync_token (String)

    A sync token, returned by a previous call to contactgroups.list. Only resources changed since the sync token was created will be returned.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



210
211
212
213
214
215
216
217
218
219
220
# File 'generated/google/apis/people_v1/service.rb', line 210

def list_contact_groups(page_size: nil, page_token: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/contactGroups', options)
  command.response_representation = Google::Apis::PeopleV1::ListContactGroupsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::ListContactGroupsResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['syncToken'] = sync_token unless sync_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_person_connections(resource_name, page_size: nil, page_token: nil, person_fields: nil, request_mask_include_field: nil, request_sync_token: nil, sort_order: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ListConnectionsResponse

Provides a list of the authenticated user's contacts merged with any connected profiles.
The request throws a 400 error if 'personFields' is not specified.

Parameters:

  • resource_name (String)

    The resource name to return connections for. Only people/me is valid.

  • page_size (Fixnum)

    The number of connections to include in the response. Valid values are between 1 and 2000, inclusive. Defaults to 100.

  • page_token (String)

    The token of the page to be returned.

  • person_fields (String)

    Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are:

    • addresses
    • ageRanges
    • biographies
    • birthdays
    • braggingRights
    • coverPhotos
    • emailAddresses
    • events
    • genders
    • imClients
    • interests
    • locales
    • memberships
    • metadata
    • names
    • nicknames
    • occupations
    • organizations
    • phoneNumbers
    • photos
    • relations
    • relationshipInterests
    • relationshipStatuses
    • residences
    • skills
    • taglines
    • urls
  • request_mask_include_field (String)

    Required. Comma-separated list of person fields to be included in the response. Each path should start with person.: for example, person.names or person.photos.

  • request_sync_token (Boolean)

    Whether the response should include a sync token, which can be used to get all changes since the last request. For subsequent sync requests use the sync_token param instead. Initial sync requests that specify request_sync_token have an additional rate limit.

  • sort_order (String)

    The order in which the connections should be sorted. Defaults to LAST_MODIFIED_ASCENDING.

  • sync_token (String)

    A sync token returned by a previous call to people.connections.list. Only resources changed since the sync token was created will be returned. Sync requests that specify sync_token have an additional rate limit.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'generated/google/apis/people_v1/service.rb', line 649

def list_person_connections(resource_name, page_size: nil, page_token: nil, person_fields: nil, request_mask_include_field: nil, request_sync_token: nil, sort_order: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resourceName}/connections', options)
  command.response_representation = Google::Apis::PeopleV1::ListConnectionsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::ListConnectionsResponse
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['personFields'] = person_fields unless person_fields.nil?
  command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
  command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
  command.query['sortOrder'] = sort_order unless sort_order.nil?
  command.query['syncToken'] = sync_token unless sync_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#modify_contact_group_members(resource_name, modify_contact_group_members_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ModifyContactGroupMembersResponse

Modify the members of a contact group owned by the authenticated user.

Parameters:

  • resource_name (String)

    The resource name of the contact group to modify.

  • modify_contact_group_members_request_object (Google::Apis::PeopleV1::ModifyContactGroupMembersRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



278
279
280
281
282
283
284
285
286
287
288
# File 'generated/google/apis/people_v1/service.rb', line 278

def modify_contact_group_members(resource_name, modify_contact_group_members_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resourceName}/members:modify', options)
  command.request_representation = Google::Apis::PeopleV1::ModifyContactGroupMembersRequest::Representation
  command.request_object = modify_contact_group_members_request_object
  command.response_representation = Google::Apis::PeopleV1::ModifyContactGroupMembersResponse::Representation
  command.response_class = Google::Apis::PeopleV1::ModifyContactGroupMembersResponse
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_contact_group(resource_name, update_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ContactGroup

Update the name of an existing contact group owned by the authenticated user.

Parameters:

  • resource_name (String)

    The resource name for the contact group, assigned by the server. An ASCII string, in the form of contactGroups/contact_group_id.

  • update_contact_group_request_object (Google::Apis::PeopleV1::UpdateContactGroupRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



245
246
247
248
249
250
251
252
253
254
255
# File 'generated/google/apis/people_v1/service.rb', line 245

def update_contact_group(resource_name, update_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:put, 'v1/{+resourceName}', options)
  command.request_representation = Google::Apis::PeopleV1::UpdateContactGroupRequest::Representation
  command.request_object = update_contact_group_request_object
  command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
  command.response_class = Google::Apis::PeopleV1::ContactGroup
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_person_contact(resource_name, person_object = nil, update_person_fields: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::Person

Update contact data for an existing contact person. Any non-contact data will not be modified. The request throws a 400 error if updatePersonFields is not specified.
The request throws a 400 error if person.metadata.sources is not specified for the contact to be updated.
The request throws a 412 error if person.metadata.sources.etag is different than the contact's etag, which indicates the contact has changed since its data was read. Clients should get the latest person and re-apply their updates to the latest person.

Parameters:

  • resource_name (String)

    The resource name for the person, assigned by the server. An ASCII string with a max length of 27 characters, in the form of people/person_id.

  • person_object (Google::Apis::PeopleV1::Person) (defaults to: nil)
  • update_person_fields (String)

    Required. A field mask to restrict which fields on the person are updated. Multiple fields can be specified by separating them with commas. All updated fields will be replaced. Valid values are:

    • addresses
    • biographies
    • birthdays
    • emailAddresses
    • events
    • genders
    • imClients
    • interests
    • locales
    • names
    • nicknames
    • occupations
    • organizations
    • phoneNumbers
    • relations
    • residences
    • urls
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



561
562
563
564
565
566
567
568
569
570
571
572
# File 'generated/google/apis/people_v1/service.rb', line 561

def update_person_contact(resource_name, person_object = nil, update_person_fields: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'v1/{+resourceName}:updateContact', options)
  command.request_representation = Google::Apis::PeopleV1::Person::Representation
  command.request_object = person_object
  command.response_representation = Google::Apis::PeopleV1::Person::Representation
  command.response_class = Google::Apis::PeopleV1::Person
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['updatePersonFields'] = update_person_fields unless update_person_fields.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end