def upload_attachment(path_or_file_or_url, params = {}, headers = nil)
      file = file_from(path_or_file_or_url)
      setup_params_for_upload(params, file)

      response = send_post("/v1/teams/#{current_team!}/attachments/policies", params, headers)
      return response unless response.status == 200

      attachment = response.body['attachment']
      form_data  = response.body['form'].merge(file: Faraday::UploadIO.new(file, params[:type]))

      s3_response = send_s3_request(:post, attachment['endpoint'], form_data)
      return s3_response unless s3_response.status == 204

      response.body.delete('form')
      response
    end
def upload_attachment(path_or_file_or_url, params = {}, headers = nil)
      file = file_from(path_or_file_or_url)
      setup_params_for_upload(params, file)

      response = send_post("/v1/teams/#{current_team!}/attachments/policies", params, headers)
      return response unless response.status == 200

      attachment = response.body['attachment']
      form_data  = response.body['form'].merge(file: Faraday::UploadIO.new(file, params[:type]))

      s3_response = send_s3_request(:post, attachment['endpoint'], form_data)
      return s3_response unless s3_response.status == 204

      response.body.delete('form')
      response
    end
beta