DealMakerAPI 0.0.3 → 0.68.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/DealMakerAPI.gemspec +3 -3
  3. data/README.md +75 -20
  4. data/docs/CompanyApi.md +214 -0
  5. data/docs/CreateCompanyRequest.md +32 -0
  6. data/docs/CreateCorporationProfileRequest.md +82 -0
  7. data/docs/CreateDealSetupRequest.md +30 -0
  8. data/docs/CreateIndividualProfileRequest.md +44 -0
  9. data/docs/CreateInvestorRequest.md +40 -0
  10. data/docs/CreateJointProfileRequest.md +68 -0
  11. data/docs/CreateTrustProfileRequest.md +60 -0
  12. data/docs/DealApi.md +5 -222
  13. data/docs/DealSetupApi.md +74 -0
  14. data/docs/DefaultApi.md +413 -0
  15. data/docs/InvestorApi.md +368 -0
  16. data/docs/InvestorProfileApi.md +573 -15
  17. data/docs/PatchCorporationProfileRequest.md +58 -0
  18. data/docs/PatchIndividualProfileRequest.md +42 -0
  19. data/docs/PatchInvestorRequest.md +18 -0
  20. data/docs/PatchJointProfileRequest.md +66 -0
  21. data/docs/PatchTrustProfileRequest.md +58 -0
  22. data/docs/PostWebhooksRequest.md +26 -0
  23. data/docs/PutWebhooksIdRequest.md +30 -0
  24. data/docs/UpdateInvestorRequest.md +24 -0
  25. data/docs/V1EntitiesAddress.md +28 -0
  26. data/docs/V1EntitiesAddresses.md +18 -0
  27. data/docs/V1EntitiesCompany.md +34 -0
  28. data/docs/V1EntitiesCompanyDeal.md +20 -0
  29. data/docs/V1EntitiesCompanyDeals.md +18 -0
  30. data/docs/V1EntitiesDealSetup.md +34 -0
  31. data/docs/V1EntitiesDealSetupUser.md +20 -0
  32. data/docs/V1EntitiesInvestor.md +10 -4
  33. data/docs/V1EntitiesInvestorProfileAddress.md +28 -0
  34. data/docs/V1EntitiesInvestorProfileCorporation.md +34 -0
  35. data/docs/V1EntitiesInvestorProfileFieldsAccountHolder.md +28 -0
  36. data/docs/V1EntitiesInvestorProfileFieldsCorporation.md +24 -0
  37. data/docs/V1EntitiesInvestorProfileFieldsPrimaryHolder.md +30 -0
  38. data/docs/V1EntitiesInvestorProfileFieldsTrust.md +24 -0
  39. data/docs/V1EntitiesInvestorProfileIndividual.md +6 -16
  40. data/docs/V1EntitiesInvestorProfileItem.md +18 -0
  41. data/docs/V1EntitiesInvestorProfileJoint.md +34 -0
  42. data/docs/V1EntitiesInvestorProfileTrust.md +32 -0
  43. data/docs/V1EntitiesInvestorProfiles.md +18 -0
  44. data/docs/V1EntitiesWebhooksDeal.md +22 -0
  45. data/docs/V1EntitiesWebhooksSecurityToken.md +18 -0
  46. data/docs/V1EntitiesWebhooksSubscription.md +28 -0
  47. data/docs/V1EntitiesWebhooksSubscriptionDeal.md +24 -0
  48. data/docs/V1EntitiesWebhooksSubscriptionDeals.md +18 -0
  49. data/lib/DealMakerAPI/api/company_api.rb +219 -0
  50. data/lib/DealMakerAPI/api/deal_api.rb +9 -226
  51. data/lib/DealMakerAPI/api/deal_setup_api.rb +90 -0
  52. data/lib/DealMakerAPI/api/default_api.rb +403 -0
  53. data/lib/DealMakerAPI/api/investor_api.rb +399 -0
  54. data/lib/DealMakerAPI/api/investor_profile_api.rb +570 -16
  55. data/lib/DealMakerAPI/api_client.rb +5 -3
  56. data/lib/DealMakerAPI/api_error.rb +3 -2
  57. data/lib/DealMakerAPI/configuration.rb +15 -3
  58. data/lib/DealMakerAPI/models/create_company_request.rb +320 -0
  59. data/lib/DealMakerAPI/models/create_corporation_profile_request.rb +601 -0
  60. data/lib/DealMakerAPI/models/create_deal_setup_request.rb +364 -0
  61. data/lib/DealMakerAPI/models/create_individual_profile_request.rb +389 -0
  62. data/lib/DealMakerAPI/models/create_investor_request.rb +386 -0
  63. data/lib/DealMakerAPI/models/create_joint_profile_request.rb +521 -0
  64. data/lib/DealMakerAPI/models/create_trust_profile_request.rb +491 -0
  65. data/lib/DealMakerAPI/models/patch_corporation_profile_request.rb +454 -0
  66. data/lib/DealMakerAPI/models/patch_individual_profile_request.rb +374 -0
  67. data/lib/DealMakerAPI/models/patch_investor_request.rb +225 -0
  68. data/lib/DealMakerAPI/models/patch_joint_profile_request.rb +506 -0
  69. data/lib/DealMakerAPI/models/patch_trust_profile_request.rb +454 -0
  70. data/lib/DealMakerAPI/models/post_webhooks_request.rb +277 -0
  71. data/lib/DealMakerAPI/models/put_webhooks_id_request.rb +286 -0
  72. data/lib/DealMakerAPI/models/update_investor_request.rb +286 -0
  73. data/lib/DealMakerAPI/models/v1_entities_address.rb +270 -0
  74. data/lib/DealMakerAPI/models/v1_entities_addresses.rb +219 -0
  75. data/lib/DealMakerAPI/models/v1_entities_attachment.rb +3 -2
  76. data/lib/DealMakerAPI/models/v1_entities_background_check_search.rb +3 -2
  77. data/lib/DealMakerAPI/models/v1_entities_company.rb +299 -0
  78. data/lib/DealMakerAPI/models/v1_entities_company_deal.rb +230 -0
  79. data/lib/DealMakerAPI/models/v1_entities_company_deals.rb +219 -0
  80. data/lib/DealMakerAPI/models/v1_entities_deal.rb +5 -4
  81. data/lib/DealMakerAPI/models/v1_entities_deal_enterprise.rb +3 -2
  82. data/lib/DealMakerAPI/models/v1_entities_deal_funding_metrics.rb +3 -2
  83. data/lib/DealMakerAPI/models/v1_entities_deal_investor_metrics.rb +3 -2
  84. data/lib/DealMakerAPI/models/v1_entities_deal_issuer.rb +3 -2
  85. data/lib/DealMakerAPI/models/v1_entities_deal_setup.rb +300 -0
  86. data/lib/DealMakerAPI/models/v1_entities_deal_setup_user.rb +230 -0
  87. data/lib/DealMakerAPI/models/v1_entities_deals.rb +3 -2
  88. data/lib/DealMakerAPI/models/v1_entities_investor.rb +50 -20
  89. data/lib/DealMakerAPI/models/v1_entities_investor_profile_address.rb +270 -0
  90. data/lib/DealMakerAPI/models/v1_entities_investor_profile_corporation.rb +332 -0
  91. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_account_holder.rb +269 -0
  92. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_corporation.rb +249 -0
  93. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_primary_holder.rb +279 -0
  94. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_trust.rb +249 -0
  95. data/lib/DealMakerAPI/models/v1_entities_investor_profile_individual.rb +26 -76
  96. data/lib/DealMakerAPI/models/v1_entities_investor_profile_item.rb +219 -0
  97. data/lib/DealMakerAPI/models/v1_entities_investor_profile_joint.rb +333 -0
  98. data/lib/DealMakerAPI/models/v1_entities_investor_profile_trust.rb +323 -0
  99. data/lib/DealMakerAPI/models/v1_entities_investor_profiles.rb +220 -0
  100. data/lib/DealMakerAPI/models/v1_entities_investor_user.rb +3 -2
  101. data/lib/DealMakerAPI/models/v1_entities_investors.rb +3 -2
  102. data/lib/DealMakerAPI/models/v1_entities_subscription_agreement.rb +3 -2
  103. data/lib/DealMakerAPI/models/v1_entities_webhooks_deal.rb +241 -0
  104. data/lib/DealMakerAPI/models/v1_entities_webhooks_security_token.rb +221 -0
  105. data/lib/DealMakerAPI/models/v1_entities_webhooks_subscription.rb +270 -0
  106. data/lib/DealMakerAPI/models/v1_entities_webhooks_subscription_deal.rb +250 -0
  107. data/lib/DealMakerAPI/models/v1_entities_webhooks_subscription_deals.rb +219 -0
  108. data/lib/DealMakerAPI/version.rb +3 -3
  109. data/lib/DealMakerAPI.rb +43 -2
  110. data/spec/api/company_api_spec.rb +73 -0
  111. data/spec/api/deal_api_spec.rb +4 -47
  112. data/spec/api/deal_setup_api_spec.rb +47 -0
  113. data/spec/api/default_api_spec.rb +108 -0
  114. data/spec/api/investor_api_spec.rb +106 -0
  115. data/spec/api/investor_profile_api_spec.rb +109 -7
  116. data/spec/api_client_spec.rb +2 -2
  117. data/spec/configuration_spec.rb +2 -2
  118. data/spec/models/create_company_request_spec.rb +76 -0
  119. data/spec/models/create_corporation_profile_request_spec.rb +230 -0
  120. data/spec/models/create_deal_setup_request_spec.rb +82 -0
  121. data/spec/models/create_individual_profile_request_spec.rb +116 -0
  122. data/spec/models/create_investor_request_spec.rb +108 -0
  123. data/spec/models/create_joint_profile_request_spec.rb +192 -0
  124. data/spec/models/create_trust_profile_request_spec.rb +164 -0
  125. data/spec/models/patch_corporation_profile_request_spec.rb +158 -0
  126. data/spec/models/patch_individual_profile_request_spec.rb +110 -0
  127. data/spec/models/patch_investor_request_spec.rb +34 -0
  128. data/spec/models/patch_joint_profile_request_spec.rb +186 -0
  129. data/spec/models/patch_trust_profile_request_spec.rb +158 -0
  130. data/spec/models/post_webhooks_request_spec.rb +58 -0
  131. data/spec/models/put_webhooks_id_request_spec.rb +70 -0
  132. data/spec/models/update_investor_request_spec.rb +56 -0
  133. data/spec/models/v1_entities_address_spec.rb +64 -0
  134. data/spec/models/v1_entities_addresses_spec.rb +34 -0
  135. data/spec/models/v1_entities_attachment_spec.rb +2 -2
  136. data/spec/models/v1_entities_background_check_search_spec.rb +2 -2
  137. data/spec/models/v1_entities_company_deal_spec.rb +40 -0
  138. data/spec/models/v1_entities_company_deals_spec.rb +34 -0
  139. data/spec/models/v1_entities_company_spec.rb +82 -0
  140. data/spec/models/v1_entities_deal_enterprise_spec.rb +2 -2
  141. data/spec/models/v1_entities_deal_funding_metrics_spec.rb +2 -2
  142. data/spec/models/v1_entities_deal_investor_metrics_spec.rb +2 -2
  143. data/spec/models/v1_entities_deal_issuer_spec.rb +2 -2
  144. data/spec/models/v1_entities_deal_setup_spec.rb +82 -0
  145. data/spec/models/v1_entities_deal_setup_user_spec.rb +40 -0
  146. data/spec/models/v1_entities_deal_spec.rb +3 -3
  147. data/spec/models/v1_entities_deals_spec.rb +2 -2
  148. data/spec/models/v1_entities_investor_profile_address_spec.rb +64 -0
  149. data/spec/models/v1_entities_investor_profile_corporation_spec.rb +86 -0
  150. data/spec/models/v1_entities_investor_profile_fields_account_holder_spec.rb +64 -0
  151. data/spec/models/v1_entities_investor_profile_fields_corporation_spec.rb +52 -0
  152. data/spec/models/v1_entities_investor_profile_fields_primary_holder_spec.rb +70 -0
  153. data/spec/models/v1_entities_investor_profile_fields_trust_spec.rb +52 -0
  154. data/spec/models/v1_entities_investor_profile_individual_spec.rb +6 -36
  155. data/spec/models/v1_entities_investor_profile_item_spec.rb +34 -0
  156. data/spec/models/v1_entities_investor_profile_joint_spec.rb +86 -0
  157. data/spec/models/v1_entities_investor_profile_trust_spec.rb +80 -0
  158. data/spec/models/v1_entities_investor_profiles_spec.rb +34 -0
  159. data/spec/models/v1_entities_investor_spec.rb +22 -4
  160. data/spec/models/v1_entities_investor_user_spec.rb +2 -2
  161. data/spec/models/v1_entities_investors_spec.rb +2 -2
  162. data/spec/models/v1_entities_subscription_agreement_spec.rb +2 -2
  163. data/spec/models/v1_entities_webhooks_deal_spec.rb +46 -0
  164. data/spec/models/v1_entities_webhooks_security_token_spec.rb +34 -0
  165. data/spec/models/v1_entities_webhooks_subscription_deal_spec.rb +52 -0
  166. data/spec/models/v1_entities_webhooks_subscription_deals_spec.rb +34 -0
  167. data/spec/models/v1_entities_webhooks_subscription_spec.rb +64 -0
  168. data/spec/spec_helper.rb +2 -2
  169. metadata +174 -10
