class Pipedrive::RolesApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/roles_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get all roles @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [GetRoles]
# 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
Get all roles @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(GetRoles
, Integer, Hash)>] GetRoles
data, response status code and response headers
# 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'] 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: RolesApi#roles_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a role assignment Delete assignment from a role @param id [Integer] ID of the role @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [DeleteRoleAssignment]
# 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
Delete a role assignment Delete assignment from a role @param id [Integer] ID of the role @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(DeleteRoleAssignment
, Integer, Hash)>] DeleteRoleAssignment
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_assignments_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List role assignments List assignments for a role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [GetRoleAssignments]
# 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
List role assignments List assignments for a role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(GetRoleAssignments
, Integer, Hash)>] GetRoleAssignments
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_assignments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add role assignment Add assignment for a role @param id [Integer] ID of the role @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [PostRoleAssignment]
# 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
Add role assignment Add assignment for a role @param id [Integer] ID of the role @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(PostRoleAssignment
, Integer, Hash)>] PostRoleAssignment
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_assignments_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [DeleteRole]
# 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
Delete a role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [Array<(DeleteRole
, Integer, Hash)>] DeleteRole
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [GetRole]
# 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
Get one role @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [Array<(GetRole
, Integer, Hash)>] GetRole
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update role details @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :parent_role_id The ID of the parent Role @option opts [String] :name The name of the Role @return [PutRole]
# 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
Update role details @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :parent_role_id The ID of the parent Role @option opts [String] :name The name of the Role @return [Array<(PutRole
, Integer, Hash)>] PutRole
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List role sub-roles @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [GetRoleSubroles]
# 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
List role sub-roles @param id [Integer] ID of the role @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(GetRoleSubroles
, Integer, Hash)>] GetRoleSubroles
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_roles_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List role settings @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [GetRoleSettings]
# 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
List role settings @param id [Integer] ID of the role @param [Hash] opts the optional parameters @return [Array<(GetRoleSettings
, Integer, Hash)>] GetRoleSettings
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add or update role setting @param id [Integer] ID of the role @param setting_key [String] @param value [NumberBooleanDefault0] Possible values for default_visibility settings: 0…1. @param [Hash] opts the optional parameters @return [PostRoleSettings]
# 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
Add or update role setting @param id [Integer] ID of the role @param setting_key [String] @param value [NumberBooleanDefault0] Possible values for default_visibility settings: 0…1. @param [Hash] opts the optional parameters @return [Array<(PostRoleSettings
, Integer, Hash)>] PostRoleSettings
data, response status code and response headers
# 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'] 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: RolesApi#roles_id_settings_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a role @param [Hash] opts the optional parameters @return [PostRoles]
# 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
Add a role @param [Hash] opts the optional parameters @return [Array<(PostRoles
, Integer, Hash)>] PostRoles
data, response status code and response headers
# 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'] 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: RolesApi#roles_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end