DealMakerAPI 0.91.2 → 0.91.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -7
  3. data/docs/DealApi.md +69 -0
  4. data/docs/DefaultApi.md +67 -0
  5. data/docs/InvestorApi.md +4 -4
  6. data/docs/InvestorProfileApi.md +67 -0
  7. data/docs/PostInvestorProfilesManaged.md +68 -0
  8. data/docs/{V1EntitiesInvestorIncentivePlan.md → V1EntitiesDealsIncentivePlan.md} +2 -2
  9. data/docs/{V1EntitiesInvestorIncentiveTier.md → V1EntitiesDealsIncentivePlansIncentiveTier.md} +2 -2
  10. data/docs/V1EntitiesDealsPriceDetails.md +28 -0
  11. data/docs/V1EntitiesInvestorProfileFieldsBeneficiary.md +32 -0
  12. data/docs/V1EntitiesInvestorProfileFieldsProvider.md +30 -0
  13. data/docs/V1EntitiesInvestorProfileItem.md +1 -1
  14. data/docs/V1EntitiesInvestorProfileManaged.md +38 -0
  15. data/docs/V1EntitiesPaymentsSelfServeOnboardingPayoutAccountDetailsData.md +18 -0
  16. data/lib/DealMakerAPI/api/deal_api.rb +66 -0
  17. data/lib/DealMakerAPI/api/default_api.rb +63 -0
  18. data/lib/DealMakerAPI/api/investor_api.rb +3 -3
  19. data/lib/DealMakerAPI/api/investor_profile_api.rb +68 -0
  20. data/lib/DealMakerAPI/models/post_investor_profiles_managed.rb +519 -0
  21. data/lib/DealMakerAPI/models/{v1_entities_investor_incentive_plan.rb → v1_entities_deals_incentive_plan.rb} +37 -3
  22. data/lib/DealMakerAPI/models/{v1_entities_investor_incentive_tier.rb → v1_entities_deals_incentive_plans_incentive_tier.rb} +3 -3
  23. data/lib/DealMakerAPI/models/{v1_entities_investor_price_details.rb → v1_entities_deals_price_details.rb} +27 -7
  24. data/lib/DealMakerAPI/models/v1_entities_investor_profile_corporation.rb +2 -2
  25. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_beneficiary.rb +284 -0
  26. data/lib/DealMakerAPI/models/v1_entities_investor_profile_fields_provider.rb +274 -0
  27. data/lib/DealMakerAPI/models/v1_entities_investor_profile_individual.rb +2 -2
  28. data/lib/DealMakerAPI/models/v1_entities_investor_profile_item.rb +1 -1
  29. data/lib/DealMakerAPI/models/v1_entities_investor_profile_joint.rb +2 -2
  30. data/lib/DealMakerAPI/models/v1_entities_investor_profile_managed.rb +347 -0
  31. data/lib/DealMakerAPI/models/v1_entities_investor_profile_trust.rb +2 -2
  32. data/lib/DealMakerAPI/models/v1_entities_payments_self_serve_onboarding_payout_account_details_data.rb +216 -0
  33. data/lib/DealMakerAPI/version.rb +1 -1
  34. data/lib/DealMakerAPI.rb +8 -3
  35. data/spec/api/deal_api_spec.rb +13 -0
  36. data/spec/api/default_api_spec.rb +12 -0
  37. data/spec/api/investor_api_spec.rb +1 -1
  38. data/spec/api/investor_profile_api_spec.rb +12 -0
  39. data/spec/models/post_investor_profiles_managed_spec.rb +194 -0
  40. data/spec/models/{v1_entities_investor_incentive_plan_spec.rb → v1_entities_deals_incentive_plan_spec.rb} +10 -6
  41. data/spec/models/{v1_entities_investor_incentive_tier_spec.rb → v1_entities_deals_incentive_plans_incentive_tier_spec.rb} +6 -6
  42. data/spec/models/{v1_entities_investor_price_details_spec.rb → v1_entities_deals_price_details_spec.rb} +18 -6
  43. data/spec/models/v1_entities_investor_profile_corporation_spec.rb +1 -1
  44. data/spec/models/v1_entities_investor_profile_fields_beneficiary_spec.rb +78 -0
  45. data/spec/models/v1_entities_investor_profile_fields_provider_spec.rb +72 -0
  46. data/spec/models/v1_entities_investor_profile_individual_spec.rb +1 -1
  47. data/spec/models/v1_entities_investor_profile_joint_spec.rb +1 -1
  48. data/spec/models/v1_entities_investor_profile_managed_spec.rb +100 -0
  49. data/spec/models/v1_entities_investor_profile_trust_spec.rb +1 -1
  50. data/spec/models/v1_entities_payments_self_serve_onboarding_payout_account_details_data_spec.rb +36 -0
  51. metadata +119 -99
  52. data/docs/V1EntitiesInvestorPriceDetails.md +0 -24
