2016-02-10 21:57:13 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
require 'google/apis/core/base_service'
|
|
|
|
require 'google/apis/core/json_representation'
|
|
|
|
require 'google/apis/core/hashable'
|
|
|
|
require 'google/apis/errors'
|
|
|
|
|
|
|
|
module Google
|
|
|
|
module Apis
|
|
|
|
module PeopleV1
|
2018-02-21 00:36:04 +00:00
|
|
|
# People API
|
2016-02-10 21:57:13 +00:00
|
|
|
#
|
2017-02-13 23:28:52 +00:00
|
|
|
# Provides access to information about profiles and contacts.
|
2016-02-10 21:57:13 +00:00
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# require 'google/apis/people_v1'
|
|
|
|
#
|
|
|
|
# People = Google::Apis::PeopleV1 # Alias the module
|
2017-05-04 19:35:56 +00:00
|
|
|
# service = People::PeopleServiceService.new
|
2016-02-10 21:57:13 +00:00
|
|
|
#
|
|
|
|
# @see https://developers.google.com/people/
|
2017-05-04 19:35:56 +00:00
|
|
|
class PeopleServiceService < Google::Apis::Core::BaseService
|
2017-06-14 17:02:03 +00:00
|
|
|
# @return [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.
|
|
|
|
attr_accessor :key
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# @return [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.
|
|
|
|
attr_accessor :quota_user
|
|
|
|
|
2016-02-10 21:57:13 +00:00
|
|
|
def initialize
|
|
|
|
super('https://people.googleapis.com/', '')
|
2017-04-03 20:18:48 +00:00
|
|
|
@batch_path = 'batch'
|
2016-02-10 21:57:13 +00:00
|
|
|
end
|
|
|
|
|
2017-07-12 20:10:42 +00:00
|
|
|
# Get a list of contact groups owned by the authenticated user by specifying
|
|
|
|
# a list of contact group resource names.
|
|
|
|
# @param [Fixnum] max_members
|
2019-11-01 00:37:15 +00:00
|
|
|
# Optional. Specifies the maximum number of members to return for each group.
|
|
|
|
# Defaults
|
|
|
|
# to 0 if not set, which will return zero members.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [Array<String>, String] resource_names
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource names of the contact groups to get.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::BatchGetContactGroupsResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::BatchGetContactGroupsResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def batch_contact_group_get(max_members: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/contactGroups:batchGet', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
command.response_representation = Google::Apis::PeopleV1::BatchGetContactGroupsResponse::Representation
|
|
|
|
command.response_class = Google::Apis::PeopleV1::BatchGetContactGroupsResponse
|
|
|
|
command.query['maxMembers'] = max_members unless max_members.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['resourceNames'] = resource_names unless resource_names.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# Create a new contact group owned by the authenticated user.
|
|
|
|
# @param [Google::Apis::PeopleV1::CreateContactGroupRequest] create_contact_group_request_object
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
2017-08-25 19:54:22 +00:00
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
2017-07-12 20:10:42 +00:00
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
2017-08-25 19:54:22 +00:00
|
|
|
# @return [Google::Apis::PeopleV1::ContactGroup]
|
2017-07-12 20:10:42 +00:00
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def create_contact_group(create_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:post, 'v1/contactGroups', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
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
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# Delete an existing contact group owned by the authenticated user by
|
|
|
|
# specifying a contact group resource name.
|
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the contact group to delete.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [Boolean] delete_contacts
|
2019-11-01 00:37:15 +00:00
|
|
|
# Optional. Set to true to also delete the contacts in the specified group.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
2017-08-25 19:54:22 +00:00
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Empty] parsed result object
|
2017-07-12 20:10:42 +00:00
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
2017-08-25 19:54:22 +00:00
|
|
|
# @return [Google::Apis::PeopleV1::Empty]
|
2017-07-12 20:10:42 +00:00
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def delete_contact_group(resource_name, delete_contacts: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:delete, 'v1/{+resourceName}', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
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?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Get a specific contact group owned by the authenticated user by specifying
|
|
|
|
# a contact group resource name.
|
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the contact group to get.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [Fixnum] max_members
|
2019-11-01 00:37:15 +00:00
|
|
|
# Optional. Specifies the maximum number of members to return. Defaults to 0 if
|
|
|
|
# not
|
|
|
|
# set, which will return zero members.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ContactGroup]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def get_contact_group(resource_name, max_members: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/{+resourceName}', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
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?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# List all contact groups owned by the authenticated user. Members of the
|
|
|
|
# contact groups are not populated.
|
|
|
|
# @param [Fixnum] page_size
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] page_token
|
2020-01-24 00:37:26 +00:00
|
|
|
# Optional. The next_page_token value returned from a previous call to
|
2017-08-25 19:54:22 +00:00
|
|
|
# [ListContactGroups](/people/api/rest/v1/contactgroups/list).
|
|
|
|
# Requests the next page of resources.
|
|
|
|
# @param [String] sync_token
|
2020-01-24 00:37:26 +00:00
|
|
|
# Optional. A sync token, returned by a previous call to `contactgroups.list`.
|
2017-08-25 19:54:22 +00:00
|
|
|
# Only resources changed since the sync token was created will be returned.
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ListContactGroupsResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ListContactGroupsResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
def list_contact_groups(page_size: nil, page_token: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/contactGroups', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
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?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update the name of an existing contact group owned by the authenticated
|
|
|
|
# user.
|
|
|
|
# @param [String] resource_name
|
|
|
|
# The resource name for the contact group, assigned by the server. An ASCII
|
2020-01-24 00:37:26 +00:00
|
|
|
# string, in the form of `contactGroups/`contact_group_id``.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [Google::Apis::PeopleV1::UpdateContactGroupRequest] update_contact_group_request_object
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ContactGroup]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def update_contact_group(resource_name, update_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:put, 'v1/{+resourceName}', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
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?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Modify the members of a contact group owned by the authenticated user.
|
2019-03-15 00:36:52 +00:00
|
|
|
# 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.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the contact group to modify.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [Google::Apis::PeopleV1::ModifyContactGroupMembersRequest] modify_contact_group_members_request_object
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ModifyContactGroupMembersResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ModifyContactGroupMembersResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def modify_contact_group_members(resource_name, modify_contact_group_members_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:post, 'v1/{+resourceName}/members:modify', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
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?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2020-06-17 00:38:10 +00:00
|
|
|
# Copies an "Other contact" to a new contact in the user's "myContacts" group
|
2020-06-03 00:38:28 +00:00
|
|
|
# @param [String] resource_name
|
2020-06-17 00:38:10 +00:00
|
|
|
# Required. The resource name of the "Other contact" to copy.
|
2020-06-03 00:38:28 +00:00
|
|
|
# @param [Google::Apis::PeopleV1::CopyOtherContactToMyContactsGroupRequest] copy_other_contact_to_my_contacts_group_request_object
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::Person]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
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
|
|
|
|
|
2020-06-17 00:38:10 +00:00
|
|
|
# List all "Other contacts", that is contacts that are not in a contact
|
|
|
|
# group. "Other contacts" are typically auto created contacts from
|
|
|
|
# interactions.
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [Fixnum] page_size
|
2020-06-17 00:38:10 +00:00
|
|
|
# Optional. The number of "Other contacts" to include in the response. Valid
|
2020-06-10 00:38:16 +00:00
|
|
|
# values are
|
|
|
|
# between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.
|
|
|
|
# @param [String] page_token
|
|
|
|
# Optional. A page token, received from a previous `ListOtherContacts` call.
|
|
|
|
# Provide this to retrieve the subsequent page.
|
|
|
|
# When paginating, all other parameters provided to `ListOtherContacts`
|
|
|
|
# must match the call that provided the page token.
|
|
|
|
# @param [String] read_mask
|
|
|
|
# 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
|
|
|
|
# * names
|
|
|
|
# * phoneNumbers
|
|
|
|
# @param [Boolean] request_sync_token
|
|
|
|
# Optional. Whether the response should include `next_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.
|
|
|
|
# @param [String] sync_token
|
|
|
|
# Optional. A sync token, received from a previous `ListOtherContacts` call.
|
|
|
|
# Provide this to retrieve only the resources changed since the last request.
|
|
|
|
# Sync requests that specify `sync_token` have an additional rate limit.
|
|
|
|
# When syncing, all other parameters provided to `ListOtherContacts`
|
|
|
|
# must match the call that provided the sync token.
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ListOtherContactsResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ListOtherContactsResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
def list_other_contacts(page_size: nil, page_token: nil, read_mask: nil, request_sync_token: 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['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
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# Create a new contact and return the person resource for that contact.
|
|
|
|
# @param [Google::Apis::PeopleV1::Person] person_object
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [String] person_fields
|
|
|
|
# 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
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
|
|
|
# * interests
|
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
|
|
|
# * sipAddresses
|
|
|
|
# * skills
|
|
|
|
# * urls
|
|
|
|
# * userDefined
|
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.CONTACT and
|
|
|
|
# ReadSourceType.PROFILE if not
|
|
|
|
# set.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::Person]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
def create_person_contact(person_object = nil, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:post, 'v1/people:createContact', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
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
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['personFields'] = person_fields unless person_fields.nil?
|
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Delete a contact person. Any non-contact data will not be deleted.
|
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the contact to delete.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Empty] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::Empty]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2017-08-25 19:54:22 +00:00
|
|
|
def delete_person_contact(resource_name, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:delete, 'v1/{+resourceName}:deleteContact', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
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?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2019-07-19 00:38:19 +00:00
|
|
|
# Delete a contact's photo.
|
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the contact whose photo will be deleted.
|
2019-07-19 00:38:19 +00:00
|
|
|
# @param [String] person_fields
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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:
|
2019-07-19 00:38:19 +00:00
|
|
|
# * addresses
|
|
|
|
# * ageRanges
|
|
|
|
# * biographies
|
|
|
|
# * birthdays
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
|
|
|
# * interests
|
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
|
|
|
# * sipAddresses
|
|
|
|
# * skills
|
|
|
|
# * urls
|
|
|
|
# * userDefined
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.CONTACT and
|
|
|
|
# ReadSourceType.PROFILE if not
|
|
|
|
# set.
|
2019-07-19 00:38:19 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::DeleteContactPhotoResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::DeleteContactPhotoResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
def delete_person_contact_photo(resource_name, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-07-19 00:38:19 +00:00
|
|
|
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?
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2019-07-19 00:38:19 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# Provides information about a person by specifying a resource name. Use
|
|
|
|
# `people/me` to indicate the authenticated user.
|
2017-07-12 20:10:42 +00:00
|
|
|
# The request throws a 400 error if 'personFields' is not specified.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name of the person to provide information about.
|
2017-08-25 19:54:22 +00:00
|
|
|
# - To get information about the authenticated user, specify `people/me`.
|
|
|
|
# - To get information about a google account, specify
|
2020-01-24 00:37:26 +00:00
|
|
|
# `people/`account_id``.
|
2017-08-25 19:54:22 +00:00
|
|
|
# - To get information about a contact, specify the resource name that
|
|
|
|
# identifies the contact as returned by
|
|
|
|
# [`people.connections.list`](/people/api/rest/v1/people.connections/list).
|
2017-06-14 17:02:03 +00:00
|
|
|
# @param [String] person_fields
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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:
|
2017-06-14 17:02:03 +00:00
|
|
|
# * addresses
|
|
|
|
# * ageRanges
|
|
|
|
# * biographies
|
|
|
|
# * birthdays
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
2018-01-09 00:36:08 +00:00
|
|
|
# * interests
|
2017-06-14 17:02:03 +00:00
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
2018-05-23 00:36:42 +00:00
|
|
|
# * sipAddresses
|
2017-06-14 17:02:03 +00:00
|
|
|
# * skills
|
|
|
|
# * urls
|
2018-05-15 00:38:49 +00:00
|
|
|
# * userDefined
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] request_mask_include_field
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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`.
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.PROFILE
|
|
|
|
# and
|
|
|
|
# ReadSourceType.CONTACT
|
|
|
|
# if not set.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2016-02-10 21:57:13 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
2017-08-25 19:54:22 +00:00
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
2016-02-10 21:57:13 +00:00
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
2017-08-25 19:54:22 +00:00
|
|
|
# @return [Google::Apis::PeopleV1::Person]
|
2016-02-10 21:57:13 +00:00
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
def get_person(resource_name, person_fields: nil, request_mask_include_field: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/{+resourceName}', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
command.response_representation = Google::Apis::PeopleV1::Person::Representation
|
|
|
|
command.response_class = Google::Apis::PeopleV1::Person
|
|
|
|
command.params['resourceName'] = resource_name unless resource_name.nil?
|
2017-06-14 17:02:03 +00:00
|
|
|
command.query['personFields'] = person_fields unless person_fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2017-05-26 16:44:32 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2016-02-10 21:57:13 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2017-08-25 19:54:22 +00:00
|
|
|
# Provides information about a list of specific people by specifying a list
|
|
|
|
# of requested resource names. Use `people/me` to indicate the authenticated
|
|
|
|
# user.
|
2017-07-12 20:10:42 +00:00
|
|
|
# The request throws a 400 error if 'personFields' is not specified.
|
2017-06-14 17:02:03 +00:00
|
|
|
# @param [String] person_fields
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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:
|
2017-06-14 17:02:03 +00:00
|
|
|
# * addresses
|
|
|
|
# * ageRanges
|
|
|
|
# * biographies
|
|
|
|
# * birthdays
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
2018-01-09 00:36:08 +00:00
|
|
|
# * interests
|
2017-06-14 17:02:03 +00:00
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
2018-05-23 00:36:42 +00:00
|
|
|
# * sipAddresses
|
2017-06-14 17:02:03 +00:00
|
|
|
# * skills
|
|
|
|
# * urls
|
2018-05-15 00:38:49 +00:00
|
|
|
# * userDefined
|
2016-02-10 21:57:13 +00:00
|
|
|
# @param [String] request_mask_include_field
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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`.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [Array<String>, String] resource_names
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource names of the people to provide information about.
|
2017-08-25 19:54:22 +00:00
|
|
|
# - To get information about the authenticated user, specify `people/me`.
|
|
|
|
# - To get information about a google account, specify
|
2020-01-24 00:37:26 +00:00
|
|
|
# `people/`account_id``.
|
2017-08-25 19:54:22 +00:00
|
|
|
# - To get information about a contact, specify the resource name that
|
|
|
|
# identifies the contact as returned by
|
|
|
|
# [`people.connections.list`](/people/api/rest/v1/people.connections/list).
|
|
|
|
# You can include up to 50 resource names in one request.
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.CONTACT
|
|
|
|
# and
|
|
|
|
# ReadSourceType.PROFILE
|
|
|
|
# if not set.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2016-02-10 21:57:13 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
2017-08-25 19:54:22 +00:00
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::GetPeopleResponse] parsed result object
|
2016-02-10 21:57:13 +00:00
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
2017-08-25 19:54:22 +00:00
|
|
|
# @return [Google::Apis::PeopleV1::GetPeopleResponse]
|
2016-02-10 21:57:13 +00:00
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
def get_people(person_fields: nil, request_mask_include_field: nil, resource_names: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/people:batchGet', options)
|
2017-08-25 19:54:22 +00:00
|
|
|
command.response_representation = Google::Apis::PeopleV1::GetPeopleResponse::Representation
|
|
|
|
command.response_class = Google::Apis::PeopleV1::GetPeopleResponse
|
2017-06-14 17:02:03 +00:00
|
|
|
command.query['personFields'] = person_fields unless person_fields.nil?
|
2016-02-10 21:57:13 +00:00
|
|
|
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['resourceNames'] = resource_names unless resource_names.nil?
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2020-06-11 00:38:48 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Provides a list of domain profiles and domain contacts in the authenticated
|
|
|
|
# user's domain directory.
|
|
|
|
# @param [Array<String>, String] merge_sources
|
|
|
|
# Optional. Additional data to merge into the directory sources if they are
|
|
|
|
# connected
|
|
|
|
# through verified join keys such as email addresses or phone numbers.
|
|
|
|
# @param [Fixnum] page_size
|
|
|
|
# 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.
|
|
|
|
# @param [String] page_token
|
|
|
|
# Optional. A page token, received from a previous `ListDirectoryPeople` call.
|
|
|
|
# Provide this to retrieve the subsequent page.
|
|
|
|
# When paginating, all other parameters provided to `ListDirectoryPeople`
|
|
|
|
# must match the call that provided the page token.
|
|
|
|
# @param [String] read_mask
|
|
|
|
# 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
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
|
|
|
# * interests
|
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
|
|
|
# * sipAddresses
|
|
|
|
# * skills
|
|
|
|
# * urls
|
|
|
|
# * userDefined
|
|
|
|
# @param [Boolean] request_sync_token
|
|
|
|
# Optional. Whether the response should include `next_sync_token`, which can be
|
|
|
|
# used to
|
|
|
|
# get all changes since the last request. For subsequent sync requests use
|
|
|
|
# the `sync_token` param instead.
|
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Required. Directory sources to return.
|
|
|
|
# @param [String] sync_token
|
|
|
|
# Optional. A sync token, received from a previous `ListDirectoryPeople` call.
|
|
|
|
# Provide this to retrieve only the resources changed since the last request.
|
|
|
|
# When syncing, all other parameters provided to `ListDirectoryPeople`
|
|
|
|
# must match the call that provided the sync token.
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ListDirectoryPeopleResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ListDirectoryPeopleResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
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
|
|
|
|
|
|
|
|
# Provides a list of domain profiles and domain contacts in the authenticated
|
|
|
|
# user's domain directory that match the search query.
|
|
|
|
# @param [Array<String>, String] merge_sources
|
|
|
|
# Optional. Additional data to merge into the directory sources if they are
|
|
|
|
# connected
|
|
|
|
# through verified join keys such as email addresses or phone numbers.
|
|
|
|
# @param [Fixnum] page_size
|
|
|
|
# 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.
|
|
|
|
# @param [String] page_token
|
|
|
|
# Optional. A page token, received from a previous `SearchDirectoryPeople` call.
|
|
|
|
# Provide this to retrieve the subsequent page.
|
|
|
|
# When paginating, all other parameters provided to `SearchDirectoryPeople`
|
|
|
|
# must match the call that provided the page token.
|
|
|
|
# @param [String] query
|
|
|
|
# Required. Prefix query that matches fields in the person. Does NOT use the
|
|
|
|
# read_mask for determining what fields to match.
|
|
|
|
# @param [String] read_mask
|
|
|
|
# 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
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
|
|
|
# * interests
|
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
|
|
|
# * sipAddresses
|
|
|
|
# * skills
|
|
|
|
# * urls
|
|
|
|
# * userDefined
|
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Required. Directory sources to return.
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::SearchDirectoryPeopleResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::SearchDirectoryPeopleResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
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?
|
2017-05-26 16:44:32 +00:00
|
|
|
command.query['fields'] = fields unless fields.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2016-02-10 21:57:13 +00:00
|
|
|
execute_or_queue_command(command, &block)
|
|
|
|
end
|
|
|
|
|
2017-07-12 20:10:42 +00:00
|
|
|
# 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.
|
2019-08-24 00:37:50 +00:00
|
|
|
# The request throws a 400 error with an 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 re-apply their updates
|
|
|
|
# to the latest person.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] resource_name
|
|
|
|
# The resource name for the person, assigned by the server. An ASCII string
|
2017-08-25 19:54:22 +00:00
|
|
|
# with a max length of 27 characters, in the form of
|
2020-01-24 00:37:26 +00:00
|
|
|
# `people/`person_id``.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [Google::Apis::PeopleV1::Person] person_object
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [String] person_fields
|
|
|
|
# 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
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
|
|
|
# * interests
|
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
|
|
|
# * sipAddresses
|
|
|
|
# * skills
|
|
|
|
# * urls
|
|
|
|
# * userDefined
|
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.CONTACT and
|
|
|
|
# ReadSourceType.PROFILE if not
|
|
|
|
# set.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] update_person_fields
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. A field mask to restrict which fields on the person are updated.
|
|
|
|
# Multiple
|
|
|
|
# fields can be specified by separating them with commas.
|
2018-02-24 00:37:29 +00:00
|
|
|
# All updated fields will be replaced. Valid values are:
|
2017-07-12 20:10:42 +00:00
|
|
|
# * addresses
|
|
|
|
# * biographies
|
|
|
|
# * birthdays
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
2018-01-09 00:36:08 +00:00
|
|
|
# * interests
|
2017-07-12 20:10:42 +00:00
|
|
|
# * locales
|
2019-04-25 00:37:02 +00:00
|
|
|
# * memberships
|
2017-07-12 20:10:42 +00:00
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * relations
|
|
|
|
# * residences
|
2018-05-23 00:36:42 +00:00
|
|
|
# * sipAddresses
|
2017-07-12 20:10:42 +00:00
|
|
|
# * urls
|
2018-05-15 00:38:49 +00:00
|
|
|
# * userDefined
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::Person]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
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)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:patch, 'v1/{+resourceName}:updateContact', options)
|
2017-07-12 20:10:42 +00:00
|
|
|
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?
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['personFields'] = person_fields unless person_fields.nil?
|
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2017-07-12 20:10:42 +00:00
|
|
|
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
|
|
|
|
|
2019-07-19 00:38:19 +00:00
|
|
|
# Update a contact's photo.
|
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. Person resource name
|
2019-07-19 00:38:19 +00:00
|
|
|
# @param [Google::Apis::PeopleV1::UpdateContactPhotoRequest] update_contact_photo_request_object
|
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::UpdateContactPhotoResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::UpdateContactPhotoResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
|
|
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
|
|
|
|
|
2020-06-03 00:38:28 +00:00
|
|
|
# Provides a list of the authenticated user's contacts.
|
2017-07-12 20:10:42 +00:00
|
|
|
# The request throws a 400 error if 'personFields' is not specified.
|
2017-03-10 21:11:09 +00:00
|
|
|
# @param [String] resource_name
|
2019-11-01 00:37:15 +00:00
|
|
|
# Required. The resource name to return connections for. Only `people/me` is
|
|
|
|
# valid.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [Fixnum] page_size
|
2019-11-01 00:37:15 +00:00
|
|
|
# Optional. The number of connections to include in the response. Valid values
|
|
|
|
# are
|
2020-05-15 00:38:32 +00:00
|
|
|
# between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] page_token
|
2020-04-13 16:49:10 +00:00
|
|
|
# Optional. A page token, received from a previous `ListConnections` call.
|
|
|
|
# Provide this to retrieve the subsequent page.
|
|
|
|
# When paginating, all other parameters provided to `ListConnections`
|
|
|
|
# must match the call that provided the page token.
|
2017-06-14 17:02:03 +00:00
|
|
|
# @param [String] person_fields
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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:
|
2017-06-14 17:02:03 +00:00
|
|
|
# * addresses
|
|
|
|
# * ageRanges
|
|
|
|
# * biographies
|
|
|
|
# * birthdays
|
|
|
|
# * coverPhotos
|
|
|
|
# * emailAddresses
|
|
|
|
# * events
|
|
|
|
# * genders
|
|
|
|
# * imClients
|
2018-01-09 00:36:08 +00:00
|
|
|
# * interests
|
2017-06-14 17:02:03 +00:00
|
|
|
# * locales
|
|
|
|
# * memberships
|
|
|
|
# * metadata
|
|
|
|
# * names
|
|
|
|
# * nicknames
|
|
|
|
# * occupations
|
|
|
|
# * organizations
|
|
|
|
# * phoneNumbers
|
|
|
|
# * photos
|
|
|
|
# * relations
|
|
|
|
# * residences
|
2018-05-23 00:36:42 +00:00
|
|
|
# * sipAddresses
|
2017-06-14 17:02:03 +00:00
|
|
|
# * skills
|
|
|
|
# * urls
|
2018-05-15 00:38:49 +00:00
|
|
|
# * userDefined
|
2017-07-12 20:10:42 +00:00
|
|
|
# @param [String] request_mask_include_field
|
2019-11-01 00:37:15 +00:00
|
|
|
# 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`.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [Boolean] request_sync_token
|
2020-04-13 16:49:10 +00:00
|
|
|
# Optional. Whether the response should include `next_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
|
2018-01-18 00:35:53 +00:00
|
|
|
# `request_sync_token` have an additional rate limit.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] sort_order
|
2020-01-24 00:37:26 +00:00
|
|
|
# Optional. The order in which the connections should be sorted. Defaults to
|
2017-08-25 19:54:22 +00:00
|
|
|
# `LAST_MODIFIED_ASCENDING`.
|
2020-06-10 00:38:16 +00:00
|
|
|
# @param [Array<String>, String] sources
|
|
|
|
# Optional. A mask of what source types to return. Defaults to
|
|
|
|
# ReadSourceType.CONTACT
|
|
|
|
# and
|
|
|
|
# ReadSourceType.PROFILE if not
|
|
|
|
# set.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] sync_token
|
2020-04-13 16:49:10 +00:00
|
|
|
# Optional. A sync token, received from a previous `ListConnections` call.
|
|
|
|
# Provide this to retrieve only the resources changed since the last request.
|
2018-01-18 00:35:53 +00:00
|
|
|
# Sync requests that specify `sync_token` have an additional rate limit.
|
2020-04-13 16:49:10 +00:00
|
|
|
# When syncing, all other parameters provided to `ListConnections`
|
|
|
|
# must match the call that provided the sync token.
|
2017-08-25 19:54:22 +00:00
|
|
|
# @param [String] fields
|
|
|
|
# Selector specifying which fields to include in a partial response.
|
2016-02-10 21:57:13 +00:00
|
|
|
# @param [String] quota_user
|
|
|
|
# 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.
|
|
|
|
# @param [Google::Apis::RequestOptions] options
|
|
|
|
# Request-specific options
|
|
|
|
#
|
|
|
|
# @yield [result, err] Result & error if block supplied
|
|
|
|
# @yieldparam result [Google::Apis::PeopleV1::ListConnectionsResponse] parsed result object
|
|
|
|
# @yieldparam err [StandardError] error object if request failed
|
|
|
|
#
|
|
|
|
# @return [Google::Apis::PeopleV1::ListConnectionsResponse]
|
|
|
|
#
|
|
|
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
|
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
|
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2020-06-10 00:38:16 +00:00
|
|
|
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)
|
2019-05-10 00:37:26 +00:00
|
|
|
command = make_simple_command(:get, 'v1/{+resourceName}/connections', options)
|
2016-02-10 21:57:13 +00:00
|
|
|
command.response_representation = Google::Apis::PeopleV1::ListConnectionsResponse::Representation
|
|
|
|
command.response_class = Google::Apis::PeopleV1::ListConnectionsResponse
|
2017-03-10 21:11:09 +00:00
|
|
|
command.params['resourceName'] = resource_name unless resource_name.nil?
|
2017-03-31 19:53:27 +00:00
|
|
|
command.query['pageSize'] = page_size unless page_size.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['pageToken'] = page_token unless page_token.nil?
|
|
|
|
command.query['personFields'] = person_fields unless person_fields.nil?
|
2017-05-26 16:44:32 +00:00
|
|
|
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
|
|
|
|
command.query['sortOrder'] = sort_order unless sort_order.nil?
|
2020-06-10 00:38:16 +00:00
|
|
|
command.query['sources'] = sources unless sources.nil?
|
2020-06-03 00:38:28 +00:00
|
|
|
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
|
2016-02-10 21:57:13 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def apply_command_defaults(command)
|
2017-06-14 17:02:03 +00:00
|
|
|
command.query['key'] = key unless key.nil?
|
2017-08-25 19:54:22 +00:00
|
|
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2016-02-10 21:57:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|