Class: AlfrescoAPI::PeopleApi

Inherits:
Object
  • Object
show all
Defined in:
lib/alfresco_api/api/people_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PeopleApi

Returns a new instance of PeopleApi.



19
20
21
# File 'lib/alfresco_api/api/people_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/alfresco_api/api/people_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_person(person_body_create, opts = {}) ⇒ PersonEntry

Create person Note: this endpoint is available in Alfresco 5.2 and newer versions. Create a person. If applicable, the given person’s login access can also be optionally disabled. You must have admin rights to create a person. You can set custom properties when you create a person: “‘JSON { "id": "abeecher", "firstName": "Alice", "lastName": "Beecher", "email": "[email protected]", "password": "secret", "properties": { "my:property": "The value" } } “` Note: setting properties of type d:content and d:category are not supported.

Parameters:

  • person_body_create

    The person details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



29
30
31
32
# File 'lib/alfresco_api/api/people_api.rb', line 29

def create_person(person_body_create, opts = {})
  data, _status_code, _headers = create_person_with_http_info(person_body_create, opts)
  return data
end

#create_person_with_http_info(person_body_create, opts = {}) ⇒ Array<(PersonEntry, Fixnum, Hash)>

Create person Note: this endpoint is available in Alfresco 5.2 and newer versions. Create a person. If applicable, the given person&#39;s login access can also be optionally disabled. You must have admin rights to create a person. You can set custom properties when you create a person: &#x60;&#x60;&#x60;JSON { &quot;id&quot;: &quot;abeecher&quot;, &quot;firstName&quot;: &quot;Alice&quot;, &quot;lastName&quot;: &quot;Beecher&quot;, &quot;email&quot;: &quot;[email protected]&quot;, &quot;password&quot;: &quot;secret&quot;, &quot;properties&quot;: { &quot;my:property&quot;: &quot;The value&quot; } } &#x60;&#x60;&#x60; Note: setting properties of type d:content and d:category are not supported.

Parameters:

  • person_body_create

    The person details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(PersonEntry, Fixnum, Hash)>)

    PersonEntry data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/alfresco_api/api/people_api.rb', line 40

def create_person_with_http_info(person_body_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.create_person ..."
  end
  # verify the required parameter 'person_body_create' is set
  if @api_client.config.client_side_validation && person_body_create.nil?
    fail ArgumentError, "Missing the required parameter 'person_body_create' when calling PeopleApi.create_person"
  end
  # resource path
  local_var_path = "/people"

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(person_body_create)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PersonEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#create_person\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_avatar_image(person_id, opts = {}) ⇒ nil

Delete avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Deletes the avatar image related to person personId. You must be the person or have admin rights to update a person’s avatar. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


86
87
88
89
# File 'lib/alfresco_api/api/people_api.rb', line 86

def delete_avatar_image(person_id, opts = {})
  delete_avatar_image_with_http_info(person_id, opts)
  return nil
end

#delete_avatar_image_with_http_info(person_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Deletes the avatar image related to person personId. You must be the person or have admin rights to update a person&#39;s avatar. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/alfresco_api/api/people_api.rb', line 96

def delete_avatar_image_with_http_info(person_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.delete_avatar_image ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.delete_avatar_image"
  end
  # resource path
  local_var_path = "/people/{personId}/avatar".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#delete_avatar_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_avatar_image(person_id, opts = {}) ⇒ nil

Get avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Gets the avatar image related to the person personId. If the person has no related avatar then the placeholder query parameter can be optionally used to request a placeholder image to be returned. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :attachment (BOOLEAN)

    true enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response. (default to true)

  • :if_modified_since (DateTime)

    Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, &#x60;Wed, 09 Mar 2016 16:56:34 GMT&#x60;.

  • :placeholder (BOOLEAN)

    If true and there is no avatar for this personId then the placeholder image is returned, rather than a 404 response. (default to true)

Returns:

  • (nil)


143
144
145
146
# File 'lib/alfresco_api/api/people_api.rb', line 143

def get_avatar_image(person_id, opts = {})
  get_avatar_image_with_http_info(person_id, opts)
  return nil
end

#get_avatar_image_with_http_info(person_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Gets the avatar image related to the person personId. If the person has no related avatar then the placeholder query parameter can be optionally used to request a placeholder image to be returned. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :attachment (BOOLEAN)

    true enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response.

  • :if_modified_since (DateTime)

    Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, &#x60;Wed, 09 Mar 2016 16:56:34 GMT&#x60;.

  • :placeholder (BOOLEAN)

    If true and there is no avatar for this personId then the placeholder image is returned, rather than a 404 response.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/alfresco_api/api/people_api.rb', line 156

def get_avatar_image_with_http_info(person_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.get_avatar_image ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.get_avatar_image"
  end
  # resource path
  local_var_path = "/people/{personId}/avatar".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'attachment'] = opts[:'attachment'] if !opts[:'attachment'].nil?
  query_params[:'placeholder'] = opts[:'placeholder'] if !opts[:'placeholder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#get_avatar_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_person(person_id, opts = {}) ⇒ PersonEntry

Get a person Gets information for the person personId. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



204
205
206
207
# File 'lib/alfresco_api/api/people_api.rb', line 204

def get_person(person_id, opts = {})
  data, _status_code, _headers = get_person_with_http_info(person_id, opts)
  return data
end

#get_person_with_http_info(person_id, opts = {}) ⇒ Array<(PersonEntry, Fixnum, Hash)>

Get a person Gets information for the person personId. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(PersonEntry, Fixnum, Hash)>)

    PersonEntry data, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/alfresco_api/api/people_api.rb', line 215

def get_person_with_http_info(person_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.get_person ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.get_person"
  end
  # resource path
  local_var_path = "/people/{personId}".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PersonEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#get_person\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_people(opts = {}) ⇒ PersonPaging

List people Note: this endpoint is available in Alfresco 5.2 and newer versions. List people. You can use the include parameter to return any additional information. The default sort order for the returned list is for people to be sorted by ascending id. You can override the default by using the orderBy parameter. You can use any of the following fields to order the results: * id * firstName * lastName

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the person. The following optional fields can be requested: * properties * aspectNames

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



265
266
267
268
# File 'lib/alfresco_api/api/people_api.rb', line 265

def list_people(opts = {})
  data, _status_code, _headers = list_people_with_http_info(opts)
  return data
end

#list_people_with_http_info(opts = {}) ⇒ Array<(PersonPaging, Fixnum, Hash)>

List people Note: this endpoint is available in Alfresco 5.2 and newer versions. List people. You can use the include parameter to return any additional information. The default sort order for the returned list is for people to be sorted by ascending id. You can override the default by using the orderBy parameter. You can use any of the following fields to order the results: * id * firstName * lastName

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the person. The following optional fields can be requested: * properties * aspectNames

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(PersonPaging, Fixnum, Hash)>)

    PersonPaging data, response status code and response headers



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/alfresco_api/api/people_api.rb', line 279

def list_people_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.list_people ..."
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling PeopleApi.list_people, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling PeopleApi.list_people, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/people"

  # query parameters
  query_params = {}
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PersonPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#list_people\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#request_password_reset(person_id, client_body, opts = {}) ⇒ nil

Request password reset Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Initiates the reset password workflow to send an email with reset password instruction to the user’s registered email. The client is mandatory in the request body. For example: “‘JSON { "client": "myClient" } “` Note: The client must be registered before this API can send an email. See [server documentation]. However, out-of-the-box share is registered as a default client, so you could pass share as the client name: “`JSON { "client": "share" } “` Note: No authentication is required to call this endpoint.

Parameters:

  • person_id

    The identifier of a person.

  • client_body

    The client name to send email with app-specific url.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


334
335
336
337
# File 'lib/alfresco_api/api/people_api.rb', line 334

def request_password_reset(person_id, client_body, opts = {})
  request_password_reset_with_http_info(person_id, client_body, opts)
  return nil
end

#request_password_reset_with_http_info(person_id, client_body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Request password reset Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Initiates the reset password workflow to send an email with reset password instruction to the user&#39;s registered email. The client is mandatory in the request body. For example: &#x60;&#x60;&#x60;JSON { &quot;client&quot;: &quot;myClient&quot; } &#x60;&#x60;&#x60; Note: The client must be registered before this API can send an email. See [server documentation]. However, out-of-the-box share is registered as a default client, so you could pass share as the client name: &#x60;&#x60;&#x60;JSON { &quot;client&quot;: &quot;share&quot; } &#x60;&#x60;&#x60; Note: No authentication is required to call this endpoint.

Parameters:

  • person_id

    The identifier of a person.

  • client_body

    The client name to send email with app-specific url.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/alfresco_api/api/people_api.rb', line 345

def request_password_reset_with_http_info(person_id, client_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.request_password_reset ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.request_password_reset"
  end
  # verify the required parameter 'client_body' is set
  if @api_client.config.client_side_validation && client_body.nil?
    fail ArgumentError, "Missing the required parameter 'client_body' when calling PeopleApi.request_password_reset"
  end
  # resource path
  local_var_path = "/people/{personId}/request-password-reset".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(client_body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#request_password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_password(person_id, password_reset_body, opts = {}) ⇒ nil

Reset password Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Resets user’s password The password, id and key properties are mandatory in the request body. For example: “‘JSON { "password":"newPassword", "id":"activiti$10", "key":"4dad6d00-0daf-413a-b200-f64af4e12345" } “` Note: No authentication is required to call this endpoint.

Parameters:

  • person_id

    The identifier of a person.

  • password_reset_body

    The reset password details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


394
395
396
397
# File 'lib/alfresco_api/api/people_api.rb', line 394

def reset_password(person_id, password_reset_body, opts = {})
  reset_password_with_http_info(person_id, password_reset_body, opts)
  return nil
end

#reset_password_with_http_info(person_id, password_reset_body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Reset password Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Resets user&#39;s password The password, id and key properties are mandatory in the request body. For example: &#x60;&#x60;&#x60;JSON { &quot;password&quot;:&quot;newPassword&quot;, &quot;id&quot;:&quot;activiti$10&quot;, &quot;key&quot;:&quot;4dad6d00-0daf-413a-b200-f64af4e12345&quot; } &#x60;&#x60;&#x60; Note: No authentication is required to call this endpoint.

Parameters:

  • person_id

    The identifier of a person.

  • password_reset_body

    The reset password details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/alfresco_api/api/people_api.rb', line 405

def reset_password_with_http_info(person_id, password_reset_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.reset_password ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.reset_password"
  end
  # verify the required parameter 'password_reset_body' is set
  if @api_client.config.client_side_validation && password_reset_body.nil?
    fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling PeopleApi.reset_password"
  end
  # resource path
  local_var_path = "/people/{personId}/reset-password".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(password_reset_body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#reset_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_avatar_image(person_id, content_body_update, opts = {}) ⇒ nil

Update avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Updates the avatar image related to the person personId. The request body should be the binary stream for the avatar image. The content type of the file should be an image file. This will be used to generate an "avatar" thumbnail rendition. You must be the person or have admin rights to update a person’s avatar. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • content_body_update

    The binary content

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


454
455
456
457
# File 'lib/alfresco_api/api/people_api.rb', line 454

def update_avatar_image(person_id, content_body_update, opts = {})
  update_avatar_image_with_http_info(person_id, content_body_update, opts)
  return nil
end

#update_avatar_image_with_http_info(person_id, content_body_update, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update avatar image Note: this endpoint is available in Alfresco 5.2.2 and newer versions. Updates the avatar image related to the person personId. The request body should be the binary stream for the avatar image. The content type of the file should be an image file. This will be used to generate an &quot;avatar&quot; thumbnail rendition. You must be the person or have admin rights to update a person&#39;s avatar. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user.

Parameters:

  • person_id

    The identifier of a person.

  • content_body_update

    The binary content

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/alfresco_api/api/people_api.rb', line 465

def update_avatar_image_with_http_info(person_id, content_body_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.update_avatar_image ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.update_avatar_image"
  end
  # verify the required parameter 'content_body_update' is set
  if @api_client.config.client_side_validation && content_body_update.nil?
    fail ArgumentError, "Missing the required parameter 'content_body_update' when calling PeopleApi.update_avatar_image"
  end
  # resource path
  local_var_path = "/people/{personId}/avatar".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(content_body_update)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#update_avatar_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_person(person_id, person_body_update, opts = {}) ⇒ PersonEntry

Update person Note: this endpoint is available in Alfresco 5.2 and newer versions. Update the given person’s details. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user. If applicable, the given person’s login access can also be optionally disabled or re-enabled. You must have admin rights to update a person — unless updating your own details. If you are changing your password, as a non-admin user, then the existing password must also be supplied (using the oldPassword field in addition to the new password value). Admin users cannot be disabled by setting enabled to false. Non-admin users may not disable themselves. You can set custom properties when you update a person: “‘JSON { "firstName": "Alice", "properties": { "my:property": "The value" } } “` Note: setting properties of type d:content and d:category are not supported.

Parameters:

  • person_id

    The identifier of a person.

  • person_body_update

    The person details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



515
516
517
518
# File 'lib/alfresco_api/api/people_api.rb', line 515

def update_person(person_id, person_body_update, opts = {})
  data, _status_code, _headers = update_person_with_http_info(person_id, person_body_update, opts)
  return data
end

#update_person_with_http_info(person_id, person_body_update, opts = {}) ⇒ Array<(PersonEntry, Fixnum, Hash)>

Update person Note: this endpoint is available in Alfresco 5.2 and newer versions. Update the given person&#39;s details. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user. If applicable, the given person&#39;s login access can also be optionally disabled or re-enabled. You must have admin rights to update a person — unless updating your own details. If you are changing your password, as a non-admin user, then the existing password must also be supplied (using the oldPassword field in addition to the new password value). Admin users cannot be disabled by setting enabled to false. Non-admin users may not disable themselves. You can set custom properties when you update a person: &#x60;&#x60;&#x60;JSON { &quot;firstName&quot;: &quot;Alice&quot;, &quot;properties&quot;: { &quot;my:property&quot;: &quot;The value&quot; } } &#x60;&#x60;&#x60; Note: setting properties of type d:content and d:category are not supported.

Parameters:

  • person_id

    The identifier of a person.

  • person_body_update

    The person details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(PersonEntry, Fixnum, Hash)>)

    PersonEntry data, response status code and response headers



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/alfresco_api/api/people_api.rb', line 527

def update_person_with_http_info(person_id, person_body_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PeopleApi.update_person ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling PeopleApi.update_person"
  end
  # verify the required parameter 'person_body_update' is set
  if @api_client.config.client_side_validation && person_body_update.nil?
    fail ArgumentError, "Missing the required parameter 'person_body_update' when calling PeopleApi.update_person"
  end
  # resource path
  local_var_path = "/people/{personId}".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(person_body_update)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PersonEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#update_person\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end