@@ -0,0 +1,519 @@
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.2.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DealMakerAPI
17
+ # Create new managed investor profile.
18
+ class PostInvestorProfilesManaged
19
+ # User email which is associated with investor profile (required).
20
+ attr_accessor :email
21
+
22
+ # The United States accredited investor information.
23
+ attr_accessor :us_accredited_category
24
+
25
+ # The Canadian accredited investor information.
26
+ attr_accessor :ca_accredited_investor
27
+
28
+ # The name of the provider (required).
29
+ attr_accessor :name
30
+
31
+ # The street address of the provider (required).
32
+ attr_accessor :street_address
33
+
34
+ # The street address line 2 of the provider.
35
+ attr_accessor :unit2
36
+
37
+ # The city of the provider (required).
38
+ attr_accessor :city
39
+
40
+ # The region or state of the provider (required).
41
+ attr_accessor :region
42
+
43
+ # The postal code or zipcode of the provider (required).
44
+ attr_accessor :postal_code
45
+
46
+ # The taxpayer identification number of the provider (required).
47
+ attr_accessor :taxpayer_id
48
+
49
+ # Confirms that the provider is able to custody these securities and release respective funds in order to complete the purchase (required).
50
+ attr_accessor :confirmation
51
+
52
+ # The income of the managed investor profile
53
+ attr_accessor :income
54
+
55
+ # The net worth of the managed investor profile
56
+ attr_accessor :net_worth
57
+
58
+ # The prior offering amount of the managed investor profile
59
+ attr_accessor :reg_cf_prior_offerings_amount
60
+
61
+ # The account number of the beneficiary (required).
62
+ attr_accessor :beneficiary_account_number
63
+
64
+ # The first name of the beneficiary (required).
65
+ attr_accessor :beneficiary_first_name
66
+
67
+ # The last name of the beneficiary (required).
68
+ attr_accessor :beneficiary_last_name
69
+
70
+ # The suffix of the beneficiary.
71
+ attr_accessor :beneficiary_suffix
72
+
73
+ # The street address of the beneficiary (required).
74
+ attr_accessor :beneficiary_street_address
75
+
76
+ # The street address line 2 of the beneficiary.
77
+ attr_accessor :beneficiary_unit2
78
+
79
+ # The city of the beneficiary (required).
80
+ attr_accessor :beneficiary_city
81
+
82
+ # The region or state of the beneficiary (required).
83
+ attr_accessor :beneficiary_region
84
+
85
+ # The postal code or zipcode of the beneficiary (required).
86
+ attr_accessor :beneficiary_postal_code
87
+
88
+ # The date of birth of the beneficiary (required).
89
+ attr_accessor :beneficiary_date_of_birth
90
+
91
+ # The taxpayer identification number of the beneficiary (required).
92
+ attr_accessor :beneficiary_taxpayer_id
93
+
94
+ # The phone number of the beneficiary (required).
95
+ attr_accessor :beneficiary_phone_number
96
+
97
+ class EnumAttributeValidator
98
+ attr_reader :datatype
99
+ attr_reader :allowable_values
100
+
101
+ def initialize(datatype, allowable_values)
102
+ @allowable_values = allowable_values.map do |value|
103
+ case datatype.to_s
104
+ when /Integer/i
105
+ value.to_i
106
+ when /Float/i
107
+ value.to_f
108
+ else
109
+ value
110
+ end
111
+ end
112
+ end
113
+
114
+ def valid?(value)
115
+ !value || allowable_values.include?(value)
116
+ end
117
+ end
118
+
119
+ # Attribute mapping from ruby-style variable name to JSON key.
120
+ def self.attribute_map
121
+ {
122
+ :'email' => :'email',
123
+ :'us_accredited_category' => :'us_accredited_category',
124
+ :'ca_accredited_investor' => :'ca_accredited_investor',
125
+ :'name' => :'name',
126
+ :'street_address' => :'street_address',
127
+ :'unit2' => :'unit2',
128
+ :'city' => :'city',
129
+ :'region' => :'region',
130
+ :'postal_code' => :'postal_code',
131
+ :'taxpayer_id' => :'taxpayer_id',
132
+ :'confirmation' => :'confirmation',
133
+ :'income' => :'income',
134
+ :'net_worth' => :'net_worth',
135
+ :'reg_cf_prior_offerings_amount' => :'reg_cf_prior_offerings_amount',
136
+ :'beneficiary_account_number' => :'beneficiary_account_number',
137
+ :'beneficiary_first_name' => :'beneficiary_first_name',
138
+ :'beneficiary_last_name' => :'beneficiary_last_name',
139
+ :'beneficiary_suffix' => :'beneficiary_suffix',
140
+ :'beneficiary_street_address' => :'beneficiary_street_address',
141
+ :'beneficiary_unit2' => :'beneficiary_unit2',
142
+ :'beneficiary_city' => :'beneficiary_city',
143
+ :'beneficiary_region' => :'beneficiary_region',
144
+ :'beneficiary_postal_code' => :'beneficiary_postal_code',
145
+ :'beneficiary_date_of_birth' => :'beneficiary_date_of_birth',
146
+ :'beneficiary_taxpayer_id' => :'beneficiary_taxpayer_id',
147
+ :'beneficiary_phone_number' => :'beneficiary_phone_number'
148
+ }
149
+ end
150
+
151
+ # Returns all the JSON keys this model knows about
152
+ def self.acceptable_attributes
153
+ attribute_map.values
154
+ end
155
+
156
+ # Attribute type mapping.
157
+ def self.openapi_types
158
+ {
159
+ :'email' => :'String',
160
+ :'us_accredited_category' => :'String',
161
+ :'ca_accredited_investor' => :'String',
162
+ :'name' => :'String',
163
+ :'street_address' => :'String',
164
+ :'unit2' => :'String',
165
+ :'city' => :'String',
166
+ :'region' => :'String',
167
+ :'postal_code' => :'String',
168
+ :'taxpayer_id' => :'String',
169
+ :'confirmation' => :'Boolean',
170
+ :'income' => :'Float',
171
+ :'net_worth' => :'Float',
172
+ :'reg_cf_prior_offerings_amount' => :'Float',
173
+ :'beneficiary_account_number' => :'String',
174
+ :'beneficiary_first_name' => :'String',
175
+ :'beneficiary_last_name' => :'String',
176
+ :'beneficiary_suffix' => :'String',
177
+ :'beneficiary_street_address' => :'String',
178
+ :'beneficiary_unit2' => :'String',
179
+ :'beneficiary_city' => :'String',
180
+ :'beneficiary_region' => :'String',
181
+ :'beneficiary_postal_code' => :'String',
182
+ :'beneficiary_date_of_birth' => :'String',
183
+ :'beneficiary_taxpayer_id' => :'String',
184
+ :'beneficiary_phone_number' => :'String'
185
+ }
186
+ end
187
+
188
+ # List of attributes with nullable: true
189
+ def self.openapi_nullable
190
+ Set.new([
191
+ ])
192
+ end
193
+
194
+ # Initializes the object
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ def initialize(attributes = {})
197
+ if (!attributes.is_a?(Hash))
198
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostInvestorProfilesManaged` initialize method"
199
+ end
200
+
201
+ # check to see if the attribute exists and convert string to symbol for hash key
202
+ attributes = attributes.each_with_object({}) { |(k, v), h|
203
+ if (!self.class.attribute_map.key?(k.to_sym))
204
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostInvestorProfilesManaged`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
205
+ end
206
+ h[k.to_sym] = v
207
+ }
208
+
209
+ if attributes.key?(:'email')
210
+ self.email = attributes[:'email']
211
+ else
212
+ self.email = nil
213
+ end
214
+
215
+ if attributes.key?(:'us_accredited_category')
216
+ self.us_accredited_category = attributes[:'us_accredited_category']
217
+ end
218
+
219
+ if attributes.key?(:'ca_accredited_investor')
220
+ self.ca_accredited_investor = attributes[:'ca_accredited_investor']
221
+ end
222
+
223
+ if attributes.key?(:'name')
224
+ self.name = attributes[:'name']
225
+ end
226
+
227
+ if attributes.key?(:'street_address')
228
+ self.street_address = attributes[:'street_address']
229
+ end
230
+
231
+ if attributes.key?(:'unit2')
232
+ self.unit2 = attributes[:'unit2']
233
+ end
234
+
235
+ if attributes.key?(:'city')
236
+ self.city = attributes[:'city']
237
+ end
238
+
239
+ if attributes.key?(:'region')
240
+ self.region = attributes[:'region']
241
+ end
242
+
243
+ if attributes.key?(:'postal_code')
244
+ self.postal_code = attributes[:'postal_code']
245
+ end
246
+
247
+ if attributes.key?(:'taxpayer_id')
248
+ self.taxpayer_id = attributes[:'taxpayer_id']
249
+ end
250
+
251
+ if attributes.key?(:'confirmation')
252
+ self.confirmation = attributes[:'confirmation']
253
+ end
254
+
255
+ if attributes.key?(:'income')
256
+ self.income = attributes[:'income']
257
+ end
258
+
259
+ if attributes.key?(:'net_worth')
260
+ self.net_worth = attributes[:'net_worth']
261
+ end
262
+
263
+ if attributes.key?(:'reg_cf_prior_offerings_amount')
264
+ self.reg_cf_prior_offerings_amount = attributes[:'reg_cf_prior_offerings_amount']
265
+ end
266
+
267
+ if attributes.key?(:'beneficiary_account_number')
268
+ self.beneficiary_account_number = attributes[:'beneficiary_account_number']
269
+ end
270
+
271
+ if attributes.key?(:'beneficiary_first_name')
272
+ self.beneficiary_first_name = attributes[:'beneficiary_first_name']
273
+ end
274
+
275
+ if attributes.key?(:'beneficiary_last_name')
276
+ self.beneficiary_last_name = attributes[:'beneficiary_last_name']
277
+ end
278
+
279
+ if attributes.key?(:'beneficiary_suffix')
280
+ self.beneficiary_suffix = attributes[:'beneficiary_suffix']
281
+ end
282
+
283
+ if attributes.key?(:'beneficiary_street_address')
284
+ self.beneficiary_street_address = attributes[:'beneficiary_street_address']
285
+ end
286
+
287
+ if attributes.key?(:'beneficiary_unit2')
288
+ self.beneficiary_unit2 = attributes[:'beneficiary_unit2']
289
+ end
290
+
291
+ if attributes.key?(:'beneficiary_city')
292
+ self.beneficiary_city = attributes[:'beneficiary_city']
293
+ end
294
+
295
+ if attributes.key?(:'beneficiary_region')
296
+ self.beneficiary_region = attributes[:'beneficiary_region']
297
+ end
298
+
299
+ if attributes.key?(:'beneficiary_postal_code')
300
+ self.beneficiary_postal_code = attributes[:'beneficiary_postal_code']
301
+ end
302
+
303
+ if attributes.key?(:'beneficiary_date_of_birth')
304
+ self.beneficiary_date_of_birth = attributes[:'beneficiary_date_of_birth']
305
+ end
306
+
307
+ if attributes.key?(:'beneficiary_taxpayer_id')
308
+ self.beneficiary_taxpayer_id = attributes[:'beneficiary_taxpayer_id']
309
+ end
310
+
311
+ if attributes.key?(:'beneficiary_phone_number')
312
+ self.beneficiary_phone_number = attributes[:'beneficiary_phone_number']
313
+ end
314
+ end
315
+
316
+ # Show invalid properties with the reasons. Usually used together with valid?
317
+ # @return Array for valid properties with the reasons
318
+ def list_invalid_properties
319
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
320
+ invalid_properties = Array.new
321
+ if @email.nil?
322
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
323
+ end
324
+
325
+ invalid_properties
326
+ end
327
+
328
+ # Check to see if the all the properties in the model are valid
329
+ # @return true if the model is valid
330
+ def valid?
331
+ warn '[DEPRECATED] the `valid?` method is obsolete'
332
+ return false if @email.nil?
333
+ us_accredited_category_validator = EnumAttributeValidator.new('String', ["income_individual", "assets_individual", "director", "knowledgable_employee", "broker_or_dealer", "investment_advisor_registered", "investment_advisor_relying", "designated_accredited_investor", "not_accredited"])
334
+ return false unless us_accredited_category_validator.valid?(@us_accredited_category)
335
+ ca_accredited_investor_validator = EnumAttributeValidator.new('String', ["d", "e", "e_1", "j", "j_1", "k_alone", "k_spouse", "l", "q", "v", "x"])
336
+ return false unless ca_accredited_investor_validator.valid?(@ca_accredited_investor)
337
+ true
338
+ end
339
+
340
+ # Custom attribute writer method checking allowed values (enum).
341
+ # @param [Object] us_accredited_category Object to be assigned
342
+ def us_accredited_category=(us_accredited_category)
343
+ validator = EnumAttributeValidator.new('String', ["income_individual", "assets_individual", "director", "knowledgable_employee", "broker_or_dealer", "investment_advisor_registered", "investment_advisor_relying", "designated_accredited_investor", "not_accredited"])
344
+ unless validator.valid?(us_accredited_category)
345
+ fail ArgumentError, "invalid value for \"us_accredited_category\", must be one of #{validator.allowable_values}."
346
+ end
347
+ @us_accredited_category = us_accredited_category
348
+ end
349
+
350
+ # Custom attribute writer method checking allowed values (enum).
351
+ # @param [Object] ca_accredited_investor Object to be assigned
352
+ def ca_accredited_investor=(ca_accredited_investor)
353
+ validator = EnumAttributeValidator.new('String', ["d", "e", "e_1", "j", "j_1", "k_alone", "k_spouse", "l", "q", "v", "x"])
354
+ unless validator.valid?(ca_accredited_investor)
355
+ fail ArgumentError, "invalid value for \"ca_accredited_investor\", must be one of #{validator.allowable_values}."
356
+ end
357
+ @ca_accredited_investor = ca_accredited_investor
358
+ end
359
+
360
+ # Checks equality by comparing each attribute.
361
+ # @param [Object] Object to be compared
362
+ def ==(o)
363
+ return true if self.equal?(o)
364
+ self.class == o.class &&
365
+ email == o.email &&
366
+ us_accredited_category == o.us_accredited_category &&
367
+ ca_accredited_investor == o.ca_accredited_investor &&
368
+ name == o.name &&
369
+ street_address == o.street_address &&
370
+ unit2 == o.unit2 &&
371
+ city == o.city &&
372
+ region == o.region &&
373
+ postal_code == o.postal_code &&
374
+ taxpayer_id == o.taxpayer_id &&
375
+ confirmation == o.confirmation &&
376
+ income == o.income &&
377
+ net_worth == o.net_worth &&
378
+ reg_cf_prior_offerings_amount == o.reg_cf_prior_offerings_amount &&
379
+ beneficiary_account_number == o.beneficiary_account_number &&
380
+ beneficiary_first_name == o.beneficiary_first_name &&
381
+ beneficiary_last_name == o.beneficiary_last_name &&
382
+ beneficiary_suffix == o.beneficiary_suffix &&
383
+ beneficiary_street_address == o.beneficiary_street_address &&
384
+ beneficiary_unit2 == o.beneficiary_unit2 &&
385
+ beneficiary_city == o.beneficiary_city &&
386
+ beneficiary_region == o.beneficiary_region &&
387
+ beneficiary_postal_code == o.beneficiary_postal_code &&
388
+ beneficiary_date_of_birth == o.beneficiary_date_of_birth &&
389
+ beneficiary_taxpayer_id == o.beneficiary_taxpayer_id &&
390
+ beneficiary_phone_number == o.beneficiary_phone_number
391
+ end
392
+
393
+ # @see the `==` method
394
+ # @param [Object] Object to be compared
395
+ def eql?(o)
396
+ self == o
397
+ end
398
+
399
+ # Calculates hash code according to all attributes.
400
+ # @return [Integer] Hash code
401
+ def hash
402
+ [email, us_accredited_category, ca_accredited_investor, name, street_address, unit2, city, region, postal_code, taxpayer_id, confirmation, income, net_worth, reg_cf_prior_offerings_amount, beneficiary_account_number, beneficiary_first_name, beneficiary_last_name, beneficiary_suffix, beneficiary_street_address, beneficiary_unit2, beneficiary_city, beneficiary_region, beneficiary_postal_code, beneficiary_date_of_birth, beneficiary_taxpayer_id, beneficiary_phone_number].hash
403
+ end
404
+
405
+ # Builds the object from hash
406
+ # @param [Hash] attributes Model attributes in the form of hash
407
+ # @return [Object] Returns the model itself
408
+ def self.build_from_hash(attributes)
409
+ return nil unless attributes.is_a?(Hash)
410
+ attributes = attributes.transform_keys(&:to_sym)
411
+ transformed_hash = {}
412
+ openapi_types.each_pair do |key, type|
413
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
414
+ transformed_hash["#{key}"] = nil
415
+ elsif type =~ /\AArray<(.*)>/i
416
+ # check to ensure the input is an array given that the attribute
417
+ # is documented as an array but the input is not
418
+ if attributes[attribute_map[key]].is_a?(Array)
419
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
420
+ end
421
+ elsif !attributes[attribute_map[key]].nil?
422
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
423
+ end
424
+ end
425
+ new(transformed_hash)
426
+ end
427
+
428
+ # Deserializes the data based on type
429
+ # @param string type Data type
430
+ # @param string value Value to be deserialized
431
+ # @return [Object] Deserialized data
432
+ def self._deserialize(type, value)
433
+ case type.to_sym
434
+ when :Time
435
+ Time.parse(value)
436
+ when :Date
437
+ Date.parse(value)
438
+ when :String
439
+ value.to_s
440
+ when :Integer
441
+ value.to_i
442
+ when :Float
443
+ value.to_f
444
+ when :Boolean
445
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
446
+ true
447
+ else
448
+ false
449
+ end
450
+ when :Object
451
+ # generic object (usually a Hash), return directly
452
+ value
453
+ when /\AArray<(?<inner_type>.+)>\z/
454
+ inner_type = Regexp.last_match[:inner_type]
455
+ value.map { |v| _deserialize(inner_type, v) }
456
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
457
+ k_type = Regexp.last_match[:k_type]
458
+ v_type = Regexp.last_match[:v_type]
459
+ {}.tap do |hash|
460
+ value.each do |k, v|
461
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
462
+ end
463
+ end
464
+ else # model
465
+ # models (e.g. Pet) or oneOf
466
+ klass = DealMakerAPI.const_get(type)
467
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
468
+ end
469
+ end
470
+
471
+ # Returns the string representation of the object
472
+ # @return [String] String presentation of the object
473
+ def to_s
474
+ to_hash.to_s
475
+ end
476
+
477
+ # to_body is an alias to to_hash (backward compatibility)
478
+ # @return [Hash] Returns the object in the form of hash
479
+ def to_body
480
+ to_hash
481
+ end
482
+
483
+ # Returns the object in the form of hash
484
+ # @return [Hash] Returns the object in the form of hash
485
+ def to_hash
486
+ hash = {}
487
+ self.class.attribute_map.each_pair do |attr, param|
488
+ value = self.send(attr)
489
+ if value.nil?
490
+ is_nullable = self.class.openapi_nullable.include?(attr)
491
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
492
+ end
493
+
494
+ hash[param] = _to_hash(value)
495
+ end
496
+ hash
497
+ end
498
+
499
+ # Outputs non-array value in the form of hash
500
+ # For object, use to_hash. Otherwise, just return the value
501
+ # @param [Object] value Any valid value
502
+ # @return [Hash] Returns the value in the form of hash
503
+ def _to_hash(value)
504
+ if value.is_a?(Array)
505
+ value.compact.map { |v| _to_hash(v) }
506
+ elsif value.is_a?(Hash)
507
+ {}.tap do |hash|
508
+ value.each { |k, v| hash[k] = _to_hash(v) }
509
+ end
510
+ elsif value.respond_to? :to_hash
511
+ value.to_hash
512
+ else
513
+ value
514
+ end
515
+ end
516
+
517
+ end
518
+
519
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DealMakerAPI
17
- class V1EntitiesInvestorIncentivePlan
17
+ class V1EntitiesDealsIncentivePlan
18
18
  # The incentive plan id.