@@ -0,0 +1,277 @@
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. The type of data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - Status (Draft, Invited, Accepted, Waiting) 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 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. - 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: 1. Status 2. Name 3. Email - (this is a user field so we trigger event for all investors with webhook subscription) 4. Allocated Amount 5. Investment Amount 6. Accredited investor fields 7. Adding or removing attachments 8. 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.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. It includes id, title, created_at and updated_at | <sup>\\*</sup>This field is not included when deleting a resource #### Common Properties (investor scope) Every event on this scope must contain an investor object, here are some properties that are common to this object on all events in the investor scope: | Key | Type | Description | | ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ | | id | Integer | The unique ID of the Investor | | name | String | Investor’s Name | | status | String | Current status of the investor<br />Possible states are: <br />draft<br />invited<br />signed<br />waiting<br />accepted | | email | String | | | phone_number | String | | | investment_amount | Double | | | allocated_amount | Double | | | accredited_investor | Object | See format in respective ticket | | attachments | Array of Objects | List of supporting documents uploaded to the investor, including URL (expire after 30 minutes) and title (caption) | | funding_state | String | Investor’s current funding state (unfunded, underfunded, funded, overfunded) | | funds_pending | Boolean | True if there are pending transactions, False otherwise | | created_at | Date | | | updated_at | Date | | | tags | Array of Strings | a list of the investor's tags, separated by comma. | ### investor.status >= signed Specific Properties | Key | Type | Description | | ---------------------- | ------ | ---------------------- | | subscription_agreement | object | id, url (expiring URL) | #### Investor Status 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 #### 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.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DealMakerAPI
17
+ class PostWebhooksRequest
18
+ # Endpoint name
19
+ attr_accessor :name
20
+
21
+ # Endpoint status
22
+ attr_accessor :enabled
23
+
24
+ # Payload URL
25
+ attr_accessor :url
26
+
27
+ # Secret key
28
+ attr_accessor :security_token
29
+
30
+ # The id of the deal to link
31
+ attr_accessor :webhook_subscription_deals_deal_id
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'name' => :'name',
37
+ :'enabled' => :'enabled',
38
+ :'url' => :'url',
39
+ :'security_token' => :'security_token',
40
+ :'webhook_subscription_deals_deal_id' => :'webhook_subscription_deals[deal_id]'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'name' => :'String',
53
+ :'enabled' => :'Boolean',
54
+ :'url' => :'String',
55
+ :'security_token' => :'String',
56
+ :'webhook_subscription_deals_deal_id' => :'Array<Integer>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostWebhooksRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostWebhooksRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'enabled')
86
+ self.enabled = attributes[:'enabled']
87
+ end
88
+
89
+ if attributes.key?(:'url')
90
+ self.url = attributes[:'url']
91
+ end
92
+
93
+ if attributes.key?(:'security_token')
94
+ self.security_token = attributes[:'security_token']
95
+ end
96
+
97
+ if attributes.key?(:'webhook_subscription_deals_deal_id')
98
+ if (value = attributes[:'webhook_subscription_deals_deal_id']).is_a?(Array)
99
+ self.webhook_subscription_deals_deal_id = value
100
+ end
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ if @name.nil?
109
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
110
+ end
111
+
112
+ if @enabled.nil?
113
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
114
+ end
115
+
116
+ if @webhook_subscription_deals_deal_id.nil?
117
+ invalid_properties.push('invalid value for "webhook_subscription_deals_deal_id", webhook_subscription_deals_deal_id cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ return false if @name.nil?
127
+ return false if @enabled.nil?
128
+ return false if @webhook_subscription_deals_deal_id.nil?
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ name == o.name &&
138
+ enabled == o.enabled &&
139
+ url == o.url &&
140
+ security_token == o.security_token &&
141
+ webhook_subscription_deals_deal_id == o.webhook_subscription_deals_deal_id
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [name, enabled, url, security_token, webhook_subscription_deals_deal_id].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ self.class.openapi_types.each_pair do |key, type|
170
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
171
+ self.send("#{key}=", nil)
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = DealMakerAPI.const_get(type)
225
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end
@@ -0,0 +1,286 @@
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. The type of data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - Status (Draft, Invited, Accepted, Waiting) 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 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. - 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: 1. Status 2. Name 3. Email - (this is a user field so we trigger event for all investors with webhook subscription) 4. Allocated Amount 5. Investment Amount 6. Accredited investor fields 7. Adding or removing attachments 8. 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.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. It includes id, title, created_at and updated_at | <sup>\\*</sup>This field is not included when deleting a resource #### Common Properties (investor scope) Every event on this scope must contain an investor object, here are some properties that are common to this object on all events in the investor scope: | Key | Type | Description | | ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ | | id | Integer | The unique ID of the Investor | | name | String | Investor’s Name | | status | String | Current status of the investor<br />Possible states are: <br />draft<br />invited<br />signed<br />waiting<br />accepted | | email | String | | | phone_number | String | | | investment_amount | Double | | | allocated_amount | Double | | | accredited_investor | Object | See format in respective ticket | | attachments | Array of Objects | List of supporting documents uploaded to the investor, including URL (expire after 30 minutes) and title (caption) | | funding_state | String | Investor’s current funding state (unfunded, underfunded, funded, overfunded) | | funds_pending | Boolean | True if there are pending transactions, False otherwise | | created_at | Date | | | updated_at | Date | | | tags | Array of Strings | a list of the investor's tags, separated by comma. | ### investor.status >= signed Specific Properties | Key | Type | Description | | ---------------------- | ------ | ---------------------- | | subscription_agreement | object | id, url (expiring URL) | #### Investor Status 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 #### 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.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DealMakerAPI
17
+ class PutWebhooksIdRequest
18
+ # Endpoint name
19
+ attr_accessor :name
20
+
21
+ # Endpoint status
22
+ attr_accessor :enabled
23
+
24
+ # Payload URL
25
+ attr_accessor :url
26
+
27
+ # Secret key
28
+ attr_accessor :security_token
29
+
30
+ # The id of the webhook subscription deal
31
+ attr_accessor :webhook_subscription_deals_id
32
+
33
+ # The id of the deal to link
34
+ attr_accessor :webhook_subscription_deals_deal_id
35
+
36
+ #
37
+ attr_accessor :webhook_subscription_deals__destroy
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'name' => :'name',
43
+ :'enabled' => :'enabled',
44
+ :'url' => :'url',
45
+ :'security_token' => :'security_token',
46
+ :'webhook_subscription_deals_id' => :'webhook_subscription_deals[id]',
47
+ :'webhook_subscription_deals_deal_id' => :'webhook_subscription_deals[deal_id]',
48
+ :'webhook_subscription_deals__destroy' => :'webhook_subscription_deals[_destroy]'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'name' => :'String',
61
+ :'enabled' => :'Boolean',
62
+ :'url' => :'String',
63
+ :'security_token' => :'String',
64
+ :'webhook_subscription_deals_id' => :'Array<Integer>',
65
+ :'webhook_subscription_deals_deal_id' => :'Array<Integer>',
66
+ :'webhook_subscription_deals__destroy' => :'Array<Boolean>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PutWebhooksIdRequest` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PutWebhooksIdRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'name')
92
+ self.name = attributes[:'name']
93
+ end
94
+
95
+ if attributes.key?(:'enabled')
96
+ self.enabled = attributes[:'enabled']
97
+ end
98
+
99
+ if attributes.key?(:'url')
100
+ self.url = attributes[:'url']
101
+ end
102
+
103
+ if attributes.key?(:'security_token')
104
+ self.security_token = attributes[:'security_token']
105
+ end
106
+
107
+ if attributes.key?(:'webhook_subscription_deals_id')
108
+ if (value = attributes[:'webhook_subscription_deals_id']).is_a?(Array)
109
+ self.webhook_subscription_deals_id = value
110
+ end
111
+ end
112
+
113
+ if attributes.key?(:'webhook_subscription_deals_deal_id')
114
+ if (value = attributes[:'webhook_subscription_deals_deal_id']).is_a?(Array)
115
+ self.webhook_subscription_deals_deal_id = value
116
+ end
117
+ end
118
+
119
+ if attributes.key?(:'webhook_subscription_deals__destroy')
120
+ if (value = attributes[:'webhook_subscription_deals__destroy']).is_a?(Array)
121
+ self.webhook_subscription_deals__destroy = value
122
+ end
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ name == o.name &&
145
+ enabled == o.enabled &&
146
+ url == o.url &&
147
+ security_token == o.security_token &&
148
+ webhook_subscription_deals_id == o.webhook_subscription_deals_id &&
149
+ webhook_subscription_deals_deal_id == o.webhook_subscription_deals_deal_id &&
150
+ webhook_subscription_deals__destroy == o.webhook_subscription_deals__destroy
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [name, enabled, url, security_token, webhook_subscription_deals_id, webhook_subscription_deals_deal_id, webhook_subscription_deals__destroy].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ self.class.openapi_types.each_pair do |key, type|
179
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
180
+ self.send("#{key}=", nil)
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
185
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
186
+ end
187
+ elsif !attributes[self.class.attribute_map[key]].nil?
188
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
189
+ end
190
+ end
191
+
192
+ self
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def _deserialize(type, value)
200
+ case type.to_sym
201
+ when :Time
202
+ Time.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ # models (e.g. Pet) or oneOf
233
+ klass = DealMakerAPI.const_get(type)
234
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ end
285
+
286
+ end