Class: Pipedrive::UsersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pipedrive-openapi-client/api/users_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UsersApi

Returns a new instance of UsersApi.



19
20
21
# File 'lib/pipedrive-openapi-client/api/users_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/pipedrive-openapi-client/api/users_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#users_find_get(term, opts = {}) ⇒ Users

Find users by name Finds users by their name.

Parameters:

  • term (String)

    Search term to look for

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

    the optional parameters

Options Hash (opts):

  • :search_by_email (NumberBooleanDefault0)

    When enabled, term will only be matched against email addresses of users. Default: false

Returns:



28
29
30
31
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 28

def users_find_get(term, opts = {})
  data, _status_code, _headers = users_find_get_with_http_info(term, opts)
  data
end

#users_find_get_with_http_info(term, opts = {}) ⇒ Array<(Users, Integer, Hash)>

Find users by name Finds users by their name.

Parameters:

  • term (String)

    Search term to look for

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

    the optional parameters

Options Hash (opts):

  • :search_by_email (NumberBooleanDefault0)

    When enabled, term will only be matched against email addresses of users. Default: false

Returns:

  • (Array<(Users, Integer, Hash)>)

    Users data, response status code and response headers



39
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
80
81
82
83
84
85
86
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 39

def users_find_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_find_get ...'
  end
  # verify the required parameter 'term' is set
  if @api_client.config.client_side_validation && term.nil?
    fail ArgumentError, "Missing the required parameter 'term' when calling UsersApi.users_find_get"
  end
  # resource path
  local_var_path = '/users/find'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  query_params[:'search_by_email'] = opts[:'search_by_email'] if !opts[:'search_by_email'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Users' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_find_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_get(opts = {}) ⇒ Users

Get all users Returns data about all users within the company

Parameters:

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

    the optional parameters

Returns:



92
93
94
95
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 92

def users_get(opts = {})
  data, _status_code, _headers = users_get_with_http_info(opts)
  data
end

#users_get_with_http_info(opts = {}) ⇒ Array<(Users, Integer, Hash)>

Get all users Returns data about all users within the company

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Users, Integer, Hash)>)

    Users data, response status code and response headers



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
134
135
136
137
138
139
140
141
142
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 101

def users_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_get ...'
  end
  # resource path
  local_var_path = '/users'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Users' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_blacklisted_emails_get(id, opts = {}) ⇒ nil

List blacklisted email addresses of a user Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive when using the built-in Mailbox.

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (nil)


149
150
151
152
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 149

def users_id_blacklisted_emails_get(id, opts = {})
  users_id_blacklisted_emails_get_with_http_info(id, opts)
  nil
end

#users_id_blacklisted_emails_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List blacklisted email addresses of a user Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive when using the built-in Mailbox.

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
197
198
199
200
201
202
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 159

def users_id_blacklisted_emails_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_blacklisted_emails_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_blacklisted_emails_get"
  end
  # resource path
  local_var_path = '/users/{id}/blacklistedEmails'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_blacklisted_emails_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_blacklisted_emails_post(id, address, opts = {}) ⇒ nil

Add blacklisted email address for a user Add blacklisted email address for a specific user.

Parameters:

  • id (Integer)

    ID of the user

  • address (String)

    Email address to blacklist (can contain \\\* for wildcards, e.g. \\\*@example.com, or john\\\*@ex\\\*.com)

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

    the optional parameters

Returns:

  • (nil)


210
211
212
213
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 210

def users_id_blacklisted_emails_post(id, address, opts = {})
  users_id_blacklisted_emails_post_with_http_info(id, address, opts)
  nil
end

#users_id_blacklisted_emails_post_with_http_info(id, address, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add blacklisted email address for a user Add blacklisted email address for a specific user.

Parameters:

  • id (Integer)

    ID of the user

  • address (String)

    Email address to blacklist (can contain \\\* for wildcards, e.g. \\\*@example.com, or john\\\*@ex\\\*.com)

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 221

