class Pipedrive::OrganizationRelationshipsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

organization_relationships_get(org_id, opts = {}) click to toggle source

Get all relationships for organization Gets all of the relationships for a supplied organization id. @param org_id [Integer] ID of the organization to get relationships for @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 27
def organization_relationships_get(org_id, opts = {})
  organization_relationships_get_with_http_info(org_id, opts)
  nil
end
organization_relationships_get_with_http_info(org_id, opts = {}) click to toggle source

Get all relationships for organization Gets all of the relationships for a supplied organization id. @param org_id [Integer] ID of the organization to get relationships for @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 37
def organization_relationships_get_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationRelationshipsApi.organization_relationships_get ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationRelationshipsApi.organization_relationships_get"
  end
  # resource path
  local_var_path = '/organizationRelationships'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'org_id'] = org_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', '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: OrganizationRelationshipsApi#organization_relationships_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organization_relationships_id_delete(id, opts = {}) click to toggle source

Delete an organization relationship Deletes an organization relationship and returns the deleted id. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 88
def organization_relationships_id_delete(id, opts = {})
  organization_relationships_id_delete_with_http_info(id, opts)
  nil
end
organization_relationships_id_delete_with_http_info(id, opts = {}) click to toggle source

Delete an organization relationship Deletes an organization relationship and returns the deleted id. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 98
def organization_relationships_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationRelationshipsApi.organization_relationships_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 OrganizationRelationshipsApi.organization_relationships_id_delete"
  end
  # resource path
  local_var_path = '/organizationRelationships/{id}'.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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationRelationshipsApi#organization_relationships_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organization_relationships_id_get(id, opts = {}) click to toggle source

Get one organization relationship Finds and returns an organization relationship from its ID. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @option opts [Integer] :org_id ID of the base organization for the returned calculated values @return [nil]

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 149
def organization_relationships_id_get(id, opts = {})
  organization_relationships_id_get_with_http_info(id, opts)
  nil
end
organization_relationships_id_get_with_http_info(id, opts = {}) click to toggle source

Get one organization relationship Finds and returns an organization relationship from its ID. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @option opts [Integer] :org_id ID of the base organization for the returned calculated values @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 160
def organization_relationships_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationRelationshipsApi.organization_relationships_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 OrganizationRelationshipsApi.organization_relationships_id_get"
  end
  # resource path
  local_var_path = '/organizationRelationships/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'org_id'] = opts[:'org_id'] if !opts[:'org_id'].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', '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: OrganizationRelationshipsApi#organization_relationships_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organization_relationships_id_put(id, opts = {}) click to toggle source

Update an organization relationship Updates and returns an organization relationship. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @option opts [Integer] :org_id ID of the base organization for the returned calculated values @option opts [String] :type The type of organization relationship. @option opts [Integer] :rel_owner_org_id The owner of this relationship. If type is &#39;parent&#39;, then the owner is the parent and the linked organization is the daughter. @option opts [Integer] :rel_linked_org_id The linked organization in this relationship. If type is &#39;parent&#39;, then the linked organization is the daughter. @return [nil]

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 215
def organization_relationships_id_put(id, opts = {})
  organization_relationships_id_put_with_http_info(id, opts)
  nil
end
organization_relationships_id_put_with_http_info(id, opts = {}) click to toggle source

Update an organization relationship Updates and returns an organization relationship. @param id [Integer] ID of the organization relationship @param [Hash] opts the optional parameters @option opts [Integer] :org_id ID of the base organization for the returned calculated values @option opts [String] :type The type of organization relationship. @option opts [Integer] :rel_owner_org_id The owner of this relationship. If type is &#39;parent&#39;, then the owner is the parent and the linked organization is the daughter. @option opts [Integer] :rel_linked_org_id The linked organization in this relationship. If type is &#39;parent&#39;, then the linked organization is the daughter. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 229
def organization_relationships_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationRelationshipsApi.organization_relationships_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 OrganizationRelationshipsApi.organization_relationships_id_put"
  end
  allowable_values = ["parent", "related"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/organizationRelationships/{id}'.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['org_id'] = opts[:'org_id'] if !opts[:'org_id'].nil?
  form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
  form_params['rel_owner_org_id'] = opts[:'rel_owner_org_id'] if !opts[:'rel_owner_org_id'].nil?
  form_params['rel_linked_org_id'] = opts[:'rel_linked_org_id'] if !opts[:'rel_linked_org_id'].nil?

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationRelationshipsApi#organization_relationships_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organization_relationships_post(opts = {}) click to toggle source

Create an organization relationship Creates and returns an organization relationship. @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 288
def organization_relationships_post(opts = {})
  organization_relationships_post_with_http_info(opts)
  nil
end
organization_relationships_post_with_http_info(opts = {}) click to toggle source

Create an organization relationship Creates and returns an organization relationship. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organization_relationships_api.rb, line 297
def organization_relationships_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationRelationshipsApi.organization_relationships_post ...'
  end
  # resource path
  local_var_path = '/organizationRelationships'

  # 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] || {}

  # 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: OrganizationRelationshipsApi#organization_relationships_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end