Class: Pipedrive::RolesApi
- Inherits:
-
Object
- Object
- Pipedrive::RolesApi
- Defined in:
- lib/pipedrive-openapi-client/api/roles_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ RolesApi
constructor
A new instance of RolesApi.
-
#roles_get(opts = {}) ⇒ GetRoles
Get all roles.
-
#roles_get_with_http_info(opts = {}) ⇒ Array<(GetRoles, Integer, Hash)>
Get all roles.
-
#roles_id_assignments_delete(id, user_id, opts = {}) ⇒ DeleteRoleAssignment
Delete a role assignment Delete assignment from a role.
-
#roles_id_assignments_delete_with_http_info(id, user_id, opts = {}) ⇒ Array<(DeleteRoleAssignment, Integer, Hash)>
Delete a role assignment Delete assignment from a role.
-
#roles_id_assignments_get(id, opts = {}) ⇒ GetRoleAssignments
List role assignments List assignments for a role.
-
#roles_id_assignments_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleAssignments, Integer, Hash)>
List role assignments List assignments for a role.
-
#roles_id_assignments_post(id, user_id, opts = {}) ⇒ PostRoleAssignment
Add role assignment Add assignment for a role.
-
#roles_id_assignments_post_with_http_info(id, user_id, opts = {}) ⇒ Array<(PostRoleAssignment, Integer, Hash)>
Add role assignment Add assignment for a role.
-
#roles_id_delete(id, opts = {}) ⇒ DeleteRole
Delete a role.
-
#roles_id_delete_with_http_info(id, opts = {}) ⇒ Array<(DeleteRole, Integer, Hash)>
Delete a role.
-
#roles_id_get(id, opts = {}) ⇒ GetRole
Get one role.
-
#roles_id_get_with_http_info(id, opts = {}) ⇒ Array<(GetRole, Integer, Hash)>
Get one role.
-
#roles_id_put(id, opts = {}) ⇒ PutRole
Update role details.
-
#roles_id_put_with_http_info(id, opts = {}) ⇒ Array<(PutRole, Integer, Hash)>
Update role details.
-
#roles_id_roles_get(id, opts = {}) ⇒ GetRoleSubroles
List role sub-roles.
-
#roles_id_roles_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleSubroles, Integer, Hash)>
List role sub-roles.
-
#roles_id_settings_get(id, opts = {}) ⇒ GetRoleSettings
List role settings.
-
#roles_id_settings_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleSettings, Integer, Hash)>
List role settings.
-
#roles_id_settings_post(id, setting_key, value, opts = {}) ⇒ PostRoleSettings
Add or update role setting.
-
#roles_id_settings_post_with_http_info(id, setting_key, value, opts = {}) ⇒ Array<(PostRoleSettings, Integer, Hash)>
Add or update role setting.
-
#roles_post(opts = {}) ⇒ PostRoles
Add a role.
-
#roles_post_with_http_info(opts = {}) ⇒ Array<(PostRoles, Integer, Hash)>
Add a role.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#roles_get(opts = {}) ⇒ GetRoles
Get all roles
27 28 29 30 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 27 def roles_get(opts = {}) data, _status_code, _headers = roles_get_with_http_info(opts) data end |
#roles_get_with_http_info(opts = {}) ⇒ Array<(GetRoles, Integer, Hash)>
Get all roles
37 38 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 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 37 def roles_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_get ...' end # resource path local_var_path = '/roles' # 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] || {} # 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] || 'GetRoles' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_assignments_delete(id, user_id, opts = {}) ⇒ DeleteRoleAssignment
Delete a role assignment Delete assignment from a role
88 89 90 91 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 88 def roles_id_assignments_delete(id, user_id, opts = {}) data, _status_code, _headers = roles_id_assignments_delete_with_http_info(id, user_id, opts) data end |
#roles_id_assignments_delete_with_http_info(id, user_id, opts = {}) ⇒ Array<(DeleteRoleAssignment, Integer, Hash)>
Delete a role assignment Delete assignment from a role
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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 99 def roles_id_assignments_delete_with_http_info(id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_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 RolesApi.roles_id_assignments_delete" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling RolesApi.roles_id_assignments_delete" end # resource path local_var_path = '/roles/{id}/assignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'user_id'] = user_id # 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] || 'DeleteRoleAssignment' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_assignments_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_assignments_get(id, opts = {}) ⇒ GetRoleAssignments
List role assignments List assignments for a role
158 159 160 161 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 158 def roles_id_assignments_get(id, opts = {}) data, _status_code, _headers = roles_id_assignments_get_with_http_info(id, opts) data end |
#roles_id_assignments_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleAssignments, Integer, Hash)>
List role assignments List assignments for a role
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 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 170 def roles_id_assignments_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_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 RolesApi.roles_id_assignments_get" end # resource path local_var_path = '/roles/{id}/assignments'.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] || {} # 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] || 'GetRoleAssignments' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_assignments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_assignments_post(id, user_id, opts = {}) ⇒ PostRoleAssignment
Add role assignment Add assignment for a role
225 226 227 228 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 225 def roles_id_assignments_post(id, user_id, opts = {}) data, _status_code, _headers = roles_id_assignments_post_with_http_info(id, user_id, opts) data end |
#roles_id_assignments_post_with_http_info(id, user_id, opts = {}) ⇒ Array<(PostRoleAssignment, Integer, Hash)>
Add role assignment Add assignment for a role
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 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 236 def roles_id_assignments_post_with_http_info(id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_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 RolesApi.roles_id_assignments_post" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling RolesApi.roles_id_assignments_post" end # resource path local_var_path = '/roles/{id}/assignments'.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['user_id'] = user_id # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PostRoleAssignment' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_assignments_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_delete(id, opts = {}) ⇒ DeleteRole
Delete a role
294 295 296 297 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 294 def roles_id_delete(id, opts = {}) data, _status_code, _headers = roles_id_delete_with_http_info(id, opts) data end |
#roles_id_delete_with_http_info(id, opts = {}) ⇒ Array<(DeleteRole, Integer, Hash)>
Delete a role
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 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 303 def roles_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_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 RolesApi.roles_id_delete" end # resource path local_var_path = '/roles/{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] || 'DeleteRole' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_get(id, opts = {}) ⇒ GetRole
Get one role
354 355 356 357 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 354 def roles_id_get(id, opts = {}) data, _status_code, _headers = roles_id_get_with_http_info(id, opts) data end |
#roles_id_get_with_http_info(id, opts = {}) ⇒ Array<(GetRole, Integer, Hash)>
Get one role
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 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 363 def roles_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_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 RolesApi.roles_id_get" end # resource path local_var_path = '/roles/{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] || 'GetRole' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_put(id, opts = {}) ⇒ PutRole
Update role details
416 417 418 419 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 416 def roles_id_put(id, opts = {}) data, _status_code, _headers = roles_id_put_with_http_info(id, opts) data end |
#roles_id_put_with_http_info(id, opts = {}) ⇒ Array<(PutRole, Integer, Hash)>
Update role details
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 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 427 def roles_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_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 RolesApi.roles_id_put" end # resource path local_var_path = '/roles/{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['parent_role_id'] = opts[:'parent_role_id'] if !opts[:'parent_role_id'].nil? form_params['name'] = opts[:'name'] if !opts[:'name'].nil? # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PutRole' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_roles_get(id, opts = {}) ⇒ GetRoleSubroles
List role sub-roles
484 485 486 487 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 484 def roles_id_roles_get(id, opts = {}) data, _status_code, _headers = roles_id_roles_get_with_http_info(id, opts) data end |
#roles_id_roles_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleSubroles, Integer, Hash)>
List role sub-roles
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 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 495 def roles_id_roles_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_roles_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 RolesApi.roles_id_roles_get" end # resource path local_var_path = '/roles/{id}/roles'.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] || {} # 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] || 'GetRoleSubroles' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_roles_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_settings_get(id, opts = {}) ⇒ GetRoleSettings
List role settings
548 549 550 551 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 548 def roles_id_settings_get(id, opts = {}) data, _status_code, _headers = roles_id_settings_get_with_http_info(id, opts) data end |
#roles_id_settings_get_with_http_info(id, opts = {}) ⇒ Array<(GetRoleSettings, Integer, Hash)>
List role settings
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 594 595 596 597 598 599 600 601 602 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 557 def roles_id_settings_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_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 RolesApi.roles_id_settings_get" end # resource path local_var_path = '/roles/{id}/settings'.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] || 'GetRoleSettings' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_id_settings_post(id, setting_key, value, opts = {}) ⇒ PostRoleSettings
Add or update role setting
610 611 612 613 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 610 def roles_id_settings_post(id, setting_key, value, opts = {}) data, _status_code, _headers = roles_id_settings_post_with_http_info(id, setting_key, value, opts) data end |
#roles_id_settings_post_with_http_info(id, setting_key, value, opts = {}) ⇒ Array<(PostRoleSettings, Integer, Hash)>
Add or update role setting
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 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 621 def roles_id_settings_post_with_http_info(id, setting_key, value, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_id_settings_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 RolesApi.roles_id_settings_post" end # verify the required parameter 'setting_key' is set if @api_client.config.client_side_validation && setting_key.nil? fail ArgumentError, "Missing the required parameter 'setting_key' when calling RolesApi.roles_id_settings_post" end # verify enum value allowable_values = ["deal_default_visibility", "org_default_visibility", "person_default_visibility", "product_default_visibility"] if @api_client.config.client_side_validation && !allowable_values.include?(setting_key) fail ArgumentError, "invalid value for \"setting_key\", must be one of #{allowable_values}" end # verify the required parameter 'value' is set if @api_client.config.client_side_validation && value.nil? fail ArgumentError, "Missing the required parameter 'value' when calling RolesApi.roles_id_settings_post" end # resource path local_var_path = '/roles/{id}/settings'.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['setting_key'] = setting_key form_params['value'] = value # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PostRoleSettings' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_id_settings_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#roles_post(opts = {}) ⇒ PostRoles
Add a role
688 689 690 691 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 688 def roles_post(opts = {}) data, _status_code, _headers = roles_post_with_http_info(opts) data end |
#roles_post_with_http_info(opts = {}) ⇒ Array<(PostRoles, Integer, Hash)>
Add a role
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 729 730 731 732 733 734 735 736 737 738 739 |
# File 'lib/pipedrive-openapi-client/api/roles_api.rb', line 696 def roles_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.roles_post ...' end # resource path local_var_path = '/roles' # 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] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PostRoles' # auth_names auth_names = opts[:auth_names] || ['api_key'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#roles_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |