class Pinnacle::CompanyClient

def get(company_id: nil, company_name: nil, request_options: nil)

Returns:
  • (Array) -

Parameters:
  • request_options (Pinnacle::RequestOptions) --
  • company_name (String) -- The name of the company
  • company_id (Integer) -- The unique identifier for the company
def get(company_id: nil, company_name: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "companyId": company_id,
      "companyName": company_name
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/company"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    Pinnacle::Company.from_json(json_object: item)
  end
end

def initialize(request_client:)

Returns:
  • (Pinnacle::CompanyClient) -

Parameters:
  • request_client (Pinnacle::RequestClient) --
def initialize(request_client:)
  @request_client = request_client
end

def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)

Returns:
  • (Pinnacle::Company::CompanyRegisterResponse) -

Parameters:
  • request_options (Pinnacle::RequestOptions) --
  • optionals (Hash) -- Request of type Pinnacle::Optionals, as a Hash
  • point_of_contact (Hash) -- Request of type Pinnacle::PointOfContact, as a Hash
  • messaging (Hash) -- Request of type Pinnacle::Messaging, as a Hash
  • company_contact (Hash) -- Request of type Pinnacle::CompanyContact, as a Hash
  • company (Hash) -- Request of type Pinnacle::CompanyDetails, as a Hash
def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)
  response = @request_client.conn.post do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    unless request_options.nil? || request_options&.additional_query_parameters.nil?
      req.params = { **(request_options&.additional_query_parameters || {}) }.compact
    end
    req.body = {
      **(request_options&.additional_body_parameters || {}),
      company: company,
      companyContact: company_contact,
      messaging: messaging,
      pointOfContact: point_of_contact,
      optionals: optionals
    }.compact
    req.url "#{@request_client.get_url(request_options: request_options)}/company/register"
  end
  Pinnacle::Company::CompanyRegisterResponse.from_json(json_object: response.body)
end

def update(company_id:, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil, optionals: nil,

Returns:
  • (Pinnacle::Company::CompanyUpdateResponse) -

Parameters:
  • request_options (Pinnacle::RequestOptions) --
  • optionals (Hash) -- Request of type Pinnacle::Optionals, as a Hash
  • point_of_contact (Hash) -- Request of type Pinnacle::PointOfContact, as a Hash
  • messaging (Hash) -- Request of type Pinnacle::Messaging, as a Hash
  • company_contact (Hash) -- Request of type Pinnacle::CompanyContact, as a Hash
  • company (Hash) -- Request of type Pinnacle::Company, as a Hash
  • company_id (String) --
def update(company_id:, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil, optionals: nil,
           request_options: nil)
  response = @request_client.conn.post do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    unless request_options.nil? || request_options&.additional_query_parameters.nil?
      req.params = { **(request_options&.additional_query_parameters || {}) }.compact
    end
    req.body = {
      **(request_options&.additional_body_parameters || {}),
      companyId: company_id,
      company: company,
      companyContact: company_contact,
      messaging: messaging,
      pointOfContact: point_of_contact,
      optionals: optionals
    }.compact
    req.url "#{@request_client.get_url(request_options: request_options)}/company/update"
  end
  Pinnacle::Company::CompanyUpdateResponse.from_json(json_object: response.body)
end