DealMakerAPI 0.90.0 → 0.90.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -4
  3. data/docs/CompanyApi.md +145 -0
  4. data/docs/DefaultApi.md +67 -0
  5. data/docs/PatchInvestorProfilesTrustsTrusteesInner.md +3 -1
  6. data/docs/PostInvestorProfilesTrustsTrusteesInner.md +3 -1
  7. data/docs/SendPortalInviteRequest.md +20 -0
  8. data/docs/UpdateUserPasswordRequest.md +18 -0
  9. data/docs/UserApi.md +143 -0
  10. data/docs/V1EntitiesInvestor.md +1 -1
  11. data/docs/V1EntitiesInvestorProfileFieldsTrustee.md +30 -0
  12. data/docs/V1EntitiesInvestorProfileTrust.md +1 -1
  13. data/docs/V1EntitiesPaymentsSelfServeOnboardingDigitalPaymentsConnectionData.md +18 -0
  14. data/docs/V1EntitiesUser.md +22 -0
  15. data/lib/DealMakerAPI/api/company_api.rb +140 -0
  16. data/lib/DealMakerAPI/api/default_api.rb +63 -0
  17. data/lib/DealMakerAPI/api/user_api.rb +159 -0
  18. data/lib/DealMakerAPI/api_client.rb +10 -11
  19. data/lib/DealMakerAPI/models/patch_investor_profiles_trusts_trustees_inner.rb +14 -4
  20. data/lib/DealMakerAPI/models/post_investor_profiles_trusts_trustees_inner.rb +14 -4
  21. data/lib/DealMakerAPI/models/send_portal_invite_request.rb +225 -0
  22. data/lib/DealMakerAPI/models/update_user_password_request.rb +222 -0
  23. data/lib/DealMakerAPI/models/v1_entities_investor.rb +13 -1
  24. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_trustee.rb +274 -0
  25. data/lib/DealMakerAPI/models/v1_entities_investor_profile_trust.rb +1 -1
  26. data/lib/DealMakerAPI/models/v1_entities_payments_self_serve_onboarding_digital_payments_connection_data.rb +216 -0
  27. data/lib/DealMakerAPI/models/v1_entities_user.rb +236 -0
  28. data/lib/DealMakerAPI/version.rb +1 -1
  29. data/lib/DealMakerAPI.rb +6 -0
  30. data/spec/api/company_api_spec.rb +28 -0
  31. data/spec/api/default_api_spec.rb +12 -0
  32. data/spec/api/user_api_spec.rb +60 -0
  33. data/spec/models/patch_investor_profiles_trusts_trustees_inner_spec.rb +6 -0
  34. data/spec/models/post_investor_profiles_trusts_trustees_inner_spec.rb +6 -0
  35. data/spec/models/send_portal_invite_request_spec.rb +42 -0
  36. data/spec/models/update_user_password_request_spec.rb +36 -0
  37. data/spec/models/v1_entities_investor_profile_fields_trustee_spec.rb +72 -0
  38. data/spec/models/v1_entities_investor_spec.rb +4 -0
  39. data/spec/models/v1_entities_payments_self_serve_onboarding_digital_payments_connection_data_spec.rb +36 -0
  40. data/spec/models/v1_entities_user_spec.rb +48 -0
  41. metadata +101 -77
@@ -800,5 +800,145 @@ module DealMakerAPI
800
800
  end
801
801
  return data, status_code, headers
802
802
  end
