DealMakerAPI 0.85.3 → 0.85.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -12
  3. data/docs/InvestorProfileApi.md +48 -54
  4. data/docs/{PatchCorporationProfileRequest.md → PatchInvestorProfilesCorporations.md} +4 -34
  5. data/docs/PatchInvestorProfilesCorporationsBeneficialOwnersInner.md +42 -0
  6. data/docs/{PatchIndividualProfileRequest.md → PatchInvestorProfilesIndividuals.md} +2 -4
  7. data/docs/{PatchJointProfileRequest.md → PatchInvestorProfilesJoints.md} +2 -6
  8. data/docs/{PatchTrustProfileRequest.md → PatchInvestorProfilesTrusts.md} +2 -6
  9. data/docs/{CreateCorporationProfileRequest.md → PostInvestorProfilesCorporations.md} +4 -30
  10. data/docs/PostInvestorProfilesCorporationsBeneficialOwnersInner.md +38 -0
  11. data/docs/{CreateIndividualProfileRequest.md → PostInvestorProfilesIndividuals.md} +2 -4
  12. data/docs/{CreateJointProfileRequest.md → PostInvestorProfilesJoints.md} +2 -6
  13. data/docs/PostInvestorProfilesTrusts.md +46 -0
  14. data/docs/PostInvestorProfilesTrustsTrusteesInner.md +36 -0
  15. data/lib/DealMakerAPI/api/investor_profile_api.rb +75 -63
  16. data/lib/DealMakerAPI/models/patch_investor_profiles_corporations.rb +503 -0
  17. data/lib/DealMakerAPI/models/patch_investor_profiles_corporations_beneficial_owners_inner.rb +342 -0
  18. data/lib/DealMakerAPI/models/{patch_individual_profile_request.rb → patch_investor_profiles_individuals.rb} +5 -14
  19. data/lib/DealMakerAPI/models/{patch_joint_profile_request.rb → patch_investor_profiles_joints.rb} +5 -24
  20. data/lib/DealMakerAPI/models/{patch_trust_profile_request.rb → patch_investor_profiles_trusts.rb} +5 -24
  21. data/lib/DealMakerAPI/models/{create_corporation_profile_request.rb → post_investor_profiles_corporations.rb} +14 -166
  22. data/lib/DealMakerAPI/models/post_investor_profiles_corporations_beneficial_owners_inner.rb +315 -0
  23. data/lib/DealMakerAPI/models/{create_individual_profile_request.rb → post_investor_profiles_individuals.rb} +5 -14
  24. data/lib/DealMakerAPI/models/{create_joint_profile_request.rb → post_investor_profiles_joints.rb} +5 -24
  25. data/lib/DealMakerAPI/models/{create_trust_profile_request.rb → post_investor_profiles_trusts.rb} +12 -142
  26. data/lib/DealMakerAPI/models/post_investor_profiles_trusts_trustees_inner.rb +305 -0
  27. data/lib/DealMakerAPI/version.rb +1 -1
  28. data/lib/DealMakerAPI.rb +11 -8
  29. data/spec/api/investor_profile_api_spec.rb +8 -8
  30. data/spec/models/patch_investor_profiles_corporations_beneficial_owners_inner_spec.rb +106 -0
  31. data/spec/models/patch_investor_profiles_corporations_spec.rb +186 -0
  32. data/spec/models/{create_individual_profile_request_spec.rb → patch_investor_profiles_individuals_spec.rb} +6 -18
  33. data/spec/models/{create_joint_profile_request_spec.rb → patch_investor_profiles_joints_spec.rb} +6 -24
  34. data/spec/models/{patch_trust_profile_request_spec.rb → patch_investor_profiles_trusts_spec.rb} +6 -18
  35. data/spec/models/post_investor_profiles_corporations_beneficial_owners_inner_spec.rb +94 -0
  36. data/spec/models/{create_trust_profile_request_spec.rb → post_investor_profiles_corporations_spec.rb} +30 -30
  37. data/spec/models/{patch_individual_profile_request_spec.rb → post_investor_profiles_individuals_spec.rb} +12 -12
  38. data/spec/models/{patch_joint_profile_request_spec.rb → post_investor_profiles_joints_spec.rb} +12 -18
  39. data/spec/models/post_investor_profiles_trusts_spec.rb +126 -0
  40. data/spec/models/post_investor_profiles_trusts_trustees_inner_spec.rb +88 -0
  41. metadata +46 -34
  42. data/docs/CreateTrustProfileRequest.md +0 -68
  43. data/lib/DealMakerAPI/models/patch_corporation_profile_request.rb +0 -686
  44. data/spec/models/create_corporation_profile_request_spec.rb +0 -270
  45. data/spec/models/patch_corporation_profile_request_spec.rb +0 -276