19
19
  attr_accessor :id
20
20
 
@@ -36,6 +36,28 @@ module DealMakerAPI
36
36
  # The last update time.
37
37
  attr_accessor :updated_at
38
38
 
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
39
61
  # Attribute mapping from ruby-style variable name to JSON key.
40
62
  def self.attribute_map
41
63
  {
@@ -77,13 +99,13 @@ module DealMakerAPI
77
99
  # @param [Hash] attributes Model attributes in the form of hash
78
100
  def initialize(attributes = {})
79
101
  if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesInvestorIncentivePlan` initialize method"
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesDealsIncentivePlan` initialize method"
81
103
  end
82
104
 
83
105
  # check to see if the attribute exists and convert string to symbol for hash key
84
106
  attributes = attributes.each_with_object({}) { |(k, v), h|
85
107
  if (!self.class.attribute_map.key?(k.to_sym))
86
- fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesInvestorIncentivePlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesDealsIncentivePlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
109
  end
88
110
  h[k.to_sym] = v
89
111
  }
@@ -129,9 +151,21 @@ module DealMakerAPI
129
151
  # @return true if the model is valid
130
152
  def valid?
131
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ plan_type_validator = EnumAttributeValidator.new('String', ["time"])
155
+ return false unless plan_type_validator.valid?(@plan_type)
132
156
  true
133
157
  end
134
158
 
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] plan_type Object to be assigned
161
+ def plan_type=(plan_type)
162
+ validator = EnumAttributeValidator.new('String', ["time"])
163
+ unless validator.valid?(plan_type)
164
+ fail ArgumentError, "invalid value for \"plan_type\", must be one of #{validator.allowable_values}."
165
+ end
166
+ @plan_type = plan_type
167
+ end
168
+
135
169
  # Checks equality by comparing each attribute.
136
170
  # @param [Object] Object to be compared
137
171
  def ==(o)
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DealMakerAPI
17
- class V1EntitiesInvestorIncentiveTier
17
+ class V1EntitiesDealsIncentivePlansIncentiveTier
18
18
  # The incentive tier id.
19
19
  attr_accessor :id
20
20
 
@@ -67,13 +67,13 @@ module DealMakerAPI
67
67
  # @param [Hash] attributes Model attributes in the form of hash
68
68
  def initialize(attributes = {})
69
69
  if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesInvestorIncentiveTier` initialize method"
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesDealsIncentivePlansIncentiveTier` initialize method"
71
71
  end
72
72
 
73
73
  # check to see if the attribute exists and convert string to symbol for hash key
74
74
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
75
  if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesInvestorIncentiveTier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesDealsIncentivePlansIncentiveTier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
77
  end
78
78
  h[k.to_sym] = v
79
79
  }