# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. # typed: true # frozen_string_literal: true require 'faraday' require 'faraday/multipart' require 'sorbet-runtime' module OpenApiSDK extend T::Sig class Panora extend T::Sig attr_accessor :rag_query, :filestorage_files, :auth_login, :connections, :webhooks, :ticketing_tickets, :ticketing_users, :ticketing_accounts, :ticketing_contacts, :sync, :crm_companies, :crm_contacts, :crm_deals, :crm_engagements, :crm_notes, :crm_stages, :crm_tasks, :crm_users, :ticketing_collections, :ticketing_comments, :ticketing_tags, :ticketing_teams, :linked_users, :projects, :field_mappings, :events, :passthrough, :passthrough_retryid, :hris_bankinfos, :hris_benefits, :hris_companies, :hris_dependents, :hris_employeepayrollruns, :hris_employees, :hris_employerbenefits, :hris_employments, :hris_groups, :hris_locations, :hris_paygroups, :hris_payrollruns, :hris_timeoffs, :hris_timeoffbalances, :hris_timesheetentries, :marketingautomation_actions, :marketingautomation_automations, :marketingautomation_campaigns, :marketingautomation_contacts, :marketingautomation_emails, :marketingautomation_events, :marketingautomation_lists, :marketingautomation_messages, :marketingautomation_templates, :marketingautomation_users, :ats_activities, :ats_applications, :ats_attachments, :ats_candidates, :ats_departments, :ats_interviews, :ats_jobinterviewstages, :ats_jobs, :ats_offers, :ats_offices, :ats_rejectreasons, :ats_scorecards, :ats_tags, :ats_users, :ats_eeocs, :accounting_accounts, :accounting_addresses, :accounting_attachments, :accounting_balancesheets, :accounting_cashflowstatements, :accounting_companyinfos, :accounting_contacts, :accounting_creditnotes, :accounting_expenses, :accounting_incomestatements, :accounting_invoices, :accounting_items, :accounting_journalentries, :accounting_payments, :accounting_phonenumbers, :accounting_purchaseorders, :accounting_taxrates, :accounting_trackingcategories, :accounting_transactions, :accounting_vendorcredits, :filestorage_folders, :filestorage_groups, :filestorage_users, :ecommerce_products, :ecommerce_orders, :ecommerce_customers, :ecommerce_fulfillments, :ticketing_attachments sig do params(client: Faraday::Request, security: T.nilable(Shared::Security), server_idx: Integer, server_url: String, url_params: T::Hash[Symbol, String]).void end def initialize(client: nil, security: nil, server_idx: nil, server_url: nil, url_params: nil) ## Instantiates the SDK configuring it with the provided parameters. # @param [Faraday::Request] client The faraday HTTP client to use for all operations # @param [Shared::Security] security The security details required for authentication # @param [::Integer] server_idx The index of the server to use for all operations # @param [::String] server_url The server URL to use for all operations # @param [::Hash<::Symbol, ::String>] url_params Parameters to optionally template the server URL with if client.nil? client = Faraday.new(request: { params_encoder: Faraday::FlatParamsEncoder }) do |f| f.request :multipart, {} # f.response :logger end end if !server_url.nil? if !url_params.nil? server_url = Utils.template_url(server_url, url_params) end end server_idx = 0 if server_idx.nil? @sdk_configuration = SDKConfiguration.new(client, security, server_url, server_idx) init_sdks end sig { params(server_url: String).void } def config_server_url(server_url) @sdk_configuration.server_url = server_url init_sdks end sig { params(server_idx: Integer).void } def config_server(server_idx) raise StandardError, "Invalid server index #{server_idx}" if server_idx.negative? || server_idx >= SERVERS.length @sdk_configuration.server_idx = server_idx init_sdks end sig { params(security: ::OpenApiSDK::Shared::Security).void } def config_security(security) @sdk_configuration.security = security end sig { void } def init_sdks @rag_query = RagQuery.new(@sdk_configuration) @filestorage_files = FilestorageFiles.new(@sdk_configuration) @auth_login = AuthLogin.new(@sdk_configuration) @connections = Connections.new(@sdk_configuration) @webhooks = Webhooks.new(@sdk_configuration) @ticketing_tickets = TicketingTickets.new(@sdk_configuration) @ticketing_users = TicketingUsers.new(@sdk_configuration) @ticketing_accounts = TicketingAccounts.new(@sdk_configuration) @ticketing_contacts = TicketingContacts.new(@sdk_configuration) @sync = Sync.new(@sdk_configuration) @crm_companies = CrmCompanies.new(@sdk_configuration) @crm_contacts = CrmContacts.new(@sdk_configuration) @crm_deals = CrmDeals.new(@sdk_configuration) @crm_engagements = CrmEngagements.new(@sdk_configuration) @crm_notes = CrmNotes.new(@sdk_configuration) @crm_stages = CrmStages.new(@sdk_configuration) @crm_tasks = CrmTasks.new(@sdk_configuration) @crm_users = CrmUsers.new(@sdk_configuration) @ticketing_collections = TicketingCollections.new(@sdk_configuration) @ticketing_comments = TicketingComments.new(@sdk_configuration) @ticketing_tags = TicketingTags.new(@sdk_configuration) @ticketing_teams = TicketingTeams.new(@sdk_configuration) @linked_users = LinkedUsers.new(@sdk_configuration) @projects = Projects.new(@sdk_configuration) @field_mappings = FieldMappings.new(@sdk_configuration) @events = Events.new(@sdk_configuration) @passthrough = Passthrough.new(@sdk_configuration) @passthrough_retryid = PassthroughRetryid.new(@sdk_configuration) @hris_bankinfos = HrisBankinfos.new(@sdk_configuration) @hris_benefits = HrisBenefits.new(@sdk_configuration) @hris_companies = HrisCompanies.new(@sdk_configuration) @hris_dependents = HrisDependents.new(@sdk_configuration) @hris_employeepayrollruns = HrisEmployeepayrollruns.new(@sdk_configuration) @hris_employees = HrisEmployees.new(@sdk_configuration) @hris_employerbenefits = HrisEmployerbenefits.new(@sdk_configuration) @hris_employments = HrisEmployments.new(@sdk_configuration) @hris_groups = HrisGroups.new(@sdk_configuration) @hris_locations = HrisLocations.new(@sdk_configuration) @hris_paygroups = HrisPaygroups.new(@sdk_configuration) @hris_payrollruns = HrisPayrollruns.new(@sdk_configuration) @hris_timeoffs = HrisTimeoffs.new(@sdk_configuration) @hris_timeoffbalances = HrisTimeoffbalances.new(@sdk_configuration) @hris_timesheetentries = HrisTimesheetentries.new(@sdk_configuration) @marketingautomation_actions = MarketingautomationActions.new(@sdk_configuration) @marketingautomation_automations = MarketingautomationAutomations.new(@sdk_configuration) @marketingautomation_campaigns = MarketingautomationCampaigns.new(@sdk_configuration) @marketingautomation_contacts = MarketingautomationContacts.new(@sdk_configuration) @marketingautomation_emails = MarketingautomationEmails.new(@sdk_configuration) @marketingautomation_events = MarketingautomationEvents.new(@sdk_configuration) @marketingautomation_lists = MarketingautomationLists.new(@sdk_configuration) @marketingautomation_messages = MarketingautomationMessages.new(@sdk_configuration) @marketingautomation_templates = MarketingautomationTemplates.new(@sdk_configuration) @marketingautomation_users = MarketingautomationUsers.new(@sdk_configuration) @ats_activities = AtsActivities.new(@sdk_configuration) @ats_applications = AtsApplications.new(@sdk_configuration) @ats_attachments = AtsAttachments.new(@sdk_configuration) @ats_candidates = AtsCandidates.new(@sdk_configuration) @ats_departments = AtsDepartments.new(@sdk_configuration) @ats_interviews = AtsInterviews.new(@sdk_configuration) @ats_jobinterviewstages = AtsJobinterviewstages.new(@sdk_configuration) @ats_jobs = AtsJobs.new(@sdk_configuration) @ats_offers = AtsOffers.new(@sdk_configuration) @ats_offices = AtsOffices.new(@sdk_configuration) @ats_rejectreasons = AtsRejectreasons.new(@sdk_configuration) @ats_scorecards = AtsScorecards.new(@sdk_configuration) @ats_tags = AtsTags.new(@sdk_configuration) @ats_users = AtsUsers.new(@sdk_configuration) @ats_eeocs = AtsEeocs.new(@sdk_configuration) @accounting_accounts = AccountingAccounts.new(@sdk_configuration) @accounting_addresses = AccountingAddresses.new(@sdk_configuration) @accounting_attachments = AccountingAttachments.new(@sdk_configuration) @accounting_balancesheets = AccountingBalancesheets.new(@sdk_configuration) @accounting_cashflowstatements = AccountingCashflowstatements.new(@sdk_configuration) @accounting_companyinfos = AccountingCompanyinfos.new(@sdk_configuration) @accounting_contacts = AccountingContacts.new(@sdk_configuration) @accounting_creditnotes = AccountingCreditnotes.new(@sdk_configuration) @accounting_expenses = AccountingExpenses.new(@sdk_configuration) @accounting_incomestatements = AccountingIncomestatements.new(@sdk_configuration) @accounting_invoices = AccountingInvoices.new(@sdk_configuration) @accounting_items = AccountingItems.new(@sdk_configuration) @accounting_journalentries = AccountingJournalentries.new(@sdk_configuration) @accounting_payments = AccountingPayments.new(@sdk_configuration) @accounting_phonenumbers = AccountingPhonenumbers.new(@sdk_configuration) @accounting_purchaseorders = AccountingPurchaseorders.new(@sdk_configuration) @accounting_taxrates = AccountingTaxrates.new(@sdk_configuration) @accounting_trackingcategories = AccountingTrackingcategories.new(@sdk_configuration) @accounting_transactions = AccountingTransactions.new(@sdk_configuration) @accounting_vendorcredits = AccountingVendorcredits.new(@sdk_configuration) @filestorage_folders = FilestorageFolders.new(@sdk_configuration) @filestorage_groups = FilestorageGroups.new(@sdk_configuration) @filestorage_users = FilestorageUsers.new(@sdk_configuration) @ecommerce_products = EcommerceProducts.new(@sdk_configuration) @ecommerce_orders = EcommerceOrders.new(@sdk_configuration) @ecommerce_customers = EcommerceCustomers.new(@sdk_configuration) @ecommerce_fulfillments = EcommerceFulfillments.new(@sdk_configuration) @ticketing_attachments = TicketingAttachments.new(@sdk_configuration) end sig { returns(::OpenApiSDK::Operations::HelloResponse) } def hello url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/" headers = {} headers['Accept'] = 'text/plain' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::OpenApiSDK::Operations::HelloResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 res.res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain') end res end sig { returns(::OpenApiSDK::Operations::HealthResponse) } def health url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/health" headers = {} headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::OpenApiSDK::Operations::HealthResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::Float) res.number = out end end res end end end