stackone_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/stackone/accounts.rb +224 -0
- data/lib/stackone/ats.rb +1289 -0
- data/lib/stackone/connect_sessions.rb +100 -0
- data/lib/stackone/connectors.rb +98 -0
- data/lib/stackone/crm.rb +323 -0
- data/lib/stackone/hris.rb +682 -0
- data/lib/stackone/marketing.rb +584 -0
- data/lib/stackone/models/operations/ats_create_application.rb +53 -0
- data/lib/stackone/models/operations/ats_create_candidate.rb +53 -0
- data/lib/stackone/models/operations/ats_create_candidate_note.rb +56 -0
- data/lib/stackone/models/operations/ats_create_offer.rb +53 -0
- data/lib/stackone/models/operations/ats_get_application.rb +88 -0
- data/lib/stackone/models/operations/ats_get_application_offer.rb +91 -0
- data/lib/stackone/models/operations/ats_get_application_scorecard.rb +91 -0
- data/lib/stackone/models/operations/ats_get_candidate.rb +88 -0
- data/lib/stackone/models/operations/ats_get_candidate_note.rb +91 -0
- data/lib/stackone/models/operations/ats_get_department.rb +88 -0
- data/lib/stackone/models/operations/ats_get_interview.rb +88 -0
- data/lib/stackone/models/operations/ats_get_interview_stage.rb +88 -0
- data/lib/stackone/models/operations/ats_get_job.rb +88 -0
- data/lib/stackone/models/operations/ats_get_job_posting.rb +91 -0
- data/lib/stackone/models/operations/ats_get_location.rb +88 -0
- data/lib/stackone/models/operations/ats_get_offer.rb +88 -0
- data/lib/stackone/models/operations/ats_get_rejected_reason.rb +88 -0
- data/lib/stackone/models/operations/ats_get_user.rb +88 -0
- data/lib/stackone/models/operations/ats_list_application_scorecards.rb +88 -0
- data/lib/stackone/models/operations/ats_list_applications.rb +85 -0
- data/lib/stackone/models/operations/ats_list_applications_offers.rb +88 -0
- data/lib/stackone/models/operations/ats_list_candidate_notes.rb +88 -0
- data/lib/stackone/models/operations/ats_list_candidates.rb +85 -0
- data/lib/stackone/models/operations/ats_list_departments.rb +85 -0
- data/lib/stackone/models/operations/ats_list_interview_stages.rb +85 -0
- data/lib/stackone/models/operations/ats_list_interviews.rb +85 -0
- data/lib/stackone/models/operations/ats_list_job_postings.rb +88 -0
- data/lib/stackone/models/operations/ats_list_jobs.rb +85 -0
- data/lib/stackone/models/operations/ats_list_locations.rb +85 -0
- data/lib/stackone/models/operations/ats_list_offers.rb +85 -0
- data/lib/stackone/models/operations/ats_list_rejected_reasons.rb +85 -0
- data/lib/stackone/models/operations/ats_list_users.rb +85 -0
- data/lib/stackone/models/operations/ats_update_application.rb +56 -0
- data/lib/stackone/models/operations/ats_update_candidate.rb +56 -0
- data/lib/stackone/models/operations/crm_create_contact.rb +53 -0
- data/lib/stackone/models/operations/crm_get_account.rb +88 -0
- data/lib/stackone/models/operations/crm_get_contact.rb +88 -0
- data/lib/stackone/models/operations/crm_get_list.rb +88 -0
- data/lib/stackone/models/operations/crm_list_accounts.rb +85 -0
- data/lib/stackone/models/operations/crm_list_contacts.rb +85 -0
- data/lib/stackone/models/operations/crm_list_lists.rb +85 -0
- data/lib/stackone/models/operations/crm_update_contact.rb +56 -0
- data/lib/stackone/models/operations/hris_create_employee.rb +53 -0
- data/lib/stackone/models/operations/hris_create_employee_time_off_request.rb +56 -0
- data/lib/stackone/models/operations/hris_create_time_off_request.rb +53 -0
- data/lib/stackone/models/operations/hris_get_company.rb +88 -0
- data/lib/stackone/models/operations/hris_get_employee.rb +94 -0
- data/lib/stackone/models/operations/hris_get_employees_time_off_request.rb +91 -0
- data/lib/stackone/models/operations/hris_get_employment.rb +88 -0
- data/lib/stackone/models/operations/hris_get_location.rb +88 -0
- data/lib/stackone/models/operations/hris_get_time_off_request.rb +88 -0
- data/lib/stackone/models/operations/hris_list_companies.rb +85 -0
- data/lib/stackone/models/operations/hris_list_employee_time_off_requests.rb +88 -0
- data/lib/stackone/models/operations/hris_list_employees.rb +91 -0
- data/lib/stackone/models/operations/hris_list_employments.rb +85 -0
- data/lib/stackone/models/operations/hris_list_locations.rb +85 -0
- data/lib/stackone/models/operations/hris_list_time_off_requests.rb +85 -0
- data/lib/stackone/models/operations/hris_update_employee.rb +56 -0
- data/lib/stackone/models/operations/hris_update_time_off_request.rb +56 -0
- data/lib/stackone/models/operations/marketing_create_email_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_create_omni_channel_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_create_push_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_get_campaign.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_email_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_omni_channel_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_push_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_list_campaigns.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_email_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_omni_channel_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_push_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_update_email_template.rb +56 -0
- data/lib/stackone/models/operations/marketing_update_omni_channel_template.rb +56 -0
- data/lib/stackone/models/operations/marketing_update_push_template.rb +56 -0
- data/lib/stackone/models/operations/stackone_authenticate_connect_session.rb +35 -0
- data/lib/stackone/models/operations/stackone_create_connect_session.rb +35 -0
- data/lib/stackone/models/operations/stackone_delete_account.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_account.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_account_meta_info.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_connector_meta.rb +52 -0
- data/lib/stackone/models/operations/stackone_list_connectors_meta.rb +48 -0
- data/lib/stackone/models/operations/stackone_list_linked_accounts.rb +51 -0
- data/lib/stackone/models/operations/stackone_proxy_request.rb +49 -0
- data/lib/stackone/models/operations/stackone_update_account.rb +53 -0
- data/lib/stackone/models/shared/account.rb +55 -0
- data/lib/stackone/models/shared/accountaddress.rb +342 -0
- data/lib/stackone/models/shared/accountresult.rb +29 -0
- data/lib/stackone/models/shared/accountspaginated.rb +34 -0
- data/lib/stackone/models/shared/answer.rb +64 -0
- data/lib/stackone/models/shared/application.rb +75 -0
- data/lib/stackone/models/shared/applicationattachment.rb +63 -0
- data/lib/stackone/models/shared/applicationcandidate.rb +31 -0
- data/lib/stackone/models/shared/applicationresult.rb +29 -0
- data/lib/stackone/models/shared/applicationspaginated.rb +34 -0
- data/lib/stackone/models/shared/applicationstatusenumapimodel.rb +50 -0
- data/lib/stackone/models/shared/atscreateapplicationrequestdto.rb +45 -0
- data/lib/stackone/models/shared/atscreatecandidaterequestdto.rb +46 -0
- data/lib/stackone/models/shared/atscreatenotesrequestdto.rb +57 -0
- data/lib/stackone/models/shared/atscreateofferrequestdto.rb +41 -0
- data/lib/stackone/models/shared/atslocation.rb +28 -0
- data/lib/stackone/models/shared/atslocationresult.rb +29 -0
- data/lib/stackone/models/shared/atslocationspaginated.rb +34 -0
- data/lib/stackone/models/shared/atsupdateapplicationrequestdto.rb +48 -0
- data/lib/stackone/models/shared/atsupdatecandidatesrequestdto.rb +49 -0
- data/lib/stackone/models/shared/attachmenttype.rb +40 -0
- data/lib/stackone/models/shared/campaign.rb +120 -0
- data/lib/stackone/models/shared/campaignresult.rb +29 -0
- data/lib/stackone/models/shared/campaignspaginated.rb +34 -0
- data/lib/stackone/models/shared/candidate.rb +64 -0
- data/lib/stackone/models/shared/candidateemail.rb +28 -0
- data/lib/stackone/models/shared/candidateresult.rb +29 -0
- data/lib/stackone/models/shared/candidatespaginated.rb +34 -0
- data/lib/stackone/models/shared/channelsenum.rb +42 -0
- data/lib/stackone/models/shared/companiespaginated.rb +34 -0
- data/lib/stackone/models/shared/company.rb +37 -0
- data/lib/stackone/models/shared/companyresult.rb +29 -0
- data/lib/stackone/models/shared/compensation.rb +149 -0
- data/lib/stackone/models/shared/connectorsmeta.rb +73 -0
- data/lib/stackone/models/shared/connectsession.rb +68 -0
- data/lib/stackone/models/shared/connectsessionauthenticate.rb +25 -0
- data/lib/stackone/models/shared/connectsessioncreate.rb +72 -0
- data/lib/stackone/models/shared/connectsessiontoken.rb +71 -0
- data/lib/stackone/models/shared/contact.rb +52 -0
- data/lib/stackone/models/shared/contactresult.rb +29 -0
- data/lib/stackone/models/shared/contactspaginated.rb +34 -0
- data/lib/stackone/models/shared/countrycodeenum.rb +284 -0
- data/lib/stackone/models/shared/createcandidatenoteresult.rb +31 -0
- data/lib/stackone/models/shared/createemployeeresult.rb +31 -0
- data/lib/stackone/models/shared/createofferresult.rb +31 -0
- data/lib/stackone/models/shared/createresult.rb +31 -0
- data/lib/stackone/models/shared/createtemplateresult.rb +31 -0
- data/lib/stackone/models/shared/createtimeoffresult.rb +31 -0
- data/lib/stackone/models/shared/crmcreatecontactrequestdto.rb +43 -0
- data/lib/stackone/models/shared/department.rb +28 -0
- data/lib/stackone/models/shared/departmentresult.rb +29 -0
- data/lib/stackone/models/shared/departmentspaginated.rb +34 -0
- data/lib/stackone/models/shared/emailmessages.rb +93 -0
- data/lib/stackone/models/shared/employee.rb +1035 -0
- data/lib/stackone/models/shared/employeecustomfields.rb +83 -0
- data/lib/stackone/models/shared/employeeresult.rb +29 -0
- data/lib/stackone/models/shared/employeespaginated.rb +34 -0
- data/lib/stackone/models/shared/employment.rb +191 -0
- data/lib/stackone/models/shared/employmentresult.rb +29 -0
- data/lib/stackone/models/shared/employmentspaginated.rb +34 -0
- data/lib/stackone/models/shared/field.rb +56 -0
- data/lib/stackone/models/shared/hiringteam.rb +37 -0
- data/lib/stackone/models/shared/hriscreateemployeerequestdto.rb +8638 -0
- data/lib/stackone/models/shared/hriscreatetimeoffrequestdto.rb +93 -0
- data/lib/stackone/models/shared/hrislocation.rb +361 -0
- data/lib/stackone/models/shared/hrislocationresult.rb +29 -0
- data/lib/stackone/models/shared/hrislocationspaginated.rb +34 -0
- data/lib/stackone/models/shared/interview.rb +91 -0
- data/lib/stackone/models/shared/interviewer.rb +37 -0
- data/lib/stackone/models/shared/interviewpart.rb +40 -0
- data/lib/stackone/models/shared/interviewspaginated.rb +34 -0
- data/lib/stackone/models/shared/interviewsresult.rb +29 -0
- data/lib/stackone/models/shared/interviewstage.rb +37 -0
- data/lib/stackone/models/shared/interviewstageresult.rb +29 -0
- data/lib/stackone/models/shared/interviewstagespaginated.rb +34 -0
- data/lib/stackone/models/shared/job.rb +65 -0
- data/lib/stackone/models/shared/jobposting.rb +182 -0
- data/lib/stackone/models/shared/jobpostingresult.rb +29 -0
- data/lib/stackone/models/shared/jobpostingspaginated.rb +34 -0
- data/lib/stackone/models/shared/jobresult.rb +29 -0
- data/lib/stackone/models/shared/jobspaginated.rb +34 -0
- data/lib/stackone/models/shared/jobstatusenum.rb +43 -0
- data/lib/stackone/models/shared/linkedaccount.rb +75 -0
- data/lib/stackone/models/shared/linkedaccountmeta.rb +54 -0
- data/lib/stackone/models/shared/list.rb +67 -0
- data/lib/stackone/models/shared/listresult.rb +29 -0
- data/lib/stackone/models/shared/listspaginated.rb +34 -0
- data/lib/stackone/models/shared/location.rb +28 -0
- data/lib/stackone/models/shared/marketingcreateemailtemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/marketingcreatepushtemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/marketingcreatetemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/message.rb +50 -0
- data/lib/stackone/models/shared/note.rb +69 -0
- data/lib/stackone/models/shared/notecontentapimodel.rb +25 -0
- data/lib/stackone/models/shared/noteresult.rb +29 -0
- data/lib/stackone/models/shared/notespaginated.rb +34 -0
- data/lib/stackone/models/shared/offer.rb +50 -0
- data/lib/stackone/models/shared/offerhistory.rb +37 -0
- data/lib/stackone/models/shared/offerspaginated.rb +34 -0
- data/lib/stackone/models/shared/offersresult.rb +29 -0
- data/lib/stackone/models/shared/offerstatusenum.rb +43 -0
- data/lib/stackone/models/shared/patchaccountdto.rb +21 -0
- data/lib/stackone/models/shared/proxyrequestbody.rb +69 -0
- data/lib/stackone/models/shared/pushmessages.rb +81 -0
- data/lib/stackone/models/shared/questionnaire.rb +28 -0
- data/lib/stackone/models/shared/rawresponse.rb +44 -0
- data/lib/stackone/models/shared/rejectedreason.rb +32 -0
- data/lib/stackone/models/shared/rejectedreasonresult.rb +29 -0
- data/lib/stackone/models/shared/rejectedreasonspaginated.rb +34 -0
- data/lib/stackone/models/shared/rejectedreasontypeenum.rb +40 -0
- data/lib/stackone/models/shared/resultlink.rb +28 -0
- data/lib/stackone/models/shared/scorecard.rb +65 -0
- data/lib/stackone/models/shared/scorecardsection.rb +31 -0
- data/lib/stackone/models/shared/scorecardspaginated.rb +34 -0
- data/lib/stackone/models/shared/security.rb +28 -0
- data/lib/stackone/models/shared/sociallink.rb +28 -0
- data/lib/stackone/models/shared/template.rb +37 -0
- data/lib/stackone/models/shared/templateresult.rb +29 -0
- data/lib/stackone/models/shared/templatespaginated.rb +34 -0
- data/lib/stackone/models/shared/timeoff.rb +102 -0
- data/lib/stackone/models/shared/timeoffpaginated.rb +34 -0
- data/lib/stackone/models/shared/timeoffresult.rb +29 -0
- data/lib/stackone/models/shared/updateresult.rb +31 -0
- data/lib/stackone/models/shared/user.rb +40 -0
- data/lib/stackone/models/shared/userresult.rb +29 -0
- data/lib/stackone/models/shared/userspaginated.rb +34 -0
- data/lib/stackone/proxy.rb +59 -0
- data/lib/stackone/sdk.rb +87 -0
- data/lib/stackone/sdkconfiguration.rb +53 -0
- data/lib/stackone/utils/metadata_fields.rb +154 -0
- data/lib/stackone/utils/utils.rb +774 -0
- data/lib/stackone_client.rb +229 -0
- metadata +393 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module StackOne
|
11
|
+
extend T::Sig
|
12
|
+
class ConnectSessions
|
13
|
+
|
14
|
+
extend T::Sig
|
15
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
16
|
+
def initialize(sdk_config)
|
17
|
+
@sdk_configuration = sdk_config
|
18
|
+
end
|
19
|
+
|
20
|
+
sig { params(request: Shared::ConnectSessionAuthenticate).returns(Utils::FieldAugmented) }
|
21
|
+
def authenticate_connect_session(request)
|
22
|
+
# authenticate_connect_session - Authenticate Connect Session
|
23
|
+
url, params = @sdk_configuration.get_server_details
|
24
|
+
base_url = Utils.template_url(url, params)
|
25
|
+
url = "#{base_url}/connect_sessions/authenticate"
|
26
|
+
headers = {}
|
27
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
28
|
+
headers['content-type'] = req_content_type
|
29
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
30
|
+
headers['Accept'] = 'application/json'
|
31
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
32
|
+
|
33
|
+
r = @sdk_configuration.client.post(url) do |req|
|
34
|
+
req.headers = headers
|
35
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
36
|
+
if form
|
37
|
+
req.body = Utils.encode_form(form)
|
38
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
39
|
+
req.body = URI.encode_www_form(data)
|
40
|
+
else
|
41
|
+
req.body = data
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
46
|
+
|
47
|
+
res = Operations::StackoneAuthenticateConnectSessionResponse.new(
|
48
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
49
|
+
)
|
50
|
+
if r.status == 201
|
51
|
+
if Utils.match_content_type(content_type, 'application/json')
|
52
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ConnectSession)
|
53
|
+
res.connect_session = out
|
54
|
+
end
|
55
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
56
|
+
end
|
57
|
+
res
|
58
|
+
end
|
59
|
+
|
60
|
+
sig { params(request: Shared::ConnectSessionCreate).returns(Utils::FieldAugmented) }
|
61
|
+
def create_connect_session(request)
|
62
|
+
# create_connect_session - Create Connect Session
|
63
|
+
url, params = @sdk_configuration.get_server_details
|
64
|
+
base_url = Utils.template_url(url, params)
|
65
|
+
url = "#{base_url}/connect_sessions"
|
66
|
+
headers = {}
|
67
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
68
|
+
headers['content-type'] = req_content_type
|
69
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
70
|
+
headers['Accept'] = 'application/json'
|
71
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
72
|
+
|
73
|
+
r = @sdk_configuration.client.post(url) do |req|
|
74
|
+
req.headers = headers
|
75
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
76
|
+
if form
|
77
|
+
req.body = Utils.encode_form(form)
|
78
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
79
|
+
req.body = URI.encode_www_form(data)
|
80
|
+
else
|
81
|
+
req.body = data
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
86
|
+
|
87
|
+
res = Operations::StackoneCreateConnectSessionResponse.new(
|
88
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
89
|
+
)
|
90
|
+
if r.status == 201
|
91
|
+
if Utils.match_content_type(content_type, 'application/json')
|
92
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ConnectSessionToken)
|
93
|
+
res.connect_session_token = out
|
94
|
+
end
|
95
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
96
|
+
end
|
97
|
+
res
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module StackOne
|
11
|
+
extend T::Sig
|
12
|
+
class Connectors
|
13
|
+
|
14
|
+
extend T::Sig
|
15
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
16
|
+
def initialize(sdk_config)
|
17
|
+
@sdk_configuration = sdk_config
|
18
|
+
end
|
19
|
+
|
20
|
+
sig { params(provider: String, include: T.nilable(String)).returns(Utils::FieldAugmented) }
|
21
|
+
def get_connector_meta(provider, include = nil)
|
22
|
+
# get_connector_meta - Get Connector Meta information for the given provider key
|
23
|
+
request = Operations::StackoneGetConnectorMetaRequest.new(
|
24
|
+
|
25
|
+
provider: provider,
|
26
|
+
include: include
|
27
|
+
)
|
28
|
+
url, params = @sdk_configuration.get_server_details
|
29
|
+
base_url = Utils.template_url(url, params)
|
30
|
+
url = Utils.generate_url(
|
31
|
+
Operations::StackoneGetConnectorMetaRequest,
|
32
|
+
base_url,
|
33
|
+
'/connectors/meta/{provider}',
|
34
|
+
request
|
35
|
+
)
|
36
|
+
headers = {}
|
37
|
+
query_params = Utils.get_query_params(Operations::StackoneGetConnectorMetaRequest, request)
|
38
|
+
headers['Accept'] = 'application/json'
|
39
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
40
|
+
|
41
|
+
r = @sdk_configuration.client.get(url) do |req|
|
42
|
+
req.headers = headers
|
43
|
+
req.params = query_params
|
44
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
45
|
+
end
|
46
|
+
|
47
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
48
|
+
|
49
|
+
res = Operations::StackoneGetConnectorMetaResponse.new(
|
50
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
51
|
+
)
|
52
|
+
if r.status == 200
|
53
|
+
if Utils.match_content_type(content_type, 'application/json')
|
54
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ConnectorsMeta)
|
55
|
+
res.connectors_meta = out
|
56
|
+
end
|
57
|
+
elsif [400, 403, 404, 429, 500, 501].include?(r.status)
|
58
|
+
end
|
59
|
+
res
|
60
|
+
end
|
61
|
+
|
62
|
+
sig { params(include: T.nilable(String)).returns(Utils::FieldAugmented) }
|
63
|
+
def list_connectors_meta(include = nil)
|
64
|
+
# list_connectors_meta - List Connectors Meta Information for all providers
|
65
|
+
request = Operations::StackoneListConnectorsMetaRequest.new(
|
66
|
+
|
67
|
+
include: include
|
68
|
+
)
|
69
|
+
url, params = @sdk_configuration.get_server_details
|
70
|
+
base_url = Utils.template_url(url, params)
|
71
|
+
url = "#{base_url}/connectors/meta"
|
72
|
+
headers = {}
|
73
|
+
query_params = Utils.get_query_params(Operations::StackoneListConnectorsMetaRequest, request)
|
74
|
+
headers['Accept'] = 'application/json'
|
75
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
76
|
+
|
77
|
+
r = @sdk_configuration.client.get(url) do |req|
|
78
|
+
req.headers = headers
|
79
|
+
req.params = query_params
|
80
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
81
|
+
end
|
82
|
+
|
83
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
84
|
+
|
85
|
+
res = Operations::StackoneListConnectorsMetaResponse.new(
|
86
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
87
|
+
)
|
88
|
+
if r.status == 200
|
89
|
+
if Utils.match_content_type(content_type, 'application/json')
|
90
|
+
out = Utils.unmarshal_complex(r.env.response_body, T::Array[Shared::ConnectorsMeta])
|
91
|
+
res.connectors_metas = out
|
92
|
+
end
|
93
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
94
|
+
end
|
95
|
+
res
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/lib/stackone/crm.rb
ADDED
@@ -0,0 +1,323 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module StackOne
|
11
|
+
extend T::Sig
|
12
|
+
class Crm
|
13
|
+
|
14
|
+
extend T::Sig
|
15
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
16
|
+
def initialize(sdk_config)
|
17
|
+
@sdk_configuration = sdk_config
|
18
|
+
end
|
19
|
+
|
20
|
+
sig { params(crm_create_contact_request_dto: Shared::CrmCreateContactRequestDto, x_account_id: String).returns(Utils::FieldAugmented) }
|
21
|
+
def create_contact(crm_create_contact_request_dto, x_account_id)
|
22
|
+
# create_contact - Creates a new Contact
|
23
|
+
request = Operations::CrmCreateContactRequest.new(
|
24
|
+
|
25
|
+
crm_create_contact_request_dto: crm_create_contact_request_dto,
|
26
|
+
x_account_id: x_account_id
|
27
|
+
)
|
28
|
+
url, params = @sdk_configuration.get_server_details
|
29
|
+
base_url = Utils.template_url(url, params)
|
30
|
+
url = "#{base_url}/unified/crm/contacts"
|
31
|
+
headers = Utils.get_headers(request)
|
32
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_request_dto, :json)
|
33
|
+
headers['content-type'] = req_content_type
|
34
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
35
|
+
headers['Accept'] = 'application/json'
|
36
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
37
|
+
|
38
|
+
r = @sdk_configuration.client.post(url) do |req|
|
39
|
+
req.headers = headers
|
40
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
41
|
+
if form
|
42
|
+
req.body = Utils.encode_form(form)
|
43
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
44
|
+
req.body = URI.encode_www_form(data)
|
45
|
+
else
|
46
|
+
req.body = data
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
51
|
+
|
52
|
+
res = Operations::CrmCreateContactResponse.new(
|
53
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
54
|
+
)
|
55
|
+
if r.status == 200
|
56
|
+
if Utils.match_content_type(content_type, 'application/json')
|
57
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ContactResult)
|
58
|
+
res.contact_result = out
|
59
|
+
end
|
60
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
61
|
+
end
|
62
|
+
res
|
63
|
+
end
|
64
|
+
|
65
|
+
sig { params(request: T.nilable(Operations::CrmGetAccountRequest)).returns(Utils::FieldAugmented) }
|
66
|
+
def get_account(request)
|
67
|
+
# get_account - Get Account
|
68
|
+
url, params = @sdk_configuration.get_server_details
|
69
|
+
base_url = Utils.template_url(url, params)
|
70
|
+
url = Utils.generate_url(
|
71
|
+
Operations::CrmGetAccountRequest,
|
72
|
+
base_url,
|
73
|
+
'/unified/crm/accounts/{id}',
|
74
|
+
request
|
75
|
+
)
|
76
|
+
headers = Utils.get_headers(request)
|
77
|
+
query_params = Utils.get_query_params(Operations::CrmGetAccountRequest, request)
|
78
|
+
headers['Accept'] = 'application/json'
|
79
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
80
|
+
|
81
|
+
r = @sdk_configuration.client.get(url) do |req|
|
82
|
+
req.headers = headers
|
83
|
+
req.params = query_params
|
84
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
85
|
+
end
|
86
|
+
|
87
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
88
|
+
|
89
|
+
res = Operations::CrmGetAccountResponse.new(
|
90
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
91
|
+
)
|
92
|
+
if r.status == 200
|
93
|
+
if Utils.match_content_type(content_type, 'application/json')
|
94
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::AccountResult)
|
95
|
+
res.account_result = out
|
96
|
+
end
|
97
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
98
|
+
end
|
99
|
+
res
|
100
|
+
end
|
101
|
+
|
102
|
+
sig { params(request: T.nilable(Operations::CrmGetContactRequest)).returns(Utils::FieldAugmented) }
|
103
|
+
def get_contact(request)
|
104
|
+
# get_contact - Get Contact
|
105
|
+
url, params = @sdk_configuration.get_server_details
|
106
|
+
base_url = Utils.template_url(url, params)
|
107
|
+
url = Utils.generate_url(
|
108
|
+
Operations::CrmGetContactRequest,
|
109
|
+
base_url,
|
110
|
+
'/unified/crm/contacts/{id}',
|
111
|
+
request
|
112
|
+
)
|
113
|
+
headers = Utils.get_headers(request)
|
114
|
+
query_params = Utils.get_query_params(Operations::CrmGetContactRequest, request)
|
115
|
+
headers['Accept'] = 'application/json'
|
116
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
117
|
+
|
118
|
+
r = @sdk_configuration.client.get(url) do |req|
|
119
|
+
req.headers = headers
|
120
|
+
req.params = query_params
|
121
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
122
|
+
end
|
123
|
+
|
124
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
125
|
+
|
126
|
+
res = Operations::CrmGetContactResponse.new(
|
127
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
128
|
+
)
|
129
|
+
if r.status == 200
|
130
|
+
if Utils.match_content_type(content_type, 'application/json')
|
131
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ContactResult)
|
132
|
+
res.contact_result = out
|
133
|
+
end
|
134
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
135
|
+
end
|
136
|
+
res
|
137
|
+
end
|
138
|
+
|
139
|
+
sig { params(request: T.nilable(Operations::CrmGetListRequest)).returns(Utils::FieldAugmented) }
|
140
|
+
def get_list(request)
|
141
|
+
# get_list - Get List
|
142
|
+
url, params = @sdk_configuration.get_server_details
|
143
|
+
base_url = Utils.template_url(url, params)
|
144
|
+
url = Utils.generate_url(
|
145
|
+
Operations::CrmGetListRequest,
|
146
|
+
base_url,
|
147
|
+
'/unified/crm/lists/{id}',
|
148
|
+
request
|
149
|
+
)
|
150
|
+
headers = Utils.get_headers(request)
|
151
|
+
query_params = Utils.get_query_params(Operations::CrmGetListRequest, request)
|
152
|
+
headers['Accept'] = 'application/json'
|
153
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
154
|
+
|
155
|
+
r = @sdk_configuration.client.get(url) do |req|
|
156
|
+
req.headers = headers
|
157
|
+
req.params = query_params
|
158
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
159
|
+
end
|
160
|
+
|
161
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
162
|
+
|
163
|
+
res = Operations::CrmGetListResponse.new(
|
164
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
165
|
+
)
|
166
|
+
if r.status == 200
|
167
|
+
if Utils.match_content_type(content_type, 'application/json')
|
168
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ListResult)
|
169
|
+
res.list_result = out
|
170
|
+
end
|
171
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
172
|
+
end
|
173
|
+
res
|
174
|
+
end
|
175
|
+
|
176
|
+
sig { params(request: T.nilable(Operations::CrmListAccountsRequest)).returns(Utils::FieldAugmented) }
|
177
|
+
def list_accounts(request)
|
178
|
+
# list_accounts - List Accounts
|
179
|
+
url, params = @sdk_configuration.get_server_details
|
180
|
+
base_url = Utils.template_url(url, params)
|
181
|
+
url = "#{base_url}/unified/crm/accounts"
|
182
|
+
headers = Utils.get_headers(request)
|
183
|
+
query_params = Utils.get_query_params(Operations::CrmListAccountsRequest, request)
|
184
|
+
headers['Accept'] = 'application/json'
|
185
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
186
|
+
|
187
|
+
r = @sdk_configuration.client.get(url) do |req|
|
188
|
+
req.headers = headers
|
189
|
+
req.params = query_params
|
190
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
191
|
+
end
|
192
|
+
|
193
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
194
|
+
|
195
|
+
res = Operations::CrmListAccountsResponse.new(
|
196
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
197
|
+
)
|
198
|
+
if r.status == 200
|
199
|
+
if Utils.match_content_type(content_type, 'application/json')
|
200
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::AccountsPaginated)
|
201
|
+
res.accounts_paginated = out
|
202
|
+
end
|
203
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
204
|
+
end
|
205
|
+
res
|
206
|
+
end
|
207
|
+
|
208
|
+
sig { params(request: T.nilable(Operations::CrmListContactsRequest)).returns(Utils::FieldAugmented) }
|
209
|
+
def list_contacts(request)
|
210
|
+
# list_contacts - List Contacts
|
211
|
+
url, params = @sdk_configuration.get_server_details
|
212
|
+
base_url = Utils.template_url(url, params)
|
213
|
+
url = "#{base_url}/unified/crm/contacts"
|
214
|
+
headers = Utils.get_headers(request)
|
215
|
+
query_params = Utils.get_query_params(Operations::CrmListContactsRequest, request)
|
216
|
+
headers['Accept'] = 'application/json'
|
217
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
218
|
+
|
219
|
+
r = @sdk_configuration.client.get(url) do |req|
|
220
|
+
req.headers = headers
|
221
|
+
req.params = query_params
|
222
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
223
|
+
end
|
224
|
+
|
225
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
226
|
+
|
227
|
+
res = Operations::CrmListContactsResponse.new(
|
228
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
229
|
+
)
|
230
|
+
if r.status == 200
|
231
|
+
if Utils.match_content_type(content_type, 'application/json')
|
232
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ContactsPaginated)
|
233
|
+
res.contacts_paginated = out
|
234
|
+
end
|
235
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
236
|
+
end
|
237
|
+
res
|
238
|
+
end
|
239
|
+
|
240
|
+
sig { params(request: T.nilable(Operations::CrmListListsRequest)).returns(Utils::FieldAugmented) }
|
241
|
+
def list_lists(request)
|
242
|
+
# list_lists - Get all Lists
|
243
|
+
url, params = @sdk_configuration.get_server_details
|
244
|
+
base_url = Utils.template_url(url, params)
|
245
|
+
url = "#{base_url}/unified/crm/lists"
|
246
|
+
headers = Utils.get_headers(request)
|
247
|
+
query_params = Utils.get_query_params(Operations::CrmListListsRequest, request)
|
248
|
+
headers['Accept'] = 'application/json'
|
249
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
250
|
+
|
251
|
+
r = @sdk_configuration.client.get(url) do |req|
|
252
|
+
req.headers = headers
|
253
|
+
req.params = query_params
|
254
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
255
|
+
end
|
256
|
+
|
257
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
258
|
+
|
259
|
+
res = Operations::CrmListListsResponse.new(
|
260
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
261
|
+
)
|
262
|
+
if r.status == 200
|
263
|
+
if Utils.match_content_type(content_type, 'application/json')
|
264
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ListsPaginated)
|
265
|
+
res.lists_paginated = out
|
266
|
+
end
|
267
|
+
elsif [400, 403, 429, 500, 501].include?(r.status)
|
268
|
+
end
|
269
|
+
res
|
270
|
+
end
|
271
|
+
|
272
|
+
sig { params(crm_create_contact_request_dto: Shared::CrmCreateContactRequestDto, id: String, x_account_id: String).returns(Utils::FieldAugmented) }
|
273
|
+
def update_contact(crm_create_contact_request_dto, id, x_account_id)
|
274
|
+
# update_contact - Update Contact (early access)
|
275
|
+
request = Operations::CrmUpdateContactRequest.new(
|
276
|
+
|
277
|
+
crm_create_contact_request_dto: crm_create_contact_request_dto,
|
278
|
+
id: id,
|
279
|
+
x_account_id: x_account_id
|
280
|
+
)
|
281
|
+
url, params = @sdk_configuration.get_server_details
|
282
|
+
base_url = Utils.template_url(url, params)
|
283
|
+
url = Utils.generate_url(
|
284
|
+
Operations::CrmUpdateContactRequest,
|
285
|
+
base_url,
|
286
|
+
'/unified/crm/contacts/{id}',
|
287
|
+
request
|
288
|
+
)
|
289
|
+
headers = Utils.get_headers(request)
|
290
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :crm_create_contact_request_dto, :json)
|
291
|
+
headers['content-type'] = req_content_type
|
292
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
293
|
+
headers['Accept'] = 'application/json'
|
294
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
295
|
+
|
296
|
+
r = @sdk_configuration.client.patch(url) do |req|
|
297
|
+
req.headers = headers
|
298
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
299
|
+
if form
|
300
|
+
req.body = Utils.encode_form(form)
|
301
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
302
|
+
req.body = URI.encode_www_form(data)
|
303
|
+
else
|
304
|
+
req.body = data
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
309
|
+
|
310
|
+
res = Operations::CrmUpdateContactResponse.new(
|
311
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
312
|
+
)
|
313
|
+
if r.status == 200
|
314
|
+
if Utils.match_content_type(content_type, 'application/json')
|
315
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::ContactResult)
|
316
|
+
res.contact_result = out
|
317
|
+
end
|
318
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
319
|
+
end
|
320
|
+
res
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|