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

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/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

Instance Method Summary collapse

Constructor Details

#initializePeopleServiceService

Returns a new instance of PeopleServiceService.



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

def initialize
  super('https://people.googleapis.com/', '',
        client_name: 'google-apis-people_v1',
        client_version: Google::Apis::PeopleV1::GEM_VERSION)
  @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 'lib/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 'lib/google/apis/people_v1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#batch_contact_group_get(group_fields: nil, 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:

  • group_fields (String) (defaults to: nil)

    Optional. A field mask to restrict which fields on the group are returned. Defaults to metadata, groupType, memberCount, and name if not set or set to empty. Valid fields are: * clientData * groupType * memberCount * metadata * name

  • max_members (Fixnum) (defaults to: nil)

    Optional. Specifies the maximum number of members to return for each group. Defaults to 0 if not set, which will return zero members.

  • resource_names (Array<String>, String) (defaults to: nil)

    Required. The resource names of the contact groups to get. There is a maximum of 200 resource names.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/google/apis/people_v1/service.rb', line 82

def batch_contact_group_get(group_fields: nil, 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['groupFields'] = group_fields unless group_fields.nil?
  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

#batch_person_create_contacts(batch_create_contacts_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::BatchCreateContactsResponse

Create a batch of new contacts and return the PersonResponses for the newly created contacts. Limited to 10 parallel requests per user.

Parameters:

  • batch_create_contacts_request_object (Google::Apis::PeopleV1::BatchCreateContactsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



501
502
503
504
505
506
507
508
509
510
# File 'lib/google/apis/people_v1/service.rb', line 501

def batch_person_create_contacts(batch_create_contacts_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/people:batchCreateContacts', options)
  command.request_representation = Google::Apis::PeopleV1::BatchCreateContactsRequest::Representation
  command.request_object = batch_create_contacts_request_object
  command.response_representation = Google::Apis::PeopleV1::BatchCreateContactsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::BatchCreateContactsResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Delete a batch of contacts. Any non-contact data will not be deleted. Limited to 10 parallel requests per user.

Parameters:

  • batch_delete_contacts_request_object (Google::Apis::PeopleV1::BatchDeleteContactsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



532
533
534
535
536
537
538
539
540
541
# File 'lib/google/apis/people_v1/service.rb', line 532

def batch_person_delete_contacts(batch_delete_contacts_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/people:batchDeleteContacts', options)
  command.request_representation = Google::Apis::PeopleV1::BatchDeleteContactsRequest::Representation
  command.request_object = batch_delete_contacts_request_object
  command.response_representation = Google::Apis::PeopleV1::Empty::Representation
  command.response_class = Google::Apis::PeopleV1::Empty
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_person_update_contacts(batch_update_contacts_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::BatchUpdateContactsResponse

Update a batch of contacts and return a map of resource names to PersonResponses for the updated contacts. Limited to 10 parallel requests per user.

Parameters:

  • batch_update_contacts_request_object (Google::Apis::PeopleV1::BatchUpdateContactsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



564
565
566
567
568
569
570
571
572
573
# File 'lib/google/apis/people_v1/service.rb', line 564

def batch_person_update_contacts(batch_update_contacts_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/people:batchUpdateContacts', options)
  command.request_representation = Google::Apis::PeopleV1::BatchUpdateContactsRequest::Representation
  command.request_object = batch_update_contacts_request_object
  command.response_representation = Google::Apis::PeopleV1::BatchUpdateContactsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::BatchUpdateContactsResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Copies an "Other contact" to a new contact in the user's "myContacts" group

Parameters:

  • resource_name (String)

    Required. The resource name of the "Other contact" to copy.

  • copy_other_contact_to_my_contacts_group_request_object (Google::Apis::PeopleV1::CopyOtherContactToMyContactsGroupRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def copy_other_contact_to_my_contacts_group(resource_name, copy_other_contact_to_my_contacts_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+resourceName}:copyOtherContactToMyContactsGroup', options)
  command.request_representation = Google::Apis::PeopleV1::CopyOtherContactToMyContactsGroupRequest::Representation
  command.request_object = copy_other_contact_to_my_contacts_group_request_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['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. Created contact group names must be unique to the users contact groups. Attempting to create a group with a duplicate name will return a HTTP 409 error.

Parameters:

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



115
116
117
118
119
120
121
122
123
124
# File 'lib/google/apis/people_v1/service.rb', line 115

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, person_fields: nil, sources: 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. The request returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: * biographies * birthdays * genders * names

Parameters:

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

    Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Defaults to all fields if not set. Valid values are: * addresses * ageRanges * biographies

    • birthdays * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined
  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/google/apis/people_v1/service.rb', line 609

def create_person_contact(person_object = nil, person_fields: nil, sources: 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['personFields'] = person_fields unless person_fields.nil?
  command.query['sources'] = sources unless sources.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)

    Required. The resource name of the contact group to delete.

  • delete_contacts (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



149
150
151
152
153
154
155
156
157
158
# File 'lib/google/apis/people_v1/service.rb', line 149

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)

    Required. The resource name of the contact to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



642
643
644
645
646
647
648
649
650
# File 'lib/google/apis/people_v1/service.rb', line 642

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

#delete_person_contact_photo(resource_name, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::DeleteContactPhotoResponse

Delete a contact's photo.

Parameters:

  • resource_name (String)

    Required. The resource name of the contact whose photo will be deleted.

  • person_fields (String) (defaults to: nil)

    Optional. A field mask to restrict which fields on the person are returned. Multiple fields can be specified by separating them with commas. Defaults to empty if not set, which will skip the post mutate get. Valid values are: * addresses * ageRanges * biographies * birthdays * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



684
685
686
687
688
689
690
691
692
693
694
# File 'lib/google/apis/people_v1/service.rb', line 684

def delete_person_contact_photo(resource_name, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+resourceName}:deleteContactPhoto', options)
  command.response_representation = Google::Apis::PeopleV1::DeleteContactPhotoResponse::Representation
  command.response_class = Google::Apis::PeopleV1::DeleteContactPhotoResponse
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['personFields'] = person_fields unless person_fields.nil?
  command.query['sources'] = sources unless sources.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, group_fields: nil, 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)

    Required. The resource name of the contact group to get.

  • group_fields (String) (defaults to: nil)

    Optional. A field mask to restrict which fields on the group are returned. Defaults to metadata, groupType, memberCount, and name if not set or set to empty. Valid fields are: * clientData * groupType * memberCount * metadata * name

  • max_members (Fixnum) (defaults to: nil)

    Optional. Specifies the maximum number of members to return. Defaults to 0 if not set, which will return zero members.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



189
190
191
192
193
194
195
196
197
198
199
# File 'lib/google/apis/people_v1/service.rb', line 189

def get_contact_group(resource_name, group_fields: nil, 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['groupFields'] = group_fields unless group_fields.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, sources: 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 returns a 400 error if 'personFields' is not specified.

Parameters:

  • person_fields (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • request_mask_include_field (String) (defaults to: nil)

    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) (defaults to: nil)

    Required. The resource names of the people to provide information about. It's repeatable. The URL query parameter should be resourceNames=& resourceNames=&... - 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 bypeople.connections. list`. There is a maximum of 200 resource names.

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



793
794
795
796
797
798
799
800
801
802
803
804
# File 'lib/google/apis/people_v1/service.rb', line 793

def get_people(person_fields: nil, request_mask_include_field: nil, resource_names: nil, sources: 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['sources'] = sources unless sources.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, sources: 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 returns a 400 error if ' personFields' is not specified.

Parameters:

  • resource_name (String)

    Required. 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 bypeople.connections.list`.

  • person_fields (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • request_mask_include_field (String) (defaults to: nil)

    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.

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_PROFILE and READ_SOURCE_TYPE_CONTACT if not set.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/google/apis/people_v1/service.rb', line 737

def get_person(resource_name, person_fields: nil, request_mask_include_field: nil, sources: 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['sources'] = sources unless sources.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(group_fields: nil, 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:

  • group_fields (String) (defaults to: nil)

    Optional. A field mask to restrict which fields on the group are returned. Defaults to metadata, groupType, memberCount, and name if not set or set to empty. Valid fields are: * clientData * groupType * memberCount * metadata * name

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of resources to return. Valid values are between 1 and 1000, inclusive. Defaults to 30 if not set or set to 0.

  • page_token (String) (defaults to: nil)

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

  • sync_token (String) (defaults to: nil)

    Optional. 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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/google/apis/people_v1/service.rb', line 235

def list_contact_groups(group_fields: nil, 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['groupFields'] = group_fields unless group_fields.nil?
  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_other_contacts(page_size: nil, page_token: nil, read_mask: nil, request_sync_token: nil, sources: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ListOtherContactsResponse

List all "Other contacts", that is contacts that are not in a contact group. " Other contacts" are typically auto created contacts from interactions. Sync tokens expire 7 days after the full sync. A request with an expired sync token will result in a 410 error. In the case of such an error clients should make a full sync request without a sync_token. The first page of a full sync request has an additional quota. If the quota is exceeded, a 429 error will be returned. This quota is fixed and can not be increased. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases. See example usage at List the user's other contacts that have changed.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of "Other contacts" to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous response next_page_token. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to otherContacts.list must match the first call that provided the page token.

  • read_mask (String) (defaults to: nil)

    Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. What values are valid depend on what ReadSourceType is used. If READ_SOURCE_TYPE_CONTACT is used, valid values are: * emailAddresses * metadata * names * phoneNumbers * photos If READ_SOURCE_TYPE_PROFILE is used, valid values are: * addresses * ageRanges * biographies * birthdays * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • request_sync_token (Boolean) (defaults to: nil)

    Optional. Whether the response should return next_sync_token on the last page of results. It can be used to get incremental changes since the last request by setting it on the request sync_token. More details about sync behavior at otherContacts.list.

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT if not set.

  • sync_token (String) (defaults to: nil)

    Optional. A sync token, received from a previous response next_sync_token Provide this to retrieve only the resources changed since the last request. When syncing, all other parameters provided to otherContacts.list must match the first call that provided the sync token. More details about sync behavior at otherContacts.list.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/google/apis/people_v1/service.rb', line 419

def list_other_contacts(page_size: nil, page_token: nil, read_mask: nil, request_sync_token: nil, sources: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/otherContacts', options)
  command.response_representation = Google::Apis::PeopleV1::ListOtherContactsResponse::Representation
  command.response_class = Google::Apis::PeopleV1::ListOtherContactsResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
  command.query['sources'] = sources unless sources.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, sources: 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. Sync tokens expire 7 days after the full sync. A request with an expired sync token will result in a 410 error. In the case of such an error clients should make a full sync request without a sync_token. The first page of a full sync request has an additional quota. If the quota is exceeded, a 429 error will be returned. This quota is fixed and can not be increased. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases. See example usage at List the user's contacts that have changed.

Parameters:

  • resource_name (String)

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

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of connections to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous response next_page_token. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to people.connections.list must match the first call that provided the page token.

  • person_fields (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • request_mask_include_field (String) (defaults to: nil)

    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) (defaults to: nil)

    Optional. Whether the response should return next_sync_token on the last page of results. It can be used to get incremental changes since the last request by setting it on the request sync_token. More details about sync behavior at people.connections.list.

  • sort_order (String) (defaults to: nil)

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

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

  • sync_token (String) (defaults to: nil)

    Optional. A sync token, received from a previous response next_sync_token Provide this to retrieve only the resources changed since the last request. When syncing, all other parameters provided to people.connections.list must match the first call that provided the sync token. More details about sync behavior at people.connections.list.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/google/apis/people_v1/service.rb', line 1164

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, sources: 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['sources'] = sources unless sources.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_directory_people(merge_sources: nil, page_size: nil, page_token: nil, read_mask: nil, request_sync_token: nil, sources: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::ListDirectoryPeopleResponse

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases. See example usage at List the directory people that have changed.

Parameters:

  • merge_sources (Array<String>, String) (defaults to: nil)

    Optional. Additional data to merge into the directory sources if they are connected through verified join keys such as email addresses or phone numbers.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of people to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous response next_page_token. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to people.listDirectoryPeople must match the first call that provided the page token.

  • read_mask (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • request_sync_token (Boolean) (defaults to: nil)

    Optional. Whether the response should return next_sync_token. It can be used to get incremental changes since the last request by setting it on the request sync_token. More details about sync behavior at people.listDirectoryPeople.

  • sources (Array<String>, String) (defaults to: nil)

    Required. Directory sources to return.

  • sync_token (String) (defaults to: nil)

    Optional. A sync token, received from a previous response next_sync_token Provide this to retrieve only the resources changed since the last request. When syncing, all other parameters provided to people.listDirectoryPeople must match the first call that provided the sync token. More details about sync behavior at people.listDirectoryPeople.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
# File 'lib/google/apis/people_v1/service.rb', line 863

def list_person_directory_people(merge_sources: nil, page_size: nil, page_token: nil, read_mask: nil, request_sync_token: nil, sources: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/people:listDirectoryPeople', options)
  command.response_representation = Google::Apis::PeopleV1::ListDirectoryPeopleResponse::Representation
  command.response_class = Google::Apis::PeopleV1::ListDirectoryPeopleResponse
  command.query['mergeSources'] = merge_sources unless merge_sources.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
  command.query['sources'] = sources unless sources.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. The only system contact groups that can have members added are contactGroups/ myContacts and contactGroups/starred. Other system contact groups are deprecated and can only have contacts removed.

Parameters:

  • resource_name (String)

    Required. The resource name of the contact group to modify.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



309
310
311
312
313
314
315
316
317
318
319
# File 'lib/google/apis/people_v1/service.rb', line 309

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

#search_other_contacts(page_size: nil, query: nil, read_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::SearchResponse

Provides a list of contacts in the authenticated user's other contacts that matches the search query. The query matches on a contact's names, emailAddresses, and phoneNumbers fields that are from the OTHER_CONTACT source. IMPORTANT: Before searching, clients should send a warmup request with an empty query to update the cache. See https://developers.google.com/ people/v1/other-contacts#search_the_users_other_contacts

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of results to return. Defaults to 10 if field is not set, or set to 0. Values greater than 30 will be capped to 30.

  • query (String) (defaults to: nil)

    Required. The plain-text query for the request. The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not " oo n".

  • read_mask (String) (defaults to: nil)

    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: * emailAddresses * metadata * names * phoneNumbers

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



469
470
471
472
473
474
475
476
477
478
479
# File 'lib/google/apis/people_v1/service.rb', line 469

def search_other_contacts(page_size: nil, query: nil, read_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/otherContacts:search', options)
  command.response_representation = Google::Apis::PeopleV1::SearchResponse::Representation
  command.response_class = Google::Apis::PeopleV1::SearchResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['query'] = query unless query.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#search_person_contacts(page_size: nil, query: nil, read_mask: nil, sources: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::SearchResponse

Provides a list of contacts in the authenticated user's grouped contacts that matches the search query. The query matches on a contact's names, nickNames , emailAddresses, phoneNumbers, and organizations fields that are from the CONTACT source. IMPORTANT: Before searching, clients should send a warmup request with an empty query to update the cache. See https://developers. google.com/people/v1/contacts#search_the_users_contacts

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of results to return. Defaults to 10 if field is not set, or set to 0. Values greater than 30 will be capped to 30.

  • query (String) (defaults to: nil)

    Required. The plain-text query for the request. The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not " oo n".

  • read_mask (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT if not set.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



921
922
923
924
925
926
927
928
929
930
931
932
# File 'lib/google/apis/people_v1/service.rb', line 921

def search_person_contacts(page_size: nil, query: nil, read_mask: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/people:searchContacts', options)
  command.response_representation = Google::Apis::PeopleV1::SearchResponse::Representation
  command.response_class = Google::Apis::PeopleV1::SearchResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['query'] = query unless query.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['sources'] = sources unless sources.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#search_person_directory_people(merge_sources: nil, page_size: nil, page_token: nil, query: nil, read_mask: nil, sources: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::SearchDirectoryPeopleResponse

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory that match the search query.

Parameters:

  • merge_sources (Array<String>, String) (defaults to: nil)

    Optional. Additional data to merge into the directory sources if they are connected through verified join keys such as email addresses or phone numbers.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of people to include in the response. Valid values are between 1 and 500, inclusive. Defaults to 100 if not set or set to 0.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous response next_page_token. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchDirectoryPeople must match the first call that provided the page token.

  • query (String) (defaults to: nil)

    Required. Prefix query that matches fields in the person. Does NOT use the read_mask for determining what fields to match.

  • read_mask (String) (defaults to: nil)

    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 * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined

  • sources (Array<String>, String) (defaults to: nil)

    Required. Directory sources to return.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File 'lib/google/apis/people_v1/service.rb', line 977

def search_person_directory_people(merge_sources: nil, page_size: nil, page_token: nil, query: nil, read_mask: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/people:searchDirectoryPeople', options)
  command.response_representation = Google::Apis::PeopleV1::SearchDirectoryPeopleResponse::Representation
  command.response_class = Google::Apis::PeopleV1::SearchDirectoryPeopleResponse
  command.query['mergeSources'] = merge_sources unless merge_sources.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['query'] = query unless query.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['sources'] = sources unless sources.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. Updated contact group names must be unique to the users contact groups. Attempting to create a group with a duplicate name will return a HTTP 409 error.

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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



273
274
275
276
277
278
279
280
281
282
283
# File 'lib/google/apis/people_v1/service.rb', line 273

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, person_fields: nil, sources: 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. Any non-contact data in the person to update will be ignored. All fields specified in the update_mask will be replaced. The server returns a 400 error if person.metadata.sources is not specified for the contact to be updated or if there is no contact source. The server returns a 400 error with reason "failedPrecondition" 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 merge their updates into the latest person. The server returns a 400 error if memberships are being updated and there are no contact group memberships specified on the person. The server returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: * biographies * birthdays * genders * names

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)
  • person_fields (String) (defaults to: nil)

    Optional. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Defaults to all fields if not set. Valid values are: * addresses * ageRanges * biographies

    • birthdays * calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills * urls * userDefined
  • sources (Array<String>, String) (defaults to: nil)

    Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

  • update_person_fields (String) (defaults to: nil)

    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 * calendarUrls * clientData * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * relations * sipAddresses * urls * userDefined

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/google/apis/people_v1/service.rb', line 1046

def update_person_contact(resource_name, person_object = nil, person_fields: nil, sources: 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['personFields'] = person_fields unless person_fields.nil?
  command.query['sources'] = sources unless sources.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

#update_person_contact_photo(resource_name, update_contact_photo_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PeopleV1::UpdateContactPhotoResponse

Update a contact's photo.

Parameters:

  • resource_name (String)

    Required. Person resource name

  • update_contact_photo_request_object (Google::Apis::PeopleV1::UpdateContactPhotoRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
# File 'lib/google/apis/people_v1/service.rb', line 1082

def update_person_contact_photo(resource_name, update_contact_photo_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+resourceName}:updateContactPhoto', options)
  command.request_representation = Google::Apis::PeopleV1::UpdateContactPhotoRequest::Representation
  command.request_object = update_contact_photo_request_object
  command.response_representation = Google::Apis::PeopleV1::UpdateContactPhotoResponse::Representation
  command.response_class = Google::Apis::PeopleV1::UpdateContactPhotoResponse
  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