@@ -0,0 +1,315 @@
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.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DealMakerAPI
17
+ class PostInvestorProfilesCorporationsBeneficialOwnersInner
18
+ # The list of first names for the beneficial owners (required for beneficial owner 1).
19
+ attr_accessor :first_name
20
+
21
+ # The list of last names for the beneficial owners (required for beneficial owner 1).
22
+ attr_accessor :last_name
23
+
24
+ # The list of suffixes for the beneficial owners.
25
+ attr_accessor :suffix
26
+
27
+ # The list of street addresses for the beneficial owners (required for beneficial owner 1).
28
+ attr_accessor :street_address
29
+
30
+ # The list of street address line 2 for the beneficial owners.
31
+ attr_accessor :unit2
32
+
33
+ # The list of cities for the beneficial owners (required for beneficial owner 1).
34
+ attr_accessor :city
35
+
36
+ # The list of region or states for the beneficial owners (required for beneficial owner 1).
37
+ attr_accessor :region
38
+
39
+ # The list of postal codes or zipcodes for the beneficial owners (required for beneficial owner 1).
40
+ attr_accessor :postal_code
41
+
42
+ # The list of dates of birth for the beneficial owners (required for beneficial owner 1).
43
+ attr_accessor :date_of_birth
44
+
45
+ # The list of taxpayer identification numbers for the beneficial owners (required for beneficial owner 1).
46
+ attr_accessor :taxpayer_id
47
+
48
+ # The list of phone numbers for the beneficial owners (required for beneficial owner 1).
49
+ attr_accessor :phone_number
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'first_name' => :'first_name',
55
+ :'last_name' => :'last_name',
56
+ :'suffix' => :'suffix',
57
+ :'street_address' => :'street_address',
58
+ :'unit2' => :'unit2',
59
+ :'city' => :'city',
60
+ :'region' => :'region',
61
+ :'postal_code' => :'postal_code',
62
+ :'date_of_birth' => :'date_of_birth',
63
+ :'taxpayer_id' => :'taxpayer_id',
64
+ :'phone_number' => :'phone_number'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'first_name' => :'String',
77
+ :'last_name' => :'String',
78
+ :'suffix' => :'String',
79
+ :'street_address' => :'String',
80
+ :'unit2' => :'String',
81
+ :'city' => :'String',
82
+ :'region' => :'String',
83
+ :'postal_code' => :'String',
84
+ :'date_of_birth' => :'String',
85
+ :'taxpayer_id' => :'String',
86
+ :'phone_number' => :'String'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostInvestorProfilesCorporationsBeneficialOwnersInner` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostInvestorProfilesCorporationsBeneficialOwnersInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'first_name')
112
+ self.first_name = attributes[:'first_name']
113
+ end
114
+
115
+ if attributes.key?(:'last_name')
116
+ self.last_name = attributes[:'last_name']
117
+ end
118
+
119
+ if attributes.key?(:'suffix')
120
+ self.suffix = attributes[:'suffix']
121
+ end
122
+
123
+ if attributes.key?(:'street_address')
124
+ self.street_address = attributes[:'street_address']
125
+ end
126
+
127
+ if attributes.key?(:'unit2')
128
+ self.unit2 = attributes[:'unit2']
129
+ end
130
+
131
+ if attributes.key?(:'city')
132
+ self.city = attributes[:'city']
133
+ end
134
+
135
+ if attributes.key?(:'region')
136
+ self.region = attributes[:'region']
137
+ end
138
+
139
+ if attributes.key?(:'postal_code')
140
+ self.postal_code = attributes[:'postal_code']
141
+ end
142
+
143
+ if attributes.key?(:'date_of_birth')
144
+ self.date_of_birth = attributes[:'date_of_birth']
145
+ end
146
+
147
+ if attributes.key?(:'taxpayer_id')
148
+ self.taxpayer_id = attributes[:'taxpayer_id']
149
+ end
150
+
151
+ if attributes.key?(:'phone_number')
152
+ self.phone_number = attributes[:'phone_number']
153
+ end
154
+ end
155
+
156
+ # Show invalid properties with the reasons. Usually used together with valid?
157
+ # @return Array for valid properties with the reasons
158
+ def list_invalid_properties
159
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
160
+ invalid_properties = Array.new
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ true
169
+ end
170
+
171
+ # Checks equality by comparing each attribute.
172
+ # @param [Object] Object to be compared
173
+ def ==(o)
174
+ return true if self.equal?(o)
175
+ self.class == o.class &&
176
+ first_name == o.first_name &&
177
+ last_name == o.last_name &&
178
+ suffix == o.suffix &&
179
+ street_address == o.street_address &&
180
+ unit2 == o.unit2 &&
181
+ city == o.city &&
182
+ region == o.region &&
183
+ postal_code == o.postal_code &&
184
+ date_of_birth == o.date_of_birth &&
185
+ taxpayer_id == o.taxpayer_id &&
186
+ phone_number == o.phone_number
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id, phone_number].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Deserializes the data based on type
225
+ # @param string type Data type
226
+ # @param string value Value to be deserialized
227
+ # @return [Object] Deserialized data
228
+ def self._deserialize(type, value)
229
+ case type.to_sym
230
+ when :Time
231
+ Time.parse(value)
232
+ when :Date
233
+ Date.parse(value)
234
+ when :String
235
+ value.to_s
236
+ when :Integer
237
+ value.to_i
238
+ when :Float
239
+ value.to_f
240
+ when :Boolean
241
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
242
+ true
243
+ else
244
+ false
245
+ end
246
+ when :Object
247
+ # generic object (usually a Hash), return directly
248
+ value
249
+ when /\AArray<(?<inner_type>.+)>\z/
250
+ inner_type = Regexp.last_match[:inner_type]
251
+ value.map { |v| _deserialize(inner_type, v) }
252
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
253
+ k_type = Regexp.last_match[:k_type]
254
+ v_type = Regexp.last_match[:v_type]
255
+ {}.tap do |hash|
256
+ value.each do |k, v|
257
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
258
+ end
259
+ end
260
+ else # model
261
+ # models (e.g. Pet) or oneOf
262
+ klass = DealMakerAPI.const_get(type)
263
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
264
+ end
265
+ end
266
+
267
+ # Returns the string representation of the object
268
+ # @return [String] String presentation of the object
269
+ def to_s
270
+ to_hash.to_s
271
+ end
272
+
273
+ # to_body is an alias to to_hash (backward compatibility)
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_body
276
+ to_hash
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+
313
+ end
314
+
315
+ end
@@ -14,7 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DealMakerAPI
17
- class CreateIndividualProfileRequest
17
+ # Create new individual investor profile
18
+ class PostInvestorProfilesIndividuals
18
19
  # User email which is associated with individual investor profile.
19
20
  attr_accessor :email
20
21
 
@@ -42,9 +43,6 @@ module DealMakerAPI
42
43
  # The phone number of the investor profile (required)
43
44
  attr_accessor :phone_number
44
45
 
45
- # The country of the individual investor profile (required)
46
- attr_accessor :country
47
-
48
46
  # The street address of the individual investor profile (required)
49
47
  attr_accessor :street_address
50
48
 
@@ -103,7 +101,6 @@ module DealMakerAPI
103
101
  :'date_of_birth' => :'date_of_birth',
104
102
  :'taxpayer_id' => :'taxpayer_id',
105
103
  :'phone_number' => :'phone_number',
106
- :'country' => :'country',
107
104
  :'street_address' => :'street_address',
108
105
  :'unit2' => :'unit2',
109
106
  :'city' => :'city',
@@ -132,7 +129,6 @@ module DealMakerAPI
132
129
  :'date_of_birth' => :'String',
133
130
  :'taxpayer_id' => :'String',
134
131
  :'phone_number' => :'String',
135
- :'country' => :'String',
136
132
  :'street_address' => :'String',
137
133
  :'unit2' => :'String',
138
134
  :'city' => :'String',
@@ -154,13 +150,13 @@ module DealMakerAPI
154
150
  # @param [Hash] attributes Model attributes in the form of hash
155
151
  def initialize(attributes = {})
156
152
  if (!attributes.is_a?(Hash))
157
- fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::CreateIndividualProfileRequest` initialize method"
153
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostInvestorProfilesIndividuals` initialize method"
158
154
  end
159
155
 
160
156
  # check to see if the attribute exists and convert string to symbol for hash key
161
157
  attributes = attributes.each_with_object({}) { |(k, v), h|
162
158
  if (!self.class.attribute_map.key?(k.to_sym))
163
- fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::CreateIndividualProfileRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
159
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostInvestorProfilesIndividuals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
164
160
  end
165
161
  h[k.to_sym] = v
166
162
  }
@@ -203,10 +199,6 @@ module DealMakerAPI
203
199
  self.phone_number = attributes[:'phone_number']
204
200
  end
205
201
 
206
- if attributes.key?(:'country')
207
- self.country = attributes[:'country']
208
- end
209
-
210
202
  if attributes.key?(:'street_address')
211
203
  self.street_address = attributes[:'street_address']
212
204
  end
@@ -298,7 +290,6 @@ module DealMakerAPI
298
290
  date_of_birth == o.date_of_birth &&
299
291
  taxpayer_id == o.taxpayer_id &&
300
292
  phone_number == o.phone_number &&
301
- country == o.country &&
302
293
  street_address == o.street_address &&
303
294
  unit2 == o.unit2 &&
304
295
  city == o.city &&
@@ -318,7 +309,7 @@ module DealMakerAPI
318
309
  # Calculates hash code according to all attributes.
319
310
  # @return [Integer] Hash code
320
311
  def hash
321
- [email, us_accredited_category, ca_accredited_investor, first_name, last_name, suffix, date_of_birth, taxpayer_id, phone_number, country, street_address, unit2, city, region, postal_code, income, net_worth, reg_cf_prior_offerings_amount].hash
312
+ [email, us_accredited_category, ca_accredited_investor, first_name, last_name, suffix, date_of_birth, taxpayer_id, phone_number, street_address, unit2, city, region, postal_code, income, net_worth, reg_cf_prior_offerings_amount].hash
322
313
  end
323
314
 
324
315
  # Builds the object from hash
@@ -14,7 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DealMakerAPI
17
- class CreateJointProfileRequest
17
+ # Create new joint investor profile
18
+ class PostInvestorProfilesJoints
18
19
  # User email which is associated with investor profile.
19
20
  attr_accessor :email
20
21
 
@@ -36,9 +37,6 @@ module DealMakerAPI
36
37
  # The suffix of the primary holder.
37
38
  attr_accessor :suffix
38
39
 
39
- # The country the primary holder (required).
40
- attr_accessor :country
41
-
42
40
  # The street address of the primary holder (required).
43
41
  attr_accessor :street_address
44
42
 
@@ -81,9 +79,6 @@ module DealMakerAPI
81
79
  # The suffix of the joint holder.
82
80
  attr_accessor :joint_holder_suffix
83
81
 
84
- # The country of the joint holder (required).
85
- attr_accessor :joint_holder_country
86
-
87
82
  # The street address of the joint holder (required).
88
83
  attr_accessor :joint_holder_street_address
89
84
 
@@ -137,7 +132,6 @@ module DealMakerAPI
137
132
  :'first_name' => :'first_name',
138
133
  :'last_name' => :'last_name',
139
134
  :'suffix' => :'suffix',
140
- :'country' => :'country',
141
135
  :'street_address' => :'street_address',
142
136
  :'unit2' => :'unit2',
143
137
  :'city' => :'city',
@@ -152,7 +146,6 @@ module DealMakerAPI
152
146
  :'joint_holder_first_name' => :'joint_holder_first_name',
153
147
  :'joint_holder_last_name' => :'joint_holder_last_name',
154
148
  :'joint_holder_suffix' => :'joint_holder_suffix',
155
- :'joint_holder_country' => :'joint_holder_country',
156
149
  :'joint_holder_street_address' => :'joint_holder_street_address',
157
150
  :'joint_holder_unit2' => :'joint_holder_unit2',
158
151
  :'joint_holder_city' => :'joint_holder_city',
@@ -178,7 +171,6 @@ module DealMakerAPI
178
171
  :'first_name' => :'String',
179
172
  :'last_name' => :'String',
180
173
  :'suffix' => :'String',
181
- :'country' => :'String',
182
174
  :'street_address' => :'String',
183
175
  :'unit2' => :'String',
184
176
  :'city' => :'String',
@@ -193,7 +185,6 @@ module DealMakerAPI
193
185
  :'joint_holder_first_name' => :'String',
194
186
  :'joint_holder_last_name' => :'String',
195
187
  :'joint_holder_suffix' => :'String',
196
- :'joint_holder_country' => :'String',
197
188
  :'joint_holder_street_address' => :'String',
198
189
  :'joint_holder_unit2' => :'String',
199
190
  :'joint_holder_city' => :'String',
@@ -214,13 +205,13 @@ module DealMakerAPI
214
205
  # @param [Hash] attributes Model attributes in the form of hash
215
206
  def initialize(attributes = {})
216
207
  if (!attributes.is_a?(Hash))
217
- fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::CreateJointProfileRequest` initialize method"
208
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostInvestorProfilesJoints` initialize method"
218
209
  end
219
210
 
220
211
  # check to see if the attribute exists and convert string to symbol for hash key
221
212
  attributes = attributes.each_with_object({}) { |(k, v), h|
222
213
  if (!self.class.attribute_map.key?(k.to_sym))
223
- fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::CreateJointProfileRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
214
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostInvestorProfilesJoints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
224
215
  end
225
216
  h[k.to_sym] = v
226
217
  }
@@ -255,10 +246,6 @@ module DealMakerAPI
255
246
  self.suffix = attributes[:'suffix']
256
247
  end
257
248
 
258
- if attributes.key?(:'country')
259
- self.country = attributes[:'country']
260
- end
261
-
262
249
  if attributes.key?(:'street_address')
263
250
  self.street_address = attributes[:'street_address']
264
251
  end
@@ -315,10 +302,6 @@ module DealMakerAPI
315
302
  self.joint_holder_suffix = attributes[:'joint_holder_suffix']
316
303
  end
317
304
 
318
- if attributes.key?(:'joint_holder_country')
319
- self.joint_holder_country = attributes[:'joint_holder_country']
320
- end
321
-
322
305
  if attributes.key?(:'joint_holder_street_address')
323
306
  self.joint_holder_street_address = attributes[:'joint_holder_street_address']
324
307
  end
@@ -416,7 +399,6 @@ module DealMakerAPI
416
399
  first_name == o.first_name &&
417
400
  last_name == o.last_name &&
418
401
  suffix == o.suffix &&
419
- country == o.country &&
420
402
  street_address == o.street_address &&
421
403
  unit2 == o.unit2 &&
422
404
  city == o.city &&
@@ -431,7 +413,6 @@ module DealMakerAPI
431
413
  joint_holder_first_name == o.joint_holder_first_name &&
432
414
  joint_holder_last_name == o.joint_holder_last_name &&
433
415
  joint_holder_suffix == o.joint_holder_suffix &&
434
- joint_holder_country == o.joint_holder_country &&
435
416
  joint_holder_street_address == o.joint_holder_street_address &&
436
417
  joint_holder_unit2 == o.joint_holder_unit2 &&
437
418
  joint_holder_city == o.joint_holder_city &&
@@ -450,7 +431,7 @@ module DealMakerAPI
450
431
  # Calculates hash code according to all attributes.
451
432
  # @return [Integer] Hash code
452
433
  def hash
453
- [email, us_accredited_category, ca_accredited_investor, joint_type, first_name, last_name, suffix, country, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id, phone_number, income, net_worth, reg_cf_prior_offerings_amount, joint_holder_first_name, joint_holder_last_name, joint_holder_suffix, joint_holder_country, joint_holder_street_address, joint_holder_unit2, joint_holder_city, joint_holder_region, joint_holder_postal_code, joint_holder_date_of_birth, joint_holder_taxpayer_id].hash
434
+ [email, us_accredited_category, ca_accredited_investor, joint_type, first_name, last_name, suffix, street_address, unit2, city, region, postal_code, date_of_birth, taxpayer_id, phone_number, income, net_worth, reg_cf_prior_offerings_amount, joint_holder_first_name, joint_holder_last_name, joint_holder_suffix, joint_holder_street_address, joint_holder_unit2, joint_holder_city, joint_holder_region, joint_holder_postal_code, joint_holder_date_of_birth, joint_holder_taxpayer_id].hash
454
435
  end
455
436
 
456
437
  # Builds the object from hash