803
+
804
+ # Get list of all Companies accessible by the user
805
+ # Get user accessible companies
806
+ # @param [Hash] opts the optional parameters
807
+ # @option opts [Integer] :page Page offset to fetch. (default to 1)
808
+ # @option opts [Integer] :per_page Number of results to return per page. (default to 25)
809
+ # @option opts [Integer] :offset Pad a number of results. (default to 0)
810
+ # @return [V1EntitiesCompany]
811
+ def get_user_accessible_companies(opts = {})
812
+ data, _status_code, _headers = get_user_accessible_companies_with_http_info(opts)
813
+ data
814
+ end
815
+
816
+ # Get list of all Companies accessible by the user
817
+ # Get user accessible companies
818
+ # @param [Hash] opts the optional parameters
819
+ # @option opts [Integer] :page Page offset to fetch. (default to 1)
820
+ # @option opts [Integer] :per_page Number of results to return per page. (default to 25)
821
+ # @option opts [Integer] :offset Pad a number of results. (default to 0)
822
+ # @return [Array<(V1EntitiesCompany, Integer, Hash)>] V1EntitiesCompany data, response status code and response headers
823
+ def get_user_accessible_companies_with_http_info(opts = {})
824
+ if @api_client.config.debugging
825
+ @api_client.config.logger.debug 'Calling API: CompanyApi.get_user_accessible_companies ...'
826
+ end
827
+ # resource path
828
+ local_var_path = '/users/accessible_companies'
829
+
830
+ # query parameters
831
+ query_params = opts[:query_params] || {}
832
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
833
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
834
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
835
+
836
+ # header parameters
837
+ header_params = opts[:header_params] || {}
838
+ # HTTP header 'Accept' (if needed)
839
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
840
+
841
+ # form parameters
842
+ form_params = opts[:form_params] || {}
843
+
844
+ # http body (model)
845
+ post_body = opts[:debug_body]
846
+
847
+ # return_type
848
+ return_type = opts[:debug_return_type] || 'V1EntitiesCompany'
849
+
850
+ # auth_names
851
+ auth_names = opts[:debug_auth_names] || []
852
+
853
+ new_options = opts.merge(
854
+ :operation => :"CompanyApi.get_user_accessible_companies",
855
+ :header_params => header_params,
856
+ :query_params => query_params,
857
+ :form_params => form_params,
858
+ :body => post_body,
859
+ :auth_names => auth_names,
860
+ :return_type => return_type
861
+ )
862
+
863
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
864
+ if @api_client.config.debugging
865
+ @api_client.config.logger.debug "API called: CompanyApi#get_user_accessible_companies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
866
+ end
867
+ return data, status_code, headers
868
+ end
869
+
870
+ # Send portal invite to shareholder
871
+ # Send portal invite to shareholder.
872
+ # @param id [Integer]
873
+ # @param shareholder_id [Integer]
874
+ # @param [Hash] opts the optional parameters
875
+ # @option opts [SendPortalInviteRequest] :send_portal_invite_request
876
+ # @return [nil]
877
+ def send_portal_invite(id, shareholder_id, opts = {})
878
+ send_portal_invite_with_http_info(id, shareholder_id, opts)
879
+ nil
880
+ end
881
+
882
+ # Send portal invite to shareholder
883
+ # Send portal invite to shareholder.
884
+ # @param id [Integer]
885
+ # @param shareholder_id [Integer]
886
+ # @param [Hash] opts the optional parameters
887
+ # @option opts [SendPortalInviteRequest] :send_portal_invite_request
888
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
889
+ def send_portal_invite_with_http_info(id, shareholder_id, opts = {})
890
+ if @api_client.config.debugging
891
+ @api_client.config.logger.debug 'Calling API: CompanyApi.send_portal_invite ...'
892
+ end
893
+ # verify the required parameter 'id' is set
894
+ if @api_client.config.client_side_validation && id.nil?
895
+ fail ArgumentError, "Missing the required parameter 'id' when calling CompanyApi.send_portal_invite"
896
+ end
897
+ # verify the required parameter 'shareholder_id' is set
898
+ if @api_client.config.client_side_validation && shareholder_id.nil?
899
+ fail ArgumentError, "Missing the required parameter 'shareholder_id' when calling CompanyApi.send_portal_invite"
900
+ end
901
+ # resource path
902
+ local_var_path = '/companies/{id}/shareholders/{shareholder_id}/send_portal_invite'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'shareholder_id' + '}', CGI.escape(shareholder_id.to_s))
903
+
904
+ # query parameters
905
+ query_params = opts[:query_params] || {}
906
+
907
+ # header parameters
908
+ header_params = opts[:header_params] || {}
909
+ # HTTP header 'Content-Type'
910
+ content_type = @api_client.select_header_content_type(['application/json'])
911
+ if !content_type.nil?
912
+ header_params['Content-Type'] = content_type
913
+ end
914
+
915
+ # form parameters
916
+ form_params = opts[:form_params] || {}
917
+
918
+ # http body (model)
919
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'send_portal_invite_request'])
920
+
921
+ # return_type
922
+ return_type = opts[:debug_return_type]
923
+
924
+ # auth_names
925
+ auth_names = opts[:debug_auth_names] || []
926
+
927
+ new_options = opts.merge(
928
+ :operation => :"CompanyApi.send_portal_invite",
929
+ :header_params => header_params,
930
+ :query_params => query_params,
931
+ :form_params => form_params,
932
+ :body => post_body,
933
+ :auth_names => auth_names,
934
+ :return_type => return_type
935
+ )
936
+
937
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
938
+ if @api_client.config.debugging
939
+ @api_client.config.logger.debug "API called: CompanyApi#send_portal_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
940
+ end
941
+ return data, status_code, headers
942
+ end
803
943
  end