def users_id_blacklisted_emails_post_with_http_info(id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_blacklisted_emails_post ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_blacklisted_emails_post"
  end
  # verify the required parameter 'address' is set
  if @api_client.config.client_side_validation && address.nil?
    fail ArgumentError, "Missing the required parameter 'address' when calling UsersApi.users_id_blacklisted_emails_post"
  end
  # resource path
  local_var_path = '/users/{id}/blacklistedEmails'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['address'] = address

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_blacklisted_emails_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_followers_get(id, opts = {}) ⇒ UserIDs

List followers of a user Lists followers of a specific user.

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:



278
279
280
281
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 278

def users_id_followers_get(id, opts = {})
  data, _status_code, _headers = users_id_followers_get_with_http_info(id, opts)
  data
end

#users_id_followers_get_with_http_info(id, opts = {}) ⇒ Array<(UserIDs, Integer, Hash)>

List followers of a user Lists followers of a specific user.

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (Array<(UserIDs, Integer, Hash)>)

    UserIDs data, response status code and response headers



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
327
328
329
330
331
332
333
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 288

def users_id_followers_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_followers_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_followers_get"
  end
  # resource path
  local_var_path = '/users/{id}/followers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'UserIDs' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_followers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_get(id, opts = {}) ⇒ User

Get one user Returns data about a specific user within the company

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:



340
341
342
343
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 340

def users_id_get(id, opts = {})
  data, _status_code, _headers = users_id_get_with_http_info(id, opts)
  data
end

#users_id_get_with_http_info(id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Get one user Returns data about a specific user within the company

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (Array<(User, Integer, Hash)>)

    User data, response status code and response headers



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
387
388
389
390
391
392
393
394
395
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 350

def users_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_get"
  end
  # resource path
  local_var_path = '/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'User' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_permissions_get(id, opts = {}) ⇒ nil

List user permissions List aggregated permissions over all assigned permission sets for a user

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (nil)


402
403
404
405
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 402

def users_id_permissions_get(id, opts = {})
  users_id_permissions_get_with_http_info(id, opts)
  nil
end

#users_id_permissions_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List user permissions List aggregated permissions over all assigned permission sets for a user

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
447
448
449
450
451
452
453
454
455
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 412

def users_id_permissions_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_permissions_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_permissions_get"
  end
  # resource path
  local_var_path = '/users/{id}/permissions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_permissions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_put(id, active_flag, opts = {}) ⇒ User

Update user details Updates the properties of a user. Currently, only active_flag can be updated.

Parameters:

  • id (Integer)

    ID of the user

  • active_flag (Boolean)

    Whether the user is active or not. false &#x3D; Not activated, true &#x3D; Activated

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

    the optional parameters

Returns:



463
464
465
466
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 463

def users_id_put(id, active_flag, opts = {})
  data, _status_code, _headers = users_id_put_with_http_info(id, active_flag, opts)
  data
end

#users_id_put_with_http_info(id, active_flag, opts = {}) ⇒ Array<(User, Integer, Hash)>

Update user details Updates the properties of a user. Currently, only active_flag can be updated.

Parameters:

  • id (Integer)

    ID of the user

  • active_flag (Boolean)

    Whether the user is active or not. false &#x3D; Not activated, true &#x3D; Activated

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

    the optional parameters

Returns:

  • (Array<(User, Integer, Hash)>)

    User data, response status code and response headers



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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 474

def users_id_put_with_http_info(id, active_flag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_put ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_put"
  end
  # verify the required parameter 'active_flag' is set
  if @api_client.config.client_side_validation && active_flag.nil?
    fail ArgumentError, "Missing the required parameter 'active_flag' when calling UsersApi.users_id_put"
  end
  # resource path
  local_var_path = '/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['active_flag'] = active_flag

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'User' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_role_assignments_delete(id, role_id, opts = {}) ⇒ nil

Delete a role assignment Delete a role assignment for a user

Parameters:

  • id (Integer)

    ID of the user

  • role_id (Integer)

    ID of the role

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

    the optional parameters

Returns:

  • (nil)


534
535
536
537
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 534

def users_id_role_assignments_delete(id, role_id, opts = {})
  users_id_role_assignments_delete_with_http_info(id, role_id, opts)
  nil
end

#users_id_role_assignments_delete_with_http_info(id, role_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a role assignment Delete a role assignment for a user

Parameters:

  • id (Integer)

    ID of the user

  • role_id (Integer)

    ID of the role

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 545

def users_id_role_assignments_delete_with_http_info(id, role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_delete"
  end
  # verify the required parameter 'role_id' is set
  if @api_client.config.client_side_validation && role_id.nil?
    fail ArgumentError, "Missing the required parameter 'role_id' when calling UsersApi.users_id_role_assignments_delete"
  end
  # resource path
  local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'role_id'] = role_id

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_role_assignments_get(id, opts = {}) ⇒ nil

List role assignments List role assignments for a user

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:

  • (nil)


602
603
604
605
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 602

def users_id_role_assignments_get(id, opts = {})
  users_id_role_assignments_get_with_http_info(id, opts)
  nil
end

#users_id_role_assignments_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List role assignments List role assignments for a user

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

Returns:

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

    nil, response status code and response headers



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 614

def users_id_role_assignments_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_get"
  end
  # resource path
  local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_role_assignments_post(id, role_id, opts = {}) ⇒ nil

Add role assignment Add role assignment for a user

Parameters:

  • id (Integer)

    ID of the user

  • role_id (Integer)

    ID of the role

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

    the optional parameters

Returns:

  • (nil)


667
668
669
670
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 667

def users_id_role_assignments_post(id, role_id, opts = {})
  users_id_role_assignments_post_with_http_info(id, role_id, opts)
  nil
end

#users_id_role_assignments_post_with_http_info(id, role_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add role assignment Add role assignment for a user

Parameters:

  • id (Integer)

    ID of the user

  • role_id (Integer)

    ID of the role

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 678

def users_id_role_assignments_post_with_http_info(id, role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_post ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_post"
  end
  # verify the required parameter 'role_id' is set
  if @api_client.config.client_side_validation && role_id.nil?
    fail ArgumentError, "Missing the required parameter 'role_id' when calling UsersApi.users_id_role_assignments_post"
  end
  # resource path
  local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['role_id'] = role_id

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_id_role_settings_get(id, opts = {}) ⇒ nil

List user role settings List settings of user’s assigned role

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (nil)


735
736
737
738
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 735

def users_id_role_settings_get(id, opts = {})
  users_id_role_settings_get_with_http_info(id, opts)
  nil
end

#users_id_role_settings_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List user role settings List settings of user&#39;s assigned role

Parameters:

  • id (Integer)

    ID of the user

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 745

def users_id_role_settings_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_settings_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_settings_get"
  end
  # resource path
  local_var_path = '/users/{id}/roleSettings'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_id_role_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_me_get(opts = {}) ⇒ UserMe

Get current user data Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the ‘locale’ property means ‘Date and number format’ in the Pipedrive settings, not the chosen language.

Parameters:

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

    the optional parameters

Returns:



794
795
796
797
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 794

def users_me_get(opts = {})
  data, _status_code, _headers = users_me_get_with_http_info(opts)
  data
end

#users_me_get_with_http_info(opts = {}) ⇒ Array<(UserMe, Integer, Hash)>

Get current user data Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the &#39;locale&#39; property means &#39;Date and number format&#39; in the Pipedrive settings, not the chosen language.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(UserMe, Integer, Hash)>)

    UserMe data, response status code and response headers



803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 803

def users_me_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_me_get ...'
  end
  # resource path
  local_var_path = '/users/me'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'UserMe' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_me_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_post(name, email, active_flag, opts = {}) ⇒ User

Add a new user Adds a new user to the company, returns the ID upon success.

Parameters:

  • name (String)

    Name of the user

  • email (String)

    Email of the user

  • active_flag (Boolean)

    Whether the user is active or not. false &#x3D; Not activated, true &#x3D; Activated

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

    the optional parameters

Returns:



853
854
855
856
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 853

def users_post(name, email, active_flag, opts = {})
  data, _status_code, _headers = users_post_with_http_info(name, email, active_flag, opts)
  data
end

#users_post_with_http_info(name, email, active_flag, opts = {}) ⇒ Array<(User, Integer, Hash)>

Add a new user Adds a new user to the company, returns the ID upon success.

Parameters:

  • name (String)

    Name of the user

  • email (String)

    Email of the user

  • active_flag (Boolean)

    Whether the user is active or not. false &#x3D; Not activated, true &#x3D; Activated

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

    the optional parameters

Returns:

  • (Array<(User, Integer, Hash)>)

    User data, response status code and response headers



865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/pipedrive-openapi-client/api/users_api.rb', line 865

def users_post_with_http_info(name, email, active_flag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_post ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling UsersApi.users_post"
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling UsersApi.users_post"
  end
  # verify the required parameter 'active_flag' is set
  if @api_client.config.client_side_validation && active_flag.nil?
    fail ArgumentError, "Missing the required parameter 'active_flag' when calling UsersApi.users_post"
  end
  # resource path
  local_var_path = '/users'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['name'] = name
  form_params['email'] = email
  form_params['active_flag'] = active_flag

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'User' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end