google-apis-people_v1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-people_v1.rb +15 -0
- data/lib/google/apis/people_v1.rb +69 -0
- data/lib/google/apis/people_v1/classes.rb +2630 -0
- data/lib/google/apis/people_v1/gem_version.rb +28 -0
- data/lib/google/apis/people_v1/representations.rb +1135 -0
- data/lib/google/apis/people_v1/service.rb +939 -0
- metadata +76 -0
@@ -0,0 +1,939 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module PeopleV1
|
23
|
+
# People API
|
24
|
+
#
|
25
|
+
# Provides access to information about profiles and contacts.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/people_v1'
|
29
|
+
#
|
30
|
+
# People = Google::Apis::PeopleV1 # Alias the module
|
31
|
+
# service = People::PeopleServiceService.new
|
32
|
+
#
|
33
|
+
# @see https://developers.google.com/people/
|
34
|
+
class PeopleServiceService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
def initialize
|
46
|
+
super('https://people.googleapis.com/', '',
|
47
|
+
client_name: 'google-apis-people_v1',
|
48
|
+
client_version: Google::Apis::PeopleV1::GEM_VERSION)
|
49
|
+
@batch_path = 'batch'
|
50
|
+
end
|
51
|
+
|
52
|
+
# Get a list of contact groups owned by the authenticated user by specifying a
|
53
|
+
# list of contact group resource names.
|
54
|
+
# @param [Fixnum] max_members
|
55
|
+
# Optional. Specifies the maximum number of members to return for each group.
|
56
|
+
# Defaults to 0 if not set, which will return zero members.
|
57
|
+
# @param [Array<String>, String] resource_names
|
58
|
+
# Required. The resource names of the contact groups to get.
|
59
|
+
# @param [String] fields
|
60
|
+
# Selector specifying which fields to include in a partial response.
|
61
|
+
# @param [String] quota_user
|
62
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
63
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
64
|
+
# @param [Google::Apis::RequestOptions] options
|
65
|
+
# Request-specific options
|
66
|
+
#
|
67
|
+
# @yield [result, err] Result & error if block supplied
|
68
|
+
# @yieldparam result [Google::Apis::PeopleV1::BatchGetContactGroupsResponse] parsed result object
|
69
|
+
# @yieldparam err [StandardError] error object if request failed
|
70
|
+
#
|
71
|
+
# @return [Google::Apis::PeopleV1::BatchGetContactGroupsResponse]
|
72
|
+
#
|
73
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
74
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
75
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
76
|
+
def batch_contact_group_get(max_members: nil, resource_names: nil, fields: nil, quota_user: nil, options: nil, &block)
|
77
|
+
command = make_simple_command(:get, 'v1/contactGroups:batchGet', options)
|
78
|
+
command.response_representation = Google::Apis::PeopleV1::BatchGetContactGroupsResponse::Representation
|
79
|
+
command.response_class = Google::Apis::PeopleV1::BatchGetContactGroupsResponse
|
80
|
+
command.query['maxMembers'] = max_members unless max_members.nil?
|
81
|
+
command.query['resourceNames'] = resource_names unless resource_names.nil?
|
82
|
+
command.query['fields'] = fields unless fields.nil?
|
83
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
84
|
+
execute_or_queue_command(command, &block)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Create a new contact group owned by the authenticated user.
|
88
|
+
# @param [Google::Apis::PeopleV1::CreateContactGroupRequest] create_contact_group_request_object
|
89
|
+
# @param [String] fields
|
90
|
+
# Selector specifying which fields to include in a partial response.
|
91
|
+
# @param [String] quota_user
|
92
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
93
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
94
|
+
# @param [Google::Apis::RequestOptions] options
|
95
|
+
# Request-specific options
|
96
|
+
#
|
97
|
+
# @yield [result, err] Result & error if block supplied
|
98
|
+
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
99
|
+
# @yieldparam err [StandardError] error object if request failed
|
100
|
+
#
|
101
|
+
# @return [Google::Apis::PeopleV1::ContactGroup]
|
102
|
+
#
|
103
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
104
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
105
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
106
|
+
def create_contact_group(create_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
107
|
+
command = make_simple_command(:post, 'v1/contactGroups', options)
|
108
|
+
command.request_representation = Google::Apis::PeopleV1::CreateContactGroupRequest::Representation
|
109
|
+
command.request_object = create_contact_group_request_object
|
110
|
+
command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
|
111
|
+
command.response_class = Google::Apis::PeopleV1::ContactGroup
|
112
|
+
command.query['fields'] = fields unless fields.nil?
|
113
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
114
|
+
execute_or_queue_command(command, &block)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Delete an existing contact group owned by the authenticated user by specifying
|
118
|
+
# a contact group resource name.
|
119
|
+
# @param [String] resource_name
|
120
|
+
# Required. The resource name of the contact group to delete.
|
121
|
+
# @param [Boolean] delete_contacts
|
122
|
+
# Optional. Set to true to also delete the contacts in the specified group.
|
123
|
+
# @param [String] fields
|
124
|
+
# Selector specifying which fields to include in a partial response.
|
125
|
+
# @param [String] quota_user
|
126
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
127
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
128
|
+
# @param [Google::Apis::RequestOptions] options
|
129
|
+
# Request-specific options
|
130
|
+
#
|
131
|
+
# @yield [result, err] Result & error if block supplied
|
132
|
+
# @yieldparam result [Google::Apis::PeopleV1::Empty] parsed result object
|
133
|
+
# @yieldparam err [StandardError] error object if request failed
|
134
|
+
#
|
135
|
+
# @return [Google::Apis::PeopleV1::Empty]
|
136
|
+
#
|
137
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
138
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
139
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
140
|
+
def delete_contact_group(resource_name, delete_contacts: nil, fields: nil, quota_user: nil, options: nil, &block)
|
141
|
+
command = make_simple_command(:delete, 'v1/{+resourceName}', options)
|
142
|
+
command.response_representation = Google::Apis::PeopleV1::Empty::Representation
|
143
|
+
command.response_class = Google::Apis::PeopleV1::Empty
|
144
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
145
|
+
command.query['deleteContacts'] = delete_contacts unless delete_contacts.nil?
|
146
|
+
command.query['fields'] = fields unless fields.nil?
|
147
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
148
|
+
execute_or_queue_command(command, &block)
|
149
|
+
end
|
150
|
+
|
151
|
+
# Get a specific contact group owned by the authenticated user by specifying a
|
152
|
+
# contact group resource name.
|
153
|
+
# @param [String] resource_name
|
154
|
+
# Required. The resource name of the contact group to get.
|
155
|
+
# @param [Fixnum] max_members
|
156
|
+
# Optional. Specifies the maximum number of members to return. Defaults to 0 if
|
157
|
+
# not set, which will return zero members.
|
158
|
+
# @param [String] fields
|
159
|
+
# Selector specifying which fields to include in a partial response.
|
160
|
+
# @param [String] quota_user
|
161
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
162
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
163
|
+
# @param [Google::Apis::RequestOptions] options
|
164
|
+
# Request-specific options
|
165
|
+
#
|
166
|
+
# @yield [result, err] Result & error if block supplied
|
167
|
+
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
168
|
+
# @yieldparam err [StandardError] error object if request failed
|
169
|
+
#
|
170
|
+
# @return [Google::Apis::PeopleV1::ContactGroup]
|
171
|
+
#
|
172
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
173
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
174
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
175
|
+
def get_contact_group(resource_name, max_members: nil, fields: nil, quota_user: nil, options: nil, &block)
|
176
|
+
command = make_simple_command(:get, 'v1/{+resourceName}', options)
|
177
|
+
command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
|
178
|
+
command.response_class = Google::Apis::PeopleV1::ContactGroup
|
179
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
180
|
+
command.query['maxMembers'] = max_members unless max_members.nil?
|
181
|
+
command.query['fields'] = fields unless fields.nil?
|
182
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
183
|
+
execute_or_queue_command(command, &block)
|
184
|
+
end
|
185
|
+
|
186
|
+
# List all contact groups owned by the authenticated user. Members of the
|
187
|
+
# contact groups are not populated.
|
188
|
+
# @param [Fixnum] page_size
|
189
|
+
# Optional. The maximum number of resources to return. Valid values are between
|
190
|
+
# 1 and 1000, inclusive. Defaults to 30 if not set or set to 0.
|
191
|
+
# @param [String] page_token
|
192
|
+
# Optional. The next_page_token value returned from a previous call to [
|
193
|
+
# ListContactGroups](/people/api/rest/v1/contactgroups/list). Requests the next
|
194
|
+
# page of resources.
|
195
|
+
# @param [String] sync_token
|
196
|
+
# Optional. A sync token, returned by a previous call to `contactgroups.list`.
|
197
|
+
# Only resources changed since the sync token was created will be returned.
|
198
|
+
# @param [String] fields
|
199
|
+
# Selector specifying which fields to include in a partial response.
|
200
|
+
# @param [String] quota_user
|
201
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
202
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
203
|
+
# @param [Google::Apis::RequestOptions] options
|
204
|
+
# Request-specific options
|
205
|
+
#
|
206
|
+
# @yield [result, err] Result & error if block supplied
|
207
|
+
# @yieldparam result [Google::Apis::PeopleV1::ListContactGroupsResponse] parsed result object
|
208
|
+
# @yieldparam err [StandardError] error object if request failed
|
209
|
+
#
|
210
|
+
# @return [Google::Apis::PeopleV1::ListContactGroupsResponse]
|
211
|
+
#
|
212
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
213
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
214
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
215
|
+
def list_contact_groups(page_size: nil, page_token: nil, sync_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
216
|
+
command = make_simple_command(:get, 'v1/contactGroups', options)
|
217
|
+
command.response_representation = Google::Apis::PeopleV1::ListContactGroupsResponse::Representation
|
218
|
+
command.response_class = Google::Apis::PeopleV1::ListContactGroupsResponse
|
219
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
220
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
221
|
+
command.query['syncToken'] = sync_token unless sync_token.nil?
|
222
|
+
command.query['fields'] = fields unless fields.nil?
|
223
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
224
|
+
execute_or_queue_command(command, &block)
|
225
|
+
end
|
226
|
+
|
227
|
+
# Update the name of an existing contact group owned by the authenticated user.
|
228
|
+
# @param [String] resource_name
|
229
|
+
# The resource name for the contact group, assigned by the server. An ASCII
|
230
|
+
# string, in the form of `contactGroups/`contact_group_id``.
|
231
|
+
# @param [Google::Apis::PeopleV1::UpdateContactGroupRequest] update_contact_group_request_object
|
232
|
+
# @param [String] fields
|
233
|
+
# Selector specifying which fields to include in a partial response.
|
234
|
+
# @param [String] quota_user
|
235
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
236
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
237
|
+
# @param [Google::Apis::RequestOptions] options
|
238
|
+
# Request-specific options
|
239
|
+
#
|
240
|
+
# @yield [result, err] Result & error if block supplied
|
241
|
+
# @yieldparam result [Google::Apis::PeopleV1::ContactGroup] parsed result object
|
242
|
+
# @yieldparam err [StandardError] error object if request failed
|
243
|
+
#
|
244
|
+
# @return [Google::Apis::PeopleV1::ContactGroup]
|
245
|
+
#
|
246
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
247
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
248
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
249
|
+
def update_contact_group(resource_name, update_contact_group_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
250
|
+
command = make_simple_command(:put, 'v1/{+resourceName}', options)
|
251
|
+
command.request_representation = Google::Apis::PeopleV1::UpdateContactGroupRequest::Representation
|
252
|
+
command.request_object = update_contact_group_request_object
|
253
|
+
command.response_representation = Google::Apis::PeopleV1::ContactGroup::Representation
|
254
|
+
command.response_class = Google::Apis::PeopleV1::ContactGroup
|
255
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
256
|
+
command.query['fields'] = fields unless fields.nil?
|
257
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
258
|
+
execute_or_queue_command(command, &block)
|
259
|
+
end
|
260
|
+
|
261
|
+
# Modify the members of a contact group owned by the authenticated user. The
|
262
|
+
# only system contact groups that can have members added are `contactGroups/
|
263
|
+
# myContacts` and `contactGroups/starred`. Other system contact groups are
|
264
|
+
# deprecated and can only have contacts removed.
|
265
|
+
# @param [String] resource_name
|
266
|
+
# Required. The resource name of the contact group to modify.
|
267
|
+
# @param [Google::Apis::PeopleV1::ModifyContactGroupMembersRequest] modify_contact_group_members_request_object
|
268
|
+
# @param [String] fields
|
269
|
+
# Selector specifying which fields to include in a partial response.
|
270
|
+
# @param [String] quota_user
|
271
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
272
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
273
|
+
# @param [Google::Apis::RequestOptions] options
|
274
|
+
# Request-specific options
|
275
|
+
#
|
276
|
+
# @yield [result, err] Result & error if block supplied
|
277
|
+
# @yieldparam result [Google::Apis::PeopleV1::ModifyContactGroupMembersResponse] parsed result object
|
278
|
+
# @yieldparam err [StandardError] error object if request failed
|
279
|
+
#
|
280
|
+
# @return [Google::Apis::PeopleV1::ModifyContactGroupMembersResponse]
|
281
|
+
#
|
282
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
283
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
284
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
285
|
+
def modify_contact_group_members(resource_name, modify_contact_group_members_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
286
|
+
command = make_simple_command(:post, 'v1/{+resourceName}/members:modify', options)
|
287
|
+
command.request_representation = Google::Apis::PeopleV1::ModifyContactGroupMembersRequest::Representation
|
288
|
+
command.request_object = modify_contact_group_members_request_object
|
289
|
+
command.response_representation = Google::Apis::PeopleV1::ModifyContactGroupMembersResponse::Representation
|
290
|
+
command.response_class = Google::Apis::PeopleV1::ModifyContactGroupMembersResponse
|
291
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
292
|
+
command.query['fields'] = fields unless fields.nil?
|
293
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
294
|
+
execute_or_queue_command(command, &block)
|
295
|
+
end
|
296
|
+
|
297
|
+
# Copies an "Other contact" to a new contact in the user's "myContacts" group
|
298
|
+
# @param [String] resource_name
|
299
|
+
# Required. The resource name of the "Other contact" to copy.
|
300
|
+
# @param [Google::Apis::PeopleV1::CopyOtherContactToMyContactsGroupRequest] copy_other_contact_to_my_contacts_group_request_object
|
301
|
+
# @param [String] fields
|
302
|
+
# Selector specifying which fields to include in a partial response.
|
303
|
+
# @param [String] quota_user
|
304
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
305
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
306
|
+
# @param [Google::Apis::RequestOptions] options
|
307
|
+
# Request-specific options
|
308
|
+
#
|
309
|
+
# @yield [result, err] Result & error if block supplied
|
310
|
+
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
311
|
+
# @yieldparam err [StandardError] error object if request failed
|
312
|
+
#
|
313
|
+
# @return [Google::Apis::PeopleV1::Person]
|
314
|
+
#
|
315
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
316
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
317
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
318
|
+
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)
|
319
|
+
command = make_simple_command(:post, 'v1/{+resourceName}:copyOtherContactToMyContactsGroup', options)
|
320
|
+
command.request_representation = Google::Apis::PeopleV1::CopyOtherContactToMyContactsGroupRequest::Representation
|
321
|
+
command.request_object = copy_other_contact_to_my_contacts_group_request_object
|
322
|
+
command.response_representation = Google::Apis::PeopleV1::Person::Representation
|
323
|
+
command.response_class = Google::Apis::PeopleV1::Person
|
324
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
325
|
+
command.query['fields'] = fields unless fields.nil?
|
326
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
327
|
+
execute_or_queue_command(command, &block)
|
328
|
+
end
|
329
|
+
|
330
|
+
# List all "Other contacts", that is contacts that are not in a contact group. "
|
331
|
+
# Other contacts" are typically auto created contacts from interactions.
|
332
|
+
# @param [Fixnum] page_size
|
333
|
+
# Optional. The number of "Other contacts" to include in the response. Valid
|
334
|
+
# values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to
|
335
|
+
# 0.
|
336
|
+
# @param [String] page_token
|
337
|
+
# Optional. A page token, received from a previous `ListOtherContacts` call.
|
338
|
+
# Provide this to retrieve the subsequent page. When paginating, all other
|
339
|
+
# parameters provided to `ListOtherContacts` must match the call that provided
|
340
|
+
# the page token.
|
341
|
+
# @param [String] read_mask
|
342
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
343
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
344
|
+
# are: * emailAddresses * names * phoneNumbers
|
345
|
+
# @param [Boolean] request_sync_token
|
346
|
+
# Optional. Whether the response should include `next_sync_token`, which can be
|
347
|
+
# used to get all changes since the last request. For subsequent sync requests
|
348
|
+
# use the `sync_token` param instead. Initial sync requests that specify `
|
349
|
+
# request_sync_token` have an additional rate limit.
|
350
|
+
# @param [String] sync_token
|
351
|
+
# Optional. A sync token, received from a previous `ListOtherContacts` call.
|
352
|
+
# Provide this to retrieve only the resources changed since the last request.
|
353
|
+
# Sync requests that specify `sync_token` have an additional rate limit. When
|
354
|
+
# syncing, all other parameters provided to `ListOtherContacts` must match the
|
355
|
+
# call that provided the sync token.
|
356
|
+
# @param [String] fields
|
357
|
+
# Selector specifying which fields to include in a partial response.
|
358
|
+
# @param [String] quota_user
|
359
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
360
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
361
|
+
# @param [Google::Apis::RequestOptions] options
|
362
|
+
# Request-specific options
|
363
|
+
#
|
364
|
+
# @yield [result, err] Result & error if block supplied
|
365
|
+
# @yieldparam result [Google::Apis::PeopleV1::ListOtherContactsResponse] parsed result object
|
366
|
+
# @yieldparam err [StandardError] error object if request failed
|
367
|
+
#
|
368
|
+
# @return [Google::Apis::PeopleV1::ListOtherContactsResponse]
|
369
|
+
#
|
370
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
371
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
372
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
373
|
+
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)
|
374
|
+
command = make_simple_command(:get, 'v1/otherContacts', options)
|
375
|
+
command.response_representation = Google::Apis::PeopleV1::ListOtherContactsResponse::Representation
|
376
|
+
command.response_class = Google::Apis::PeopleV1::ListOtherContactsResponse
|
377
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
378
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
379
|
+
command.query['readMask'] = read_mask unless read_mask.nil?
|
380
|
+
command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
|
381
|
+
command.query['syncToken'] = sync_token unless sync_token.nil?
|
382
|
+
command.query['fields'] = fields unless fields.nil?
|
383
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
384
|
+
execute_or_queue_command(command, &block)
|
385
|
+
end
|
386
|
+
|
387
|
+
# Create a new contact and return the person resource for that contact. The
|
388
|
+
# request returns a 400 error if more than one field is specified on a field
|
389
|
+
# that is a singleton for contact sources: * biographies * birthdays * genders *
|
390
|
+
# names
|
391
|
+
# @param [Google::Apis::PeopleV1::Person] person_object
|
392
|
+
# @param [String] person_fields
|
393
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
394
|
+
# Multiple fields can be specified by separating them with commas. Defaults to
|
395
|
+
# all fields if not set. Valid values are: * addresses * ageRanges * biographies
|
396
|
+
# * birthdays * calendarUrls * clientData * coverPhotos * emailAddresses *
|
397
|
+
# events * externalIds * genders * imClients * interests * locales * locations *
|
398
|
+
# memberships * metadata * miscKeywords * names * nicknames * occupations *
|
399
|
+
# organizations * phoneNumbers * photos * relations * sipAddresses * skills *
|
400
|
+
# urls * userDefined
|
401
|
+
# @param [Array<String>, String] sources
|
402
|
+
# Optional. A mask of what source types to return. Defaults to
|
403
|
+
# READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.
|
404
|
+
# @param [String] fields
|
405
|
+
# Selector specifying which fields to include in a partial response.
|
406
|
+
# @param [String] quota_user
|
407
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
408
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
409
|
+
# @param [Google::Apis::RequestOptions] options
|
410
|
+
# Request-specific options
|
411
|
+
#
|
412
|
+
# @yield [result, err] Result & error if block supplied
|
413
|
+
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
414
|
+
# @yieldparam err [StandardError] error object if request failed
|
415
|
+
#
|
416
|
+
# @return [Google::Apis::PeopleV1::Person]
|
417
|
+
#
|
418
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
419
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
420
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
421
|
+
def create_person_contact(person_object = nil, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
422
|
+
command = make_simple_command(:post, 'v1/people:createContact', options)
|
423
|
+
command.request_representation = Google::Apis::PeopleV1::Person::Representation
|
424
|
+
command.request_object = person_object
|
425
|
+
command.response_representation = Google::Apis::PeopleV1::Person::Representation
|
426
|
+
command.response_class = Google::Apis::PeopleV1::Person
|
427
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
428
|
+
command.query['sources'] = sources unless sources.nil?
|
429
|
+
command.query['fields'] = fields unless fields.nil?
|
430
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
431
|
+
execute_or_queue_command(command, &block)
|
432
|
+
end
|
433
|
+
|
434
|
+
# Delete a contact person. Any non-contact data will not be deleted.
|
435
|
+
# @param [String] resource_name
|
436
|
+
# Required. The resource name of the contact to delete.
|
437
|
+
# @param [String] fields
|
438
|
+
# Selector specifying which fields to include in a partial response.
|
439
|
+
# @param [String] quota_user
|
440
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
441
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
442
|
+
# @param [Google::Apis::RequestOptions] options
|
443
|
+
# Request-specific options
|
444
|
+
#
|
445
|
+
# @yield [result, err] Result & error if block supplied
|
446
|
+
# @yieldparam result [Google::Apis::PeopleV1::Empty] parsed result object
|
447
|
+
# @yieldparam err [StandardError] error object if request failed
|
448
|
+
#
|
449
|
+
# @return [Google::Apis::PeopleV1::Empty]
|
450
|
+
#
|
451
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
452
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
453
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
454
|
+
def delete_person_contact(resource_name, fields: nil, quota_user: nil, options: nil, &block)
|
455
|
+
command = make_simple_command(:delete, 'v1/{+resourceName}:deleteContact', options)
|
456
|
+
command.response_representation = Google::Apis::PeopleV1::Empty::Representation
|
457
|
+
command.response_class = Google::Apis::PeopleV1::Empty
|
458
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
459
|
+
command.query['fields'] = fields unless fields.nil?
|
460
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
461
|
+
execute_or_queue_command(command, &block)
|
462
|
+
end
|
463
|
+
|
464
|
+
# Delete a contact's photo.
|
465
|
+
# @param [String] resource_name
|
466
|
+
# Required. The resource name of the contact whose photo will be deleted.
|
467
|
+
# @param [String] person_fields
|
468
|
+
# Optional. A field mask to restrict which fields on the person are returned.
|
469
|
+
# Multiple fields can be specified by separating them with commas. Defaults to
|
470
|
+
# empty if not set, which will skip the post mutate get. Valid values are: *
|
471
|
+
# addresses * ageRanges * biographies * birthdays * calendarUrls * clientData *
|
472
|
+
# coverPhotos * emailAddresses * events * externalIds * genders * imClients *
|
473
|
+
# interests * locales * locations * memberships * metadata * miscKeywords *
|
474
|
+
# names * nicknames * occupations * organizations * phoneNumbers * photos *
|
475
|
+
# relations * sipAddresses * skills * urls * userDefined
|
476
|
+
# @param [Array<String>, String] sources
|
477
|
+
# Optional. A mask of what source types to return. Defaults to
|
478
|
+
# READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.
|
479
|
+
# @param [String] fields
|
480
|
+
# Selector specifying which fields to include in a partial response.
|
481
|
+
# @param [String] quota_user
|
482
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
483
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
484
|
+
# @param [Google::Apis::RequestOptions] options
|
485
|
+
# Request-specific options
|
486
|
+
#
|
487
|
+
# @yield [result, err] Result & error if block supplied
|
488
|
+
# @yieldparam result [Google::Apis::PeopleV1::DeleteContactPhotoResponse] parsed result object
|
489
|
+
# @yieldparam err [StandardError] error object if request failed
|
490
|
+
#
|
491
|
+
# @return [Google::Apis::PeopleV1::DeleteContactPhotoResponse]
|
492
|
+
#
|
493
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
494
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
495
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
496
|
+
def delete_person_contact_photo(resource_name, person_fields: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
497
|
+
command = make_simple_command(:delete, 'v1/{+resourceName}:deleteContactPhoto', options)
|
498
|
+
command.response_representation = Google::Apis::PeopleV1::DeleteContactPhotoResponse::Representation
|
499
|
+
command.response_class = Google::Apis::PeopleV1::DeleteContactPhotoResponse
|
500
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
501
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
502
|
+
command.query['sources'] = sources unless sources.nil?
|
503
|
+
command.query['fields'] = fields unless fields.nil?
|
504
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
505
|
+
execute_or_queue_command(command, &block)
|
506
|
+
end
|
507
|
+
|
508
|
+
# Provides information about a person by specifying a resource name. Use `people/
|
509
|
+
# me` to indicate the authenticated user. The request returns a 400 error if '
|
510
|
+
# personFields' is not specified.
|
511
|
+
# @param [String] resource_name
|
512
|
+
# Required. The resource name of the person to provide information about. - To
|
513
|
+
# get information about the authenticated user, specify `people/me`. - To get
|
514
|
+
# information about a google account, specify `people/`account_id``. - To get
|
515
|
+
# information about a contact, specify the resource name that identifies the
|
516
|
+
# contact as returned by [`people.connections.list`](/people/api/rest/v1/people.
|
517
|
+
# connections/list).
|
518
|
+
# @param [String] person_fields
|
519
|
+
# Required. A field mask to restrict which fields on the person are returned.
|
520
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
521
|
+
# are: * addresses * ageRanges * biographies * birthdays * calendarUrls *
|
522
|
+
# clientData * coverPhotos * emailAddresses * events * externalIds * genders *
|
523
|
+
# imClients * interests * locales * locations * memberships * metadata *
|
524
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
525
|
+
# photos * relations * sipAddresses * skills * urls * userDefined
|
526
|
+
# @param [String] request_mask_include_field
|
527
|
+
# Required. Comma-separated list of person fields to be included in the response.
|
528
|
+
# Each path should start with `person.`: for example, `person.names` or `person.
|
529
|
+
# photos`.
|
530
|
+
# @param [Array<String>, String] sources
|
531
|
+
# Optional. A mask of what source types to return. Defaults to
|
532
|
+
# READ_SOURCE_TYPE_PROFILE and READ_SOURCE_TYPE_CONTACT if not set.
|
533
|
+
# @param [String] fields
|
534
|
+
# Selector specifying which fields to include in a partial response.
|
535
|
+
# @param [String] quota_user
|
536
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
537
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
538
|
+
# @param [Google::Apis::RequestOptions] options
|
539
|
+
# Request-specific options
|
540
|
+
#
|
541
|
+
# @yield [result, err] Result & error if block supplied
|
542
|
+
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
543
|
+
# @yieldparam err [StandardError] error object if request failed
|
544
|
+
#
|
545
|
+
# @return [Google::Apis::PeopleV1::Person]
|
546
|
+
#
|
547
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
548
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
549
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
550
|
+
def get_person(resource_name, person_fields: nil, request_mask_include_field: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
551
|
+
command = make_simple_command(:get, 'v1/{+resourceName}', options)
|
552
|
+
command.response_representation = Google::Apis::PeopleV1::Person::Representation
|
553
|
+
command.response_class = Google::Apis::PeopleV1::Person
|
554
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
555
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
556
|
+
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
557
|
+
command.query['sources'] = sources unless sources.nil?
|
558
|
+
command.query['fields'] = fields unless fields.nil?
|
559
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
560
|
+
execute_or_queue_command(command, &block)
|
561
|
+
end
|
562
|
+
|
563
|
+
# Provides information about a list of specific people by specifying a list of
|
564
|
+
# requested resource names. Use `people/me` to indicate the authenticated user.
|
565
|
+
# The request returns a 400 error if 'personFields' is not specified.
|
566
|
+
# @param [String] person_fields
|
567
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
568
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
569
|
+
# are: * addresses * ageRanges * biographies * birthdays * calendarUrls *
|
570
|
+
# clientData * coverPhotos * emailAddresses * events * externalIds * genders *
|
571
|
+
# imClients * interests * locales * locations * memberships * metadata *
|
572
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
573
|
+
# photos * relations * sipAddresses * skills * urls * userDefined
|
574
|
+
# @param [String] request_mask_include_field
|
575
|
+
# Required. Comma-separated list of person fields to be included in the response.
|
576
|
+
# Each path should start with `person.`: for example, `person.names` or `person.
|
577
|
+
# photos`.
|
578
|
+
# @param [Array<String>, String] resource_names
|
579
|
+
# Required. The resource names of the people to provide information about. It's
|
580
|
+
# repeatable. The URL query parameter should be resourceNames=<name1>&
|
581
|
+
# resourceNames=<name2>&... - To get information about the authenticated user,
|
582
|
+
# specify `people/me`. - To get information about a google account, specify `
|
583
|
+
# people/`account_id``. - To get information about a contact, specify the
|
584
|
+
# resource name that identifies the contact as returned by [`people.connections.
|
585
|
+
# list`](/people/api/rest/v1/people.connections/list). You can include up to 50
|
586
|
+
# resource names in one request.
|
587
|
+
# @param [Array<String>, String] sources
|
588
|
+
# Optional. A mask of what source types to return. Defaults to
|
589
|
+
# READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.
|
590
|
+
# @param [String] fields
|
591
|
+
# Selector specifying which fields to include in a partial response.
|
592
|
+
# @param [String] quota_user
|
593
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
594
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
595
|
+
# @param [Google::Apis::RequestOptions] options
|
596
|
+
# Request-specific options
|
597
|
+
#
|
598
|
+
# @yield [result, err] Result & error if block supplied
|
599
|
+
# @yieldparam result [Google::Apis::PeopleV1::GetPeopleResponse] parsed result object
|
600
|
+
# @yieldparam err [StandardError] error object if request failed
|
601
|
+
#
|
602
|
+
# @return [Google::Apis::PeopleV1::GetPeopleResponse]
|
603
|
+
#
|
604
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
605
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
606
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
607
|
+
def get_people(person_fields: nil, request_mask_include_field: nil, resource_names: nil, sources: nil, fields: nil, quota_user: nil, options: nil, &block)
|
608
|
+
command = make_simple_command(:get, 'v1/people:batchGet', options)
|
609
|
+
command.response_representation = Google::Apis::PeopleV1::GetPeopleResponse::Representation
|
610
|
+
command.response_class = Google::Apis::PeopleV1::GetPeopleResponse
|
611
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
612
|
+
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
613
|
+
command.query['resourceNames'] = resource_names unless resource_names.nil?
|
614
|
+
command.query['sources'] = sources unless sources.nil?
|
615
|
+
command.query['fields'] = fields unless fields.nil?
|
616
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
617
|
+
execute_or_queue_command(command, &block)
|
618
|
+
end
|
619
|
+
|
620
|
+
# Provides a list of domain profiles and domain contacts in the authenticated
|
621
|
+
# user's domain directory.
|
622
|
+
# @param [Array<String>, String] merge_sources
|
623
|
+
# Optional. Additional data to merge into the directory sources if they are
|
624
|
+
# connected through verified join keys such as email addresses or phone numbers.
|
625
|
+
# @param [Fixnum] page_size
|
626
|
+
# Optional. The number of people to include in the response. Valid values are
|
627
|
+
# between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.
|
628
|
+
# @param [String] page_token
|
629
|
+
# Optional. A page token, received from a previous `ListDirectoryPeople` call.
|
630
|
+
# Provide this to retrieve the subsequent page. When paginating, all other
|
631
|
+
# parameters provided to `ListDirectoryPeople` must match the call that provided
|
632
|
+
# the page token.
|
633
|
+
# @param [String] read_mask
|
634
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
635
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
636
|
+
# are: * addresses * ageRanges * biographies * birthdays * calendarUrls *
|
637
|
+
# clientData * coverPhotos * emailAddresses * events * externalIds * genders *
|
638
|
+
# imClients * interests * locales * locations * memberships * metadata *
|
639
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
640
|
+
# photos * relations * sipAddresses * skills * urls * userDefined
|
641
|
+
# @param [Boolean] request_sync_token
|
642
|
+
# Optional. Whether the response should include `next_sync_token`, which can be
|
643
|
+
# used to get all changes since the last request. For subsequent sync requests
|
644
|
+
# use the `sync_token` param instead.
|
645
|
+
# @param [Array<String>, String] sources
|
646
|
+
# Required. Directory sources to return.
|
647
|
+
# @param [String] sync_token
|
648
|
+
# Optional. A sync token, received from a previous `ListDirectoryPeople` call.
|
649
|
+
# Provide this to retrieve only the resources changed since the last request.
|
650
|
+
# When syncing, all other parameters provided to `ListDirectoryPeople` must
|
651
|
+
# match the call that provided the sync token.
|
652
|
+
# @param [String] fields
|
653
|
+
# Selector specifying which fields to include in a partial response.
|
654
|
+
# @param [String] quota_user
|
655
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
656
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
657
|
+
# @param [Google::Apis::RequestOptions] options
|
658
|
+
# Request-specific options
|
659
|
+
#
|
660
|
+
# @yield [result, err] Result & error if block supplied
|
661
|
+
# @yieldparam result [Google::Apis::PeopleV1::ListDirectoryPeopleResponse] parsed result object
|
662
|
+
# @yieldparam err [StandardError] error object if request failed
|
663
|
+
#
|
664
|
+
# @return [Google::Apis::PeopleV1::ListDirectoryPeopleResponse]
|
665
|
+
#
|
666
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
667
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
668
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
669
|
+
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)
|
670
|
+
command = make_simple_command(:get, 'v1/people:listDirectoryPeople', options)
|
671
|
+
command.response_representation = Google::Apis::PeopleV1::ListDirectoryPeopleResponse::Representation
|
672
|
+
command.response_class = Google::Apis::PeopleV1::ListDirectoryPeopleResponse
|
673
|
+
command.query['mergeSources'] = merge_sources unless merge_sources.nil?
|
674
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
675
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
676
|
+
command.query['readMask'] = read_mask unless read_mask.nil?
|
677
|
+
command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
|
678
|
+
command.query['sources'] = sources unless sources.nil?
|
679
|
+
command.query['syncToken'] = sync_token unless sync_token.nil?
|
680
|
+
command.query['fields'] = fields unless fields.nil?
|
681
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
682
|
+
execute_or_queue_command(command, &block)
|
683
|
+
end
|
684
|
+
|
685
|
+
# Provides a list of domain profiles and domain contacts in the authenticated
|
686
|
+
# user's domain directory that match the search query.
|
687
|
+
# @param [Array<String>, String] merge_sources
|
688
|
+
# Optional. Additional data to merge into the directory sources if they are
|
689
|
+
# connected through verified join keys such as email addresses or phone numbers.
|
690
|
+
# @param [Fixnum] page_size
|
691
|
+
# Optional. The number of people to include in the response. Valid values are
|
692
|
+
# between 1 and 500, inclusive. Defaults to 100 if not set or set to 0.
|
693
|
+
# @param [String] page_token
|
694
|
+
# Optional. A page token, received from a previous `SearchDirectoryPeople` call.
|
695
|
+
# Provide this to retrieve the subsequent page. When paginating, all other
|
696
|
+
# parameters provided to `SearchDirectoryPeople` must match the call that
|
697
|
+
# provided the page token.
|
698
|
+
# @param [String] query
|
699
|
+
# Required. Prefix query that matches fields in the person. Does NOT use the
|
700
|
+
# read_mask for determining what fields to match.
|
701
|
+
# @param [String] read_mask
|
702
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
703
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
704
|
+
# are: * addresses * ageRanges * biographies * birthdays * calendarUrls *
|
705
|
+
# clientData * coverPhotos * emailAddresses * events * externalIds * genders *
|
706
|
+
# imClients * interests * locales * locations * memberships * metadata *
|
707
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
708
|
+
# photos * relations * sipAddresses * skills * urls * userDefined
|
709
|
+
# @param [Array<String>, String] sources
|
710
|
+
# Required. Directory sources to return.
|
711
|
+
# @param [String] fields
|
712
|
+
# Selector specifying which fields to include in a partial response.
|
713
|
+
# @param [String] quota_user
|
714
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
715
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
716
|
+
# @param [Google::Apis::RequestOptions] options
|
717
|
+
# Request-specific options
|
718
|
+
#
|
719
|
+
# @yield [result, err] Result & error if block supplied
|
720
|
+
# @yieldparam result [Google::Apis::PeopleV1::SearchDirectoryPeopleResponse] parsed result object
|
721
|
+
# @yieldparam err [StandardError] error object if request failed
|
722
|
+
#
|
723
|
+
# @return [Google::Apis::PeopleV1::SearchDirectoryPeopleResponse]
|
724
|
+
#
|
725
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
726
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
727
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
728
|
+
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)
|
729
|
+
command = make_simple_command(:get, 'v1/people:searchDirectoryPeople', options)
|
730
|
+
command.response_representation = Google::Apis::PeopleV1::SearchDirectoryPeopleResponse::Representation
|
731
|
+
command.response_class = Google::Apis::PeopleV1::SearchDirectoryPeopleResponse
|
732
|
+
command.query['mergeSources'] = merge_sources unless merge_sources.nil?
|
733
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
734
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
735
|
+
command.query['query'] = query unless query.nil?
|
736
|
+
command.query['readMask'] = read_mask unless read_mask.nil?
|
737
|
+
command.query['sources'] = sources unless sources.nil?
|
738
|
+
command.query['fields'] = fields unless fields.nil?
|
739
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
740
|
+
execute_or_queue_command(command, &block)
|
741
|
+
end
|
742
|
+
|
743
|
+
# Update contact data for an existing contact person. Any non-contact data will
|
744
|
+
# not be modified. Any non-contact data in the person to update will be ignored.
|
745
|
+
# All fields specified in the `update_mask` will be replaced. The server returns
|
746
|
+
# a 400 error if `person.metadata.sources` is not specified for the contact to
|
747
|
+
# be updated or if there is no contact source. The server returns a 400 error
|
748
|
+
# with reason `"failedPrecondition"` if `person.metadata.sources.etag` is
|
749
|
+
# different than the contact's etag, which indicates the contact has changed
|
750
|
+
# since its data was read. Clients should get the latest person and merge their
|
751
|
+
# updates into the latest person. The server returns a 400 error if `memberships`
|
752
|
+
# are being updated and there are no contact group memberships specified on the
|
753
|
+
# person. The server returns a 400 error if more than one field is specified on
|
754
|
+
# a field that is a singleton for contact sources: * biographies * birthdays *
|
755
|
+
# genders * names
|
756
|
+
# @param [String] resource_name
|
757
|
+
# The resource name for the person, assigned by the server. An ASCII string with
|
758
|
+
# a max length of 27 characters, in the form of `people/`person_id``.
|
759
|
+
# @param [Google::Apis::PeopleV1::Person] person_object
|
760
|
+
# @param [String] person_fields
|
761
|
+
# Optional. A field mask to restrict which fields on each person are returned.
|
762
|
+
# Multiple fields can be specified by separating them with commas. Defaults to
|
763
|
+
# all fields if not set. Valid values are: * addresses * ageRanges * biographies
|
764
|
+
# * birthdays * calendarUrls * clientData * coverPhotos * emailAddresses *
|
765
|
+
# events * externalIds * genders * imClients * interests * locales * locations *
|
766
|
+
# memberships * metadata * miscKeywords * names * nicknames * occupations *
|
767
|
+
# organizations * phoneNumbers * photos * relations * sipAddresses * skills *
|
768
|
+
# urls * userDefined
|
769
|
+
# @param [Array<String>, String] sources
|
770
|
+
# Optional. A mask of what source types to return. Defaults to
|
771
|
+
# READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.
|
772
|
+
# @param [String] update_person_fields
|
773
|
+
# Required. A field mask to restrict which fields on the person are updated.
|
774
|
+
# Multiple fields can be specified by separating them with commas. All updated
|
775
|
+
# fields will be replaced. Valid values are: * addresses * biographies *
|
776
|
+
# birthdays * calendarUrls * clientData * emailAddresses * events * externalIds *
|
777
|
+
# genders * imClients * interests * locales * locations * memberships *
|
778
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
779
|
+
# relations * sipAddresses * urls * userDefined
|
780
|
+
# @param [String] fields
|
781
|
+
# Selector specifying which fields to include in a partial response.
|
782
|
+
# @param [String] quota_user
|
783
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
784
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
785
|
+
# @param [Google::Apis::RequestOptions] options
|
786
|
+
# Request-specific options
|
787
|
+
#
|
788
|
+
# @yield [result, err] Result & error if block supplied
|
789
|
+
# @yieldparam result [Google::Apis::PeopleV1::Person] parsed result object
|
790
|
+
# @yieldparam err [StandardError] error object if request failed
|
791
|
+
#
|
792
|
+
# @return [Google::Apis::PeopleV1::Person]
|
793
|
+
#
|
794
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
795
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
796
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
797
|
+
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)
|
798
|
+
command = make_simple_command(:patch, 'v1/{+resourceName}:updateContact', options)
|
799
|
+
command.request_representation = Google::Apis::PeopleV1::Person::Representation
|
800
|
+
command.request_object = person_object
|
801
|
+
command.response_representation = Google::Apis::PeopleV1::Person::Representation
|
802
|
+
command.response_class = Google::Apis::PeopleV1::Person
|
803
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
804
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
805
|
+
command.query['sources'] = sources unless sources.nil?
|
806
|
+
command.query['updatePersonFields'] = update_person_fields unless update_person_fields.nil?
|
807
|
+
command.query['fields'] = fields unless fields.nil?
|
808
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
809
|
+
execute_or_queue_command(command, &block)
|
810
|
+
end
|
811
|
+
|
812
|
+
# Update a contact's photo.
|
813
|
+
# @param [String] resource_name
|
814
|
+
# Required. Person resource name
|
815
|
+
# @param [Google::Apis::PeopleV1::UpdateContactPhotoRequest] update_contact_photo_request_object
|
816
|
+
# @param [String] fields
|
817
|
+
# Selector specifying which fields to include in a partial response.
|
818
|
+
# @param [String] quota_user
|
819
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
820
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
821
|
+
# @param [Google::Apis::RequestOptions] options
|
822
|
+
# Request-specific options
|
823
|
+
#
|
824
|
+
# @yield [result, err] Result & error if block supplied
|
825
|
+
# @yieldparam result [Google::Apis::PeopleV1::UpdateContactPhotoResponse] parsed result object
|
826
|
+
# @yieldparam err [StandardError] error object if request failed
|
827
|
+
#
|
828
|
+
# @return [Google::Apis::PeopleV1::UpdateContactPhotoResponse]
|
829
|
+
#
|
830
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
831
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
832
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
833
|
+
def update_person_contact_photo(resource_name, update_contact_photo_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
834
|
+
command = make_simple_command(:patch, 'v1/{+resourceName}:updateContactPhoto', options)
|
835
|
+
command.request_representation = Google::Apis::PeopleV1::UpdateContactPhotoRequest::Representation
|
836
|
+
command.request_object = update_contact_photo_request_object
|
837
|
+
command.response_representation = Google::Apis::PeopleV1::UpdateContactPhotoResponse::Representation
|
838
|
+
command.response_class = Google::Apis::PeopleV1::UpdateContactPhotoResponse
|
839
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
840
|
+
command.query['fields'] = fields unless fields.nil?
|
841
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
842
|
+
execute_or_queue_command(command, &block)
|
843
|
+
end
|
844
|
+
|
845
|
+
# Provides a list of the authenticated user's contacts. The request returns a
|
846
|
+
# 400 error if `personFields` is not specified. The request returns a 410 error
|
847
|
+
# if `sync_token` is specified and is expired. Sync tokens expire after 7 days
|
848
|
+
# to prevent data drift between clients and the server. To handle a sync token
|
849
|
+
# expired error, a request should be sent without `sync_token` to get all
|
850
|
+
# contacts.
|
851
|
+
# @param [String] resource_name
|
852
|
+
# Required. The resource name to return connections for. Only `people/me` is
|
853
|
+
# valid.
|
854
|
+
# @param [Fixnum] page_size
|
855
|
+
# Optional. The number of connections to include in the response. Valid values
|
856
|
+
# are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.
|
857
|
+
# @param [String] page_token
|
858
|
+
# Optional. A page token, received from a previous `ListConnections` call.
|
859
|
+
# Provide this to retrieve the subsequent page. When paginating, all other
|
860
|
+
# parameters provided to `ListConnections` must match the call that provided the
|
861
|
+
# page token.
|
862
|
+
# @param [String] person_fields
|
863
|
+
# Required. A field mask to restrict which fields on each person are returned.
|
864
|
+
# Multiple fields can be specified by separating them with commas. Valid values
|
865
|
+
# are: * addresses * ageRanges * biographies * birthdays * calendarUrls *
|
866
|
+
# clientData * coverPhotos * emailAddresses * events * externalIds * genders *
|
867
|
+
# imClients * interests * locales * locations * memberships * metadata *
|
868
|
+
# miscKeywords * names * nicknames * occupations * organizations * phoneNumbers *
|
869
|
+
# photos * relations * sipAddresses * skills * urls * userDefined
|
870
|
+
# @param [String] request_mask_include_field
|
871
|
+
# Required. Comma-separated list of person fields to be included in the response.
|
872
|
+
# Each path should start with `person.`: for example, `person.names` or `person.
|
873
|
+
# photos`.
|
874
|
+
# @param [Boolean] request_sync_token
|
875
|
+
# Optional. Whether the response should include `next_sync_token` on the last
|
876
|
+
# page, which can be used to get all changes since the last request. For
|
877
|
+
# subsequent sync requests use the `sync_token` param instead. Initial full sync
|
878
|
+
# requests that specify `request_sync_token` and do not specify `sync_token`
|
879
|
+
# have an additional rate limit per user. Each client should generally only be
|
880
|
+
# doing a full sync once every few days per user and so should not hit this
|
881
|
+
# limit.
|
882
|
+
# @param [String] sort_order
|
883
|
+
# Optional. The order in which the connections should be sorted. Defaults to `
|
884
|
+
# LAST_MODIFIED_ASCENDING`.
|
885
|
+
# @param [Array<String>, String] sources
|
886
|
+
# Optional. A mask of what source types to return. Defaults to
|
887
|
+
# READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.
|
888
|
+
# @param [String] sync_token
|
889
|
+
# Optional. A sync token, received from a previous `ListConnections` call.
|
890
|
+
# Provide this to retrieve only the resources changed since the last request.
|
891
|
+
# When syncing, all other parameters provided to `ListConnections` except `
|
892
|
+
# page_size` and `page_token` must match the initial call that provided the sync
|
893
|
+
# token. Sync tokens expire after seven days, after which a full sync request
|
894
|
+
# without a `sync_token` should be made.
|
895
|
+
# @param [String] fields
|
896
|
+
# Selector specifying which fields to include in a partial response.
|
897
|
+
# @param [String] quota_user
|
898
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
899
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
900
|
+
# @param [Google::Apis::RequestOptions] options
|
901
|
+
# Request-specific options
|
902
|
+
#
|
903
|
+
# @yield [result, err] Result & error if block supplied
|
904
|
+
# @yieldparam result [Google::Apis::PeopleV1::ListConnectionsResponse] parsed result object
|
905
|
+
# @yieldparam err [StandardError] error object if request failed
|
906
|
+
#
|
907
|
+
# @return [Google::Apis::PeopleV1::ListConnectionsResponse]
|
908
|
+
#
|
909
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
910
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
911
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
912
|
+
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)
|
913
|
+
command = make_simple_command(:get, 'v1/{+resourceName}/connections', options)
|
914
|
+
command.response_representation = Google::Apis::PeopleV1::ListConnectionsResponse::Representation
|
915
|
+
command.response_class = Google::Apis::PeopleV1::ListConnectionsResponse
|
916
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
917
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
918
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
919
|
+
command.query['personFields'] = person_fields unless person_fields.nil?
|
920
|
+
command.query['requestMask.includeField'] = request_mask_include_field unless request_mask_include_field.nil?
|
921
|
+
command.query['requestSyncToken'] = request_sync_token unless request_sync_token.nil?
|
922
|
+
command.query['sortOrder'] = sort_order unless sort_order.nil?
|
923
|
+
command.query['sources'] = sources unless sources.nil?
|
924
|
+
command.query['syncToken'] = sync_token unless sync_token.nil?
|
925
|
+
command.query['fields'] = fields unless fields.nil?
|
926
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
927
|
+
execute_or_queue_command(command, &block)
|
928
|
+
end
|
929
|
+
|
930
|
+
protected
|
931
|
+
|
932
|
+
def apply_command_defaults(command)
|
933
|
+
command.query['key'] = key unless key.nil?
|
934
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
935
|
+
end
|
936
|
+
end
|
937
|
+
end
|
938
|
+
end
|
939
|
+
end
|