Class: Google::Apis::PeopleV1::PeopleService

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

Overview

Google People API

The Google People API service gives access to information about profiles and contacts.

Examples:

require 'google/apis/people_v1'

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

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

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

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Constructor Details

#initializePeopleService

Returns a new instance of PeopleService


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

def initialize
  super('https://people.googleapis.com/', '')
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.


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

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.


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

def quota_user
  @quota_user
end

Instance Method Details

#get_people(resource_names: nil, request_mask_include_field: 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.

Parameters:

  • resource_names (Array<String>, String)

    The resource name, such as one returned by people.connections.list, of one of the people to provide information about. You can include this parameter up to 50 times in one request.

  • request_mask_include_field (String)

    Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with person.: for example, person.names or person.photos.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


118
119
120
121
122
123
124
125
126
127
# File 'generated/google/apis/people_v1/service.rb', line 118

def get_people(resource_names: nil, request_mask_include_field: 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['resourceNames'] = resource_names unless resource_names.nil?
  command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Provides information about a person resource for a resource name. Use people/ me to indicate the authenticated user.

Parameters:

  • resource_name (String)

    The resource name of the person to provide information about. - To get information about the authenticated user, specify people/me. - To get information about any user, specify the resource name that identifies the user, such as the resource names returned by people.connections.list.

  • request_mask_include_field (String)

    Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with person.: for example, person.names or person.photos.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


79
80
81
82
83
84
85
86
87
88
# File 'generated/google/apis/people_v1/service.rb', line 79

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

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

Provides a list of the authenticated user's contacts merged with any linked profiles.

Parameters:

  • resource_name (String)

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

  • page_token (String)

    The token of the page to be returned.

  • page_size (Fixnum)

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

  • sort_order (String)

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

  • sync_token (String)

    A sync token, returned by a previous call to people.connections.list. Only resources changed since the sync token was created are returned.

  • request_mask_include_field (String)

    Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with person.: for example, person.names or person.photos.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'generated/google/apis/people_v1/service.rb', line 165

def list_person_connections(resource_name, page_token: nil, page_size: nil, sort_order: nil, sync_token: nil, request_mask_include_field: 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['pageToken'] = page_token unless page_token.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['sortOrder'] = sort_order unless sort_order.nil?
  command.query['syncToken'] = sync_token unless sync_token.nil?
  command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end