804
944
  end
@@ -19,6 +19,69 @@ module DealMakerAPI
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Load data for the digital payments connection stage
23
+ # Load data for the digital payments connection stage
24
+ # @param deal_id [Integer]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [V1EntitiesPaymentsSelfServeOnboardingDigitalPaymentsConnectionData]
27
+ def get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data(deal_id, opts = {})
28
+ data, _status_code, _headers = get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data_with_http_info(deal_id, opts)
29
+ data
30
+ end
31
+
32
+ # Load data for the digital payments connection stage
33
+ # Load data for the digital payments connection stage
34
+ # @param deal_id [Integer]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(V1EntitiesPaymentsSelfServeOnboardingDigitalPaymentsConnectionData, Integer, Hash)>] V1EntitiesPaymentsSelfServeOnboardingDigitalPaymentsConnectionData data, response status code and response headers
37
+ def get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data_with_http_info(deal_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data ...'
40
+ end
41
+ # verify the required parameter 'deal_id' is set
42
+ if @api_client.config.client_side_validation && deal_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'deal_id' when calling DefaultApi.get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data"
44
+ end
45
+ # resource path
46
+ local_var_path = '/deals/{deal_id}/payment_onboarding/questionnaire/digital_payments_connection/data'.sub('{' + 'deal_id' + '}', CGI.escape(deal_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'V1EntitiesPaymentsSelfServeOnboardingDigitalPaymentsConnectionData'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || []
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"DefaultApi.get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: DefaultApi#get_deals_deal_id_payment_onboarding_questionnaire_digital_payments_connection_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
22
85
  # Displays the express wire instructions for an investor on a deal
23
86
  # Get express wire instructions
24
87
  # @param id [Integer]
@@ -0,0 +1,159 @@
1
+ =begin
2
+ #DealMaker API
3
+
4
+ ## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor&#64;dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
5
+
6
+ The version of the OpenAPI document: 1.75.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module DealMakerAPI
16
+ class UserApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get user by User ID
23
+ # Get a single user using the User ID
24
+ # @param id [Integer]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [V1EntitiesUser]
27
+ def get_user(id, opts = {})
28
+ data, _status_code, _headers = get_user_with_http_info(id, opts)
29
+ data
30
+ end
31
+
32
+ # Get user by User ID
33
+ # Get a single user using the User ID
34
+ # @param id [Integer]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(V1EntitiesUser, Integer, Hash)>] V1EntitiesUser data, response status code and response headers
37
+ def get_user_with_http_info(id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: UserApi.get_user ...'
40
+ end
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling UserApi.get_user"
44
+ end
45
+ # resource path
46
+ local_var_path = '/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'V1EntitiesUser'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || []
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"UserApi.get_user",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: UserApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Update user password
86
+ # Update user password
87
+ # @param id [Integer]
88
+ # @param update_user_password_request [UpdateUserPasswordRequest]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [V1EntitiesUser]
91
+ def update_user_password(id, update_user_password_request, opts = {})
92
+ data, _status_code, _headers = update_user_password_with_http_info(id, update_user_password_request, opts)
93
+ data
94
+ end
95
+
96
+ # Update user password
97
+ # Update user password
98
+ # @param id [Integer]
99
+ # @param update_user_password_request [UpdateUserPasswordRequest]
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(V1EntitiesUser, Integer, Hash)>] V1EntitiesUser data, response status code and response headers
102
+ def update_user_password_with_http_info(id, update_user_password_request, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: UserApi.update_user_password ...'
105
+ end
106
+ # verify the required parameter 'id' is set
107
+ if @api_client.config.client_side_validation && id.nil?
108
+ fail ArgumentError, "Missing the required parameter 'id' when calling UserApi.update_user_password"
109
+ end
110
+ # verify the required parameter 'update_user_password_request' is set
111
+ if @api_client.config.client_side_validation && update_user_password_request.nil?
112
+ fail ArgumentError, "Missing the required parameter 'update_user_password_request' when calling UserApi.update_user_password"
113
+ end
114
+ # resource path
115
+ local_var_path = '/users/{id}/update_password'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
116
+
117
+ # query parameters
118
+ query_params = opts[:query_params] || {}
119
+
120
+ # header parameters
121
+ header_params = opts[:header_params] || {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
124
+ # HTTP header 'Content-Type'
125
+ content_type = @api_client.select_header_content_type(['application/json'])
126
+ if !content_type.nil?
127
+ header_params['Content-Type'] = content_type
128
+ end
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_password_request)
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'V1EntitiesUser'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || []
141
+
142
+ new_options = opts.merge(
143
+ :operation => :"UserApi.update_user_password",
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: UserApi#update_user_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+ end
159
+ end
@@ -46,9 +46,10 @@ module DealMakerAPI
46
46
  # Call an API with given options.
47
47
  #
48
48
  # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
49
- # the data deserialized from response body (could be nil), response status code and response headers.
49
+ # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
50
50
  def call_api(http_method, path, opts = {})
51
51
  request = build_request(http_method, path, opts)
52
+ tempfile = download_file(request) if opts[:return_type] == 'File'
52
53
  response = request.run
53
54
 
54
55
  if @config.debugging
@@ -70,7 +71,9 @@ module DealMakerAPI
70
71
  end
71
72
  end
72
73
 
73
- if opts[:return_type]
74
+ if opts[:return_type] == 'File'
75
+ data = tempfile
76
+ elsif opts[:return_type]
74
77
  data = deserialize(response, opts[:return_type])
75
78
  else
76
79
  data = nil
@@ -125,9 +128,7 @@ module DealMakerAPI
125
128
  end
126
129
  end
127
130
 
128
- request = Typhoeus::Request.new(url, req_opts)
129
- download_file(request) if opts[:return_type] == 'File'
130
- request
131
+ Typhoeus::Request.new(url, req_opts)
131
132
  end
132
133
 
133
134
  # Builds the HTTP request body
@@ -165,6 +166,8 @@ module DealMakerAPI
165
166
  # process can use.
166
167
  #
167
168
  # @see Configuration#temp_folder_path
169
+ #
170
+ # @return [Tempfile] the tempfile generated
168
171
  def download_file(request)
169
172
  tempfile = nil
170
173
  encoding = nil
@@ -179,7 +182,6 @@ module DealMakerAPI
179
182
  prefix = prefix + '-' unless prefix.end_with?('-')
180
183
  encoding = response.body.encoding
181
184
  tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
182
- @tempfile = tempfile
183
185
  end
184
186
  request.on_body do |chunk|
185
187
  chunk.force_encoding(encoding)
@@ -194,6 +196,8 @@ module DealMakerAPI
194
196
  "explicitly with `tempfile.delete`"
195
197
  end
196
198
  end
199
+
200
+ tempfile
197
201
  end
198
202
 
199
203
  # Check if the given MIME is a JSON MIME.
@@ -214,11 +218,6 @@ module DealMakerAPI
214
218
  # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
215
219
  def deserialize(response, return_type)
216
220
  body = response.body
217
-
218
- # handle file downloading - return the File instance processed in request callbacks
219
- # note that response body is empty when the file is written in chunks in request on_body callback
220
- return @tempfile if return_type == 'File'
221
-
222
221
  return nil if body.nil? || body.empty?
223
222
 
224
223
  # return response body directly for String return type
@@ -51,6 +51,9 @@ module DealMakerAPI
51
51
  # The list of taxpayer identification numbers for the trustees (required for trustee 1).
52
52
  attr_accessor :taxpayer_id
53
53
 
54
+ # The list of phone numbers for the trustees (required for trustee 1).
55
+ attr_accessor :phone_number
56
+
54
57
  # Attribute mapping from ruby-style variable name to JSON key.
55
58
  def self.attribute_map
56
59
  {
@@ -65,7 +68,8 @@ module DealMakerAPI
65
68
  :'region' => :'region',
66
69
  :'postal_code' => :'postal_code',
67
70
  :'date_of_birth' => :'date_of_birth',
68
- :'taxpayer_id' => :'taxpayer_id'
71
+ :'taxpayer_id' => :'taxpayer_id',
72
+ :'phone_number' => :'phone_number'
69
73
  }
70
74
  end
71
75
 
@@ -88,7 +92,8 @@ module DealMakerAPI
88
92
  :'region' => :'String',
89
93
  :'postal_code' => :'String',
90
94
  :'date_of_birth' => :'String',
91
- :'taxpayer_id' => :'String'
95
+ :'taxpayer_id' => :'String',
96
+ :'phone_number' => :'String'
92
97
  }
93
98
  end
94
99
 
@@ -162,6 +167,10 @@ module DealMakerAPI
162
167
  if attributes.key?(:'taxpayer_id')
163
168
  self.taxpayer_id = attributes[:'taxpayer_id']
164
169
  end
170
+
171
+ if attributes.key?(:'phone_number')
172
+ self.phone_number = attributes[:'phone_number']
173
+ end
165
174
  end
166
175
 
167
176
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -200,7 +209,8 @@ module DealMakerAPI
200
209
  region == o.region &&
201
210
  postal_code == o.postal_code &&
202
211
  date_of_birth == o.date_of_birth &&
203
- taxpayer_id == o.taxpayer_id
212
+ taxpayer_id == o.taxpayer_id &&
213
+ phone_number == o.phone_number
204
214
  end
205
215
 
206
216
  # @see the `==` method
@@ -212,7 +222,7 @@ module DealMakerAPI
212
222
  # Calculates hash code according to all attributes.
213
223
  # @return [Integer] Hash code
214
224
  def hash
215
- [index, _delete, first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id].hash
225
+ [index, _delete, first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id, phone_number].hash
216
226
  end
217
227
 
218
228
  # Builds the object from hash
@@ -45,6 +45,9 @@ module DealMakerAPI
45
45
  # The list of taxpayer identification numbers for the trustees (required for trustee 1).
46
46
  attr_accessor :taxpayer_id
47
47
 
48
+ # The list of phone numbers for the trustees (required for trustee 1).
49
+ attr_accessor :phone_number
50
+
48
51
  # Attribute mapping from ruby-style variable name to JSON key.
49
52
  def self.attribute_map
50
53
  {
@@ -57,7 +60,8 @@ module DealMakerAPI
57
60
  :'region' => :'region',
58
61
  :'postal_code' => :'postal_code',
59
62
  :'date_of_birth' => :'date_of_birth',
60
- :'taxpayer_id' => :'taxpayer_id'
63
+ :'taxpayer_id' => :'taxpayer_id',
64
+ :'phone_number' => :'phone_number'
61
65
  }
62
66
  end
63
67
 
@@ -78,7 +82,8 @@ module DealMakerAPI
78
82
  :'region' => :'String',
79
83
  :'postal_code' => :'String',
80
84
  :'date_of_birth' => :'String',
81
- :'taxpayer_id' => :'String'
85
+ :'taxpayer_id' => :'String',
86
+ :'phone_number' => :'String'
82
87
  }
83
88
  end
84
89
 
@@ -142,6 +147,10 @@ module DealMakerAPI
142
147
  if attributes.key?(:'taxpayer_id')
143
148
  self.taxpayer_id = attributes[:'taxpayer_id']
144
149
  end
150
+
151
+ if attributes.key?(:'phone_number')
152
+ self.phone_number = attributes[:'phone_number']
153
+ end
145
154
  end
146
155
 
147
156
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -173,7 +182,8 @@ module DealMakerAPI
173
182
  region == o.region &&
174
183
  postal_code == o.postal_code &&
175
184
  date_of_birth == o.date_of_birth &&
176
- taxpayer_id == o.taxpayer_id
185
+ taxpayer_id == o.taxpayer_id &&
186
+ phone_number == o.phone_number
177
187
  end
178
188
 
179
189
  # @see the `==` method
@@ -185,7 +195,7 @@ module DealMakerAPI
185
195
  # Calculates hash code according to all attributes.
186
196
  # @return [Integer] Hash code
187
197
  def hash
188
- [first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id].hash
198
+ [first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id, phone_number].hash
189
199
  end
190
200
 
191
201
  # Builds the object from hash