snaptrade 1.7.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2064 +0,0 @@
1
- # SnapTrade::PortfolioManagementApi
2
-
3
- All URIs are relative to *https://api.snaptrade.com/api/v1*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**add_portfolio_excluded_asset**](PortfolioManagementApi.md#add_portfolio_excluded_asset) | **POST** /portfolioGroups/{portfolioGroupId}/excludedassets | Adds an asset to exclude to a portfolio group |
8
- | [**create**](PortfolioManagementApi.md#create) | **POST** /portfolioGroups | Create new portfolio group |
9
- | [**create_asset_class**](PortfolioManagementApi.md#create_asset_class) | **POST** /modelAssetClass | Create a new model asset class |
10
- | [**create_model_portfolio**](PortfolioManagementApi.md#create_model_portfolio) | **POST** /modelPortfolio | Creates a new model portfolio |
11
- | [**delete_asset_class**](PortfolioManagementApi.md#delete_asset_class) | **DELETE** /modelAssetClass/{modelAssetClassId} | Deletes a model asset class |
12
- | [**delete_excluded_asset**](PortfolioManagementApi.md#delete_excluded_asset) | **DELETE** /portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId} | Unexclude an asset from a portfolio group |
13
- | [**delete_model_portfolio_by_id**](PortfolioManagementApi.md#delete_model_portfolio_by_id) | **DELETE** /modelPortfolio/{modelPortfolioId} | Deletes a model portfolio |
14
- | [**delete_portfoli**](PortfolioManagementApi.md#delete_portfoli) | **DELETE** /portfolioGroups/{portfolioGroupId} | Remove a target portfolio. |
15
- | [**delete_portfolio_target_by_id**](PortfolioManagementApi.md#delete_portfolio_target_by_id) | **DELETE** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Remove a TargetAsset. |
16
- | [**detail_asset_class**](PortfolioManagementApi.md#detail_asset_class) | **GET** /modelAssetClass/{modelAssetClassId} | Get details of a model asset class |
17
- | [**get_calculated_trade_by_id**](PortfolioManagementApi.md#get_calculated_trade_by_id) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId} | Return an individual trade |
18
- | [**get_model_details_by_id**](PortfolioManagementApi.md#get_model_details_by_id) | **GET** /modelPortfolio/{modelPortfolioId} | Get details of a model portfolio |
19
- | [**get_portfolio_balances**](PortfolioManagementApi.md#get_portfolio_balances) | **GET** /portfolioGroups/{portfolioGroupId}/balances | Get sum of cash balances in portfolio group |
20
- | [**get_portfolio_details_by_id**](PortfolioManagementApi.md#get_portfolio_details_by_id) | **GET** /portfolioGroups/{portfolioGroupId} | Get details of a target portfolio |
21
- | [**get_portfolio_info**](PortfolioManagementApi.md#get_portfolio_info) | **GET** /portfolioGroups/{portfolioGroupId}/info | Return a whole bunch of relevant information relating to a portfolio group. |
22
- | [**get_portfolio_settings**](PortfolioManagementApi.md#get_portfolio_settings) | **GET** /portfolioGroups/{portfolioGroupId}/settings | Get portfolio group settings |
23
- | [**get_portfolio_target_by_id**](PortfolioManagementApi.md#get_portfolio_target_by_id) | **GET** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Get a specific target from a portfolio group |
24
- | [**get_portfolio_targets**](PortfolioManagementApi.md#get_portfolio_targets) | **GET** /portfolioGroups/{portfolioGroupId}/targets | Get all target assets under the specified PortfolioGroup. |
25
- | [**get_portoflio_excluded_assets**](PortfolioManagementApi.md#get_portoflio_excluded_assets) | **GET** /portfolioGroups/{portfolioGroupId}/excludedassets | Get an array of excluded assets associated with a portfolio group\\ |
26
- | [**import_model_portfolio**](PortfolioManagementApi.md#import_model_portfolio) | **POST** /portfolioGroups/{portfolioGroupId}/import | Import target allocation based on portfolio group |
27
- | [**list**](PortfolioManagementApi.md#list) | **GET** /portfolioGroups | List all portfolio groups |
28
- | [**list_asset_classes**](PortfolioManagementApi.md#list_asset_classes) | **GET** /modelAssetClass | List of model asset class |
29
- | [**list_calculated_trades**](PortfolioManagementApi.md#list_calculated_trades) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades | List of trades to make to rebalance portfolio group |
30
- | [**list_model_portfolio**](PortfolioManagementApi.md#list_model_portfolio) | **GET** /modelPortfolio | List of model portfolio |
31
- | [**list_portfolio_accounts**](PortfolioManagementApi.md#list_portfolio_accounts) | **GET** /portfolioGroups/{portfolioGroupId}/accounts | Get all accounts associated with a portfolio group |
32
- | [**modify_model_portfolio_by_id**](PortfolioManagementApi.md#modify_model_portfolio_by_id) | **POST** /modelPortfolio/{modelPortfolioId} | Updates model portfolio object |
33
- | [**save_portfolio**](PortfolioManagementApi.md#save_portfolio) | **PATCH** /portfolioGroups/{portfolioGroupId} | Update an existing target portfolio. |
34
- | [**search_portfolio_symbols**](PortfolioManagementApi.md#search_portfolio_symbols) | **POST** /portfolioGroups/{portfolioGroupId}/symbols | Search for symbols limited to brokerages under the specified portfolio group |
35
- | [**set_portfolio_targets**](PortfolioManagementApi.md#set_portfolio_targets) | **POST** /portfolioGroups/{portfolioGroupId}/targets | Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list. |
36
- | [**update_asset_class**](PortfolioManagementApi.md#update_asset_class) | **POST** /modelAssetClass/{modelAssetClassId} | Updates model asset class objects |
37
- | [**update_portfolio_settings**](PortfolioManagementApi.md#update_portfolio_settings) | **PATCH** /portfolioGroups/{portfolioGroupId}/settings | Updates portfolio group settings |
38
- | [**update_portfolio_target_by_id**](PortfolioManagementApi.md#update_portfolio_target_by_id) | **PATCH** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Update a TargetAsset under the specified PortfolioGroup. |
39
-
40
- ## add_portfolio_excluded_asset
41
-
42
- Adds an asset to exclude to a portfolio group
43
-
44
- ### Example
45
-
46
- ```ruby
47
- require 'snaptrade'
48
-
49
- SnapTrade.client_id = "YOUR_CLIENT_ID"
50
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
51
-
52
- portfolio_group_id = "portfolioGroupId_example"
53
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
54
- symbol = "VAB.TO"
55
- raw_symbol = "VAB"
56
- description = "VANGUARD CDN AGGREGATE BOND INDEX ETF"
57
- currency = {
58
- "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
59
- "code" => "USD",
60
- "name" => "US Dollar",
61
- }
62
- exchange = {
63
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
64
- "code" => "TSX",
65
- "mic_code" => "XTSE",
66
- "name" => "Toronto Stock Exchange",
67
- "timezone" => "America/New_York",
68
- "start_time" => "09:30:00",
69
- "close_time" => "57600",
70
- "suffix" => ".TO",
71
- }
72
- type = {
73
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
74
- "code" => "cs",
75
- "description" => "Common Stock",
76
- "is_supported" => True,
77
- }
78
- currencies = [
79
- {
80
- "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
81
- "code" => "USD",
82
- "name" => "US Dollar",
83
- }
84
- ]
85
-
86
- begin
87
- # Adds an asset to exclude to a portfolio group
88
- result = SnapTrade::PortfolioManagement.add_portfolio_excluded_asset(
89
- portfolio_group_id: portfolio_group_id,
90
- id: id,
91
- symbol: symbol,
92
- raw_symbol: raw_symbol,
93
- description: description,
94
- currency: currency,
95
- exchange: exchange,
96
- type: type,
97
- currencies: currencies,
98
- )
99
- p result
100
- rescue SnapTrade::ApiError => e
101
- puts "Exception when calling SnapTrade::PortfolioManagement.add_portfolio_excluded_asset: #{e}"
102
- end
103
- ```
104
-
105
- #### Using the add_portfolio_excluded_asset_with_http_info variant
106
-
107
- This returns an Array which contains the response data, status code and headers.
108
-
109
- ```ruby
110
- portfolio_group_id = "portfolioGroupId_example"
111
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
112
- symbol = "VAB.TO"
113
- raw_symbol = "VAB"
114
- description = "VANGUARD CDN AGGREGATE BOND INDEX ETF"
115
- currency = {
116
- "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
117
- "code" => "USD",
118
- "name" => "US Dollar",
119
- }
120
- exchange = {
121
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
122
- "code" => "TSX",
123
- "mic_code" => "XTSE",
124
- "name" => "Toronto Stock Exchange",
125
- "timezone" => "America/New_York",
126
- "start_time" => "09:30:00",
127
- "close_time" => "57600",
128
- "suffix" => ".TO",
129
- }
130
- type = {
131
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
132
- "code" => "cs",
133
- "description" => "Common Stock",
134
- "is_supported" => True,
135
- }
136
- currencies = [
137
- {
138
- "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
139
- "code" => "USD",
140
- "name" => "US Dollar",
141
- }
142
- ]
143
-
144
- begin
145
- # Adds an asset to exclude to a portfolio group
146
- data, status_code, headers, response = SnapTrade::PortfolioManagement.add_portfolio_excluded_asset_with_http_info(
147
- portfolio_group_id: portfolio_group_id,
148
- id: id,
149
- symbol: symbol,
150
- raw_symbol: raw_symbol,
151
- description: description,
152
- currency: currency,
153
- exchange: exchange,
154
- type: type,
155
- currencies: currencies,
156
- )
157
- p status_code # => 2xx
158
- p headers # => { ... }
159
- p data # => ExcludedAsset
160
- rescue SnapTrade::ApiError => e
161
- puts "Exception when calling SnapTrade::PortfolioManagement.add_portfolio_excluded_asset: #{e}"
162
- end
163
- ```
164
-
165
- ### Parameters
166
-
167
- | Name | Type | Description | Notes |
168
- | ---- | ---- | ----------- | ----- |
169
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to exclude an asset. | |
170
- | **universal_symbol** | [**UniversalSymbol**](UniversalSymbol.md) | | [optional] |
171
-
172
- ### Return type
173
-
174
- [**ExcludedAsset**](ExcludedAsset.md)
175
-
176
- ## create
177
-
178
- Create new portfolio group
179
-
180
- ### Example
181
-
182
- ```ruby
183
- require 'snaptrade'
184
-
185
- SnapTrade.client_id = "YOUR_CLIENT_ID"
186
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
187
-
188
- user_id = "John.doe@snaptrade.com"
189
- user_secret = "USERSECRET123"
190
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
191
- name = "Combined Retirement Portfolio"
192
-
193
- begin
194
- # Create new portfolio group
195
- result = SnapTrade::PortfolioManagement.create(
196
- user_id: user_id,
197
- user_secret: user_secret,
198
- id: id,
199
- name: name,
200
- )
201
- p result
202
- rescue SnapTrade::ApiError => e
203
- puts "Exception when calling SnapTrade::PortfolioManagement.create: #{e}"
204
- end
205
- ```
206
-
207
- #### Using the create_with_http_info variant
208
-
209
- This returns an Array which contains the response data, status code and headers.
210
-
211
- ```ruby
212
- user_id = "John.doe@snaptrade.com"
213
- user_secret = "USERSECRET123"
214
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
215
- name = "Combined Retirement Portfolio"
216
-
217
- begin
218
- # Create new portfolio group
219
- data, status_code, headers, response = SnapTrade::PortfolioManagement.create_with_http_info(
220
- user_id: user_id,
221
- user_secret: user_secret,
222
- id: id,
223
- name: name,
224
- )
225
- p status_code # => 2xx
226
- p headers # => { ... }
227
- p data # => Array<PortfolioGroup>
228
- rescue SnapTrade::ApiError => e
229
- puts "Exception when calling SnapTrade::PortfolioManagement.create: #{e}"
230
- end
231
- ```
232
-
233
- ### Parameters
234
-
235
- | Name | Type | Description | Notes |
236
- | ---- | ---- | ----------- | ----- |
237
- | **user_id** | **String** | | |
238
- | **user_secret** | **String** | | |
239
- | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | |
240
-
241
- ### Return type
242
-
243
- [**Array&lt;PortfolioGroup&gt;**](PortfolioGroup.md)
244
-
245
- ## create_asset_class
246
-
247
- Create a new model asset class
248
-
249
- ### Example
250
-
251
- ```ruby
252
- require 'snaptrade'
253
-
254
- SnapTrade.client_id = "YOUR_CLIENT_ID"
255
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
256
-
257
- user_id = "John.doe@snaptrade.com"
258
- user_secret = "USERSECRET123"
259
-
260
- begin
261
- # Create a new model asset class
262
- result = SnapTrade::PortfolioManagement.create_asset_class(
263
- user_id: user_id,
264
- user_secret: user_secret,
265
- )
266
- p result
267
- rescue SnapTrade::ApiError => e
268
- puts "Exception when calling SnapTrade::PortfolioManagement.create_asset_class: #{e}"
269
- end
270
- ```
271
-
272
- #### Using the create_asset_class_with_http_info variant
273
-
274
- This returns an Array which contains the response data, status code and headers.
275
-
276
- ```ruby
277
- user_id = "John.doe@snaptrade.com"
278
- user_secret = "USERSECRET123"
279
-
280
- begin
281
- # Create a new model asset class
282
- data, status_code, headers, response = SnapTrade::PortfolioManagement.create_asset_class_with_http_info(
283
- user_id: user_id,
284
- user_secret: user_secret,
285
- )
286
- p status_code # => 2xx
287
- p headers # => { ... }
288
- p data # => ModelAssetClassDetails
289
- rescue SnapTrade::ApiError => e
290
- puts "Exception when calling SnapTrade::PortfolioManagement.create_asset_class: #{e}"
291
- end
292
- ```
293
-
294
- ### Parameters
295
-
296
- | Name | Type | Description | Notes |
297
- | ---- | ---- | ----------- | ----- |
298
- | **user_id** | **String** | | |
299
- | **user_secret** | **String** | | |
300
-
301
- ### Return type
302
-
303
- [**ModelAssetClassDetails**](ModelAssetClassDetails.md)
304
-
305
- ## create_model_portfolio
306
-
307
- Creates a new model portfolio
308
-
309
- ### Example
310
-
311
- ```ruby
312
- require 'snaptrade'
313
-
314
- SnapTrade.client_id = "YOUR_CLIENT_ID"
315
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
316
-
317
-
318
- begin
319
- # Creates a new model portfolio
320
- result = SnapTrade::PortfolioManagement.create_model_portfolio
321
- p result
322
- rescue SnapTrade::ApiError => e
323
- puts "Exception when calling SnapTrade::PortfolioManagement.create_model_portfolio: #{e}"
324
- end
325
- ```
326
-
327
- #### Using the create_model_portfolio_with_http_info variant
328
-
329
- This returns an Array which contains the response data, status code and headers.
330
-
331
- ```ruby
332
-
333
- begin
334
- # Creates a new model portfolio
335
- data, status_code, headers, response = SnapTrade::PortfolioManagement.create_model_portfolio_with_http_info
336
- p status_code # => 2xx
337
- p headers # => { ... }
338
- p data # => ModelPortfolioDetails
339
- rescue SnapTrade::ApiError => e
340
- puts "Exception when calling SnapTrade::PortfolioManagement.create_model_portfolio: #{e}"
341
- end
342
- ```
343
-
344
- ### Parameters
345
-
346
- This endpoint does not need any parameter.
347
-
348
- ### Return type
349
-
350
- [**ModelPortfolioDetails**](ModelPortfolioDetails.md)
351
-
352
- ## delete_asset_class
353
-
354
- Deletes a model asset class
355
-
356
- ### Example
357
-
358
- ```ruby
359
- require 'snaptrade'
360
-
361
- SnapTrade.client_id = "YOUR_CLIENT_ID"
362
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
363
-
364
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
365
-
366
- begin
367
- # Deletes a model asset class
368
- SnapTrade::PortfolioManagement.delete_asset_class(
369
- model_asset_class_id: model_asset_class_id,
370
- )
371
- rescue SnapTrade::ApiError => e
372
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_asset_class: #{e}"
373
- end
374
- ```
375
-
376
- #### Using the delete_asset_class_with_http_info variant
377
-
378
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
379
-
380
- ```ruby
381
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
382
-
383
- begin
384
- # Deletes a model asset class
385
- data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_asset_class_with_http_info(
386
- model_asset_class_id: model_asset_class_id,
387
- )
388
- p status_code # => 2xx
389
- p headers # => { ... }
390
- p data # => nil
391
- rescue SnapTrade::ApiError => e
392
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_asset_class: #{e}"
393
- end
394
- ```
395
-
396
- ### Parameters
397
-
398
- | Name | Type | Description | Notes |
399
- | ---- | ---- | ----------- | ----- |
400
- | **model_asset_class_id** | **String** | The ID of the model asset class to delete. | |
401
-
402
- ### Return type
403
-
404
- nil (empty response body)
405
-
406
- ## delete_excluded_asset
407
-
408
- Unexclude an asset from a portfolio group
409
-
410
- ### Example
411
-
412
- ```ruby
413
- require 'snaptrade'
414
-
415
- SnapTrade.client_id = "YOUR_CLIENT_ID"
416
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
417
-
418
- portfolio_group_id = "portfolioGroupId_example"
419
- symbol_id = "symbolId_example"
420
-
421
- begin
422
- # Unexclude an asset from a portfolio group
423
- SnapTrade::PortfolioManagement.delete_excluded_asset(
424
- portfolio_group_id: portfolio_group_id,
425
- symbol_id: symbol_id,
426
- )
427
- rescue SnapTrade::ApiError => e
428
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_excluded_asset: #{e}"
429
- end
430
- ```
431
-
432
- #### Using the delete_excluded_asset_with_http_info variant
433
-
434
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
435
-
436
- ```ruby
437
- portfolio_group_id = "portfolioGroupId_example"
438
- symbol_id = "symbolId_example"
439
-
440
- begin
441
- # Unexclude an asset from a portfolio group
442
- data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_excluded_asset_with_http_info(
443
- portfolio_group_id: portfolio_group_id,
444
- symbol_id: symbol_id,
445
- )
446
- p status_code # => 2xx
447
- p headers # => { ... }
448
- p data # => nil
449
- rescue SnapTrade::ApiError => e
450
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_excluded_asset: #{e}"
451
- end
452
- ```
453
-
454
- ### Parameters
455
-
456
- | Name | Type | Description | Notes |
457
- | ---- | ---- | ----------- | ----- |
458
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to unexclude an asset. | |
459
- | **symbol_id** | **String** | The ID of the excluded asset Symbol to delete. | |
460
-
461
- ### Return type
462
-
463
- nil (empty response body)
464
-
465
- ## delete_model_portfolio_by_id
466
-
467
- Deletes a model portfolio
468
-
469
- ### Example
470
-
471
- ```ruby
472
- require 'snaptrade'
473
-
474
- SnapTrade.client_id = "YOUR_CLIENT_ID"
475
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
476
-
477
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
478
-
479
- begin
480
- # Deletes a model portfolio
481
- SnapTrade::PortfolioManagement.delete_model_portfolio_by_id(
482
- model_portfolio_id: model_portfolio_id,
483
- )
484
- rescue SnapTrade::ApiError => e
485
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_model_portfolio_by_id: #{e}"
486
- end
487
- ```
488
-
489
- #### Using the delete_model_portfolio_by_id_with_http_info variant
490
-
491
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
492
-
493
- ```ruby
494
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
495
-
496
- begin
497
- # Deletes a model portfolio
498
- data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_model_portfolio_by_id_with_http_info(
499
- model_portfolio_id: model_portfolio_id,
500
- )
501
- p status_code # => 2xx
502
- p headers # => { ... }
503
- p data # => nil
504
- rescue SnapTrade::ApiError => e
505
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_model_portfolio_by_id: #{e}"
506
- end
507
- ```
508
-
509
- ### Parameters
510
-
511
- | Name | Type | Description | Notes |
512
- | ---- | ---- | ----------- | ----- |
513
- | **model_portfolio_id** | **String** | The ID of the model portfolio to delete. | |
514
-
515
- ### Return type
516
-
517
- nil (empty response body)
518
-
519
- ## delete_portfoli
520
-
521
- Remove a target portfolio.
522
-
523
- ### Example
524
-
525
- ```ruby
526
- require 'snaptrade'
527
-
528
- SnapTrade.client_id = "YOUR_CLIENT_ID"
529
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
530
-
531
- portfolio_group_id = "portfolioGroupId_example"
532
-
533
- begin
534
- # Remove a target portfolio.
535
- result = SnapTrade::PortfolioManagement.delete_portfoli(
536
- portfolio_group_id: portfolio_group_id,
537
- )
538
- p result
539
- rescue SnapTrade::ApiError => e
540
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfoli: #{e}"
541
- end
542
- ```
543
-
544
- #### Using the delete_portfoli_with_http_info variant
545
-
546
- This returns an Array which contains the response data, status code and headers.
547
-
548
- ```ruby
549
- portfolio_group_id = "portfolioGroupId_example"
550
-
551
- begin
552
- # Remove a target portfolio.
553
- data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_portfoli_with_http_info(
554
- portfolio_group_id: portfolio_group_id,
555
- )
556
- p status_code # => 2xx
557
- p headers # => { ... }
558
- p data # => PortfolioGroup
559
- rescue SnapTrade::ApiError => e
560
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfoli: #{e}"
561
- end
562
- ```
563
-
564
- ### Parameters
565
-
566
- | Name | Type | Description | Notes |
567
- | ---- | ---- | ----------- | ----- |
568
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to delete. | |
569
-
570
- ### Return type
571
-
572
- [**PortfolioGroup**](PortfolioGroup.md)
573
-
574
- ## delete_portfolio_target_by_id
575
-
576
- Remove a TargetAsset.
577
-
578
- ### Example
579
-
580
- ```ruby
581
- require 'snaptrade'
582
-
583
- SnapTrade.client_id = "YOUR_CLIENT_ID"
584
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
585
-
586
- portfolio_group_id = "portfolioGroupId_example"
587
- target_asset_id = "targetAssetId_example"
588
-
589
- begin
590
- # Remove a TargetAsset.
591
- result = SnapTrade::PortfolioManagement.delete_portfolio_target_by_id(
592
- portfolio_group_id: portfolio_group_id,
593
- target_asset_id: target_asset_id,
594
- )
595
- p result
596
- rescue SnapTrade::ApiError => e
597
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfolio_target_by_id: #{e}"
598
- end
599
- ```
600
-
601
- #### Using the delete_portfolio_target_by_id_with_http_info variant
602
-
603
- This returns an Array which contains the response data, status code and headers.
604
-
605
- ```ruby
606
- portfolio_group_id = "portfolioGroupId_example"
607
- target_asset_id = "targetAssetId_example"
608
-
609
- begin
610
- # Remove a TargetAsset.
611
- data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_portfolio_target_by_id_with_http_info(
612
- portfolio_group_id: portfolio_group_id,
613
- target_asset_id: target_asset_id,
614
- )
615
- p status_code # => 2xx
616
- p headers # => { ... }
617
- p data # => TargetAsset
618
- rescue SnapTrade::ApiError => e
619
- puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfolio_target_by_id: #{e}"
620
- end
621
- ```
622
-
623
- ### Parameters
624
-
625
- | Name | Type | Description | Notes |
626
- | ---- | ---- | ----------- | ----- |
627
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to remove the target asset. | |
628
- | **target_asset_id** | **String** | The ID of the TargetAsset to delete. | |
629
-
630
- ### Return type
631
-
632
- [**TargetAsset**](TargetAsset.md)
633
-
634
- ## detail_asset_class
635
-
636
- Get details of a model asset class
637
-
638
- ### Example
639
-
640
- ```ruby
641
- require 'snaptrade'
642
-
643
- SnapTrade.client_id = "YOUR_CLIENT_ID"
644
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
645
-
646
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
647
- user_id = "John.doe@snaptrade.com"
648
- user_secret = "USERSECRET123"
649
-
650
- begin
651
- # Get details of a model asset class
652
- result = SnapTrade::PortfolioManagement.detail_asset_class(
653
- model_asset_class_id: model_asset_class_id,
654
- user_id: user_id,
655
- user_secret: user_secret,
656
- )
657
- p result
658
- rescue SnapTrade::ApiError => e
659
- puts "Exception when calling SnapTrade::PortfolioManagement.detail_asset_class: #{e}"
660
- end
661
- ```
662
-
663
- #### Using the detail_asset_class_with_http_info variant
664
-
665
- This returns an Array which contains the response data, status code and headers.
666
-
667
- ```ruby
668
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
669
- user_id = "John.doe@snaptrade.com"
670
- user_secret = "USERSECRET123"
671
-
672
- begin
673
- # Get details of a model asset class
674
- data, status_code, headers, response = SnapTrade::PortfolioManagement.detail_asset_class_with_http_info(
675
- model_asset_class_id: model_asset_class_id,
676
- user_id: user_id,
677
- user_secret: user_secret,
678
- )
679
- p status_code # => 2xx
680
- p headers # => { ... }
681
- p data # => ModelAssetClassDetails
682
- rescue SnapTrade::ApiError => e
683
- puts "Exception when calling SnapTrade::PortfolioManagement.detail_asset_class: #{e}"
684
- end
685
- ```
686
-
687
- ### Parameters
688
-
689
- | Name | Type | Description | Notes |
690
- | ---- | ---- | ----------- | ----- |
691
- | **model_asset_class_id** | **String** | The ID of the model asset class to get. | |
692
- | **user_id** | **String** | | |
693
- | **user_secret** | **String** | | |
694
-
695
- ### Return type
696
-
697
- [**ModelAssetClassDetails**](ModelAssetClassDetails.md)
698
-
699
- ## get_calculated_trade_by_id
700
-
701
- Return an individual trade
702
-
703
- ### Example
704
-
705
- ```ruby
706
- require 'snaptrade'
707
-
708
- SnapTrade.client_id = "YOUR_CLIENT_ID"
709
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
710
-
711
- portfolio_group_id = "portfolioGroupId_example"
712
- calculated_trade_id = "calculatedTradeId_example"
713
- trade_id = "TradeId_example"
714
-
715
- begin
716
- # Return an individual trade
717
- result = SnapTrade::PortfolioManagement.get_calculated_trade_by_id(
718
- portfolio_group_id: portfolio_group_id,
719
- calculated_trade_id: calculated_trade_id,
720
- trade_id: trade_id,
721
- )
722
- p result
723
- rescue SnapTrade::ApiError => e
724
- puts "Exception when calling SnapTrade::PortfolioManagement.get_calculated_trade_by_id: #{e}"
725
- end
726
- ```
727
-
728
- #### Using the get_calculated_trade_by_id_with_http_info variant
729
-
730
- This returns an Array which contains the response data, status code and headers.
731
-
732
- ```ruby
733
- portfolio_group_id = "portfolioGroupId_example"
734
- calculated_trade_id = "calculatedTradeId_example"
735
- trade_id = "TradeId_example"
736
-
737
- begin
738
- # Return an individual trade
739
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_calculated_trade_by_id_with_http_info(
740
- portfolio_group_id: portfolio_group_id,
741
- calculated_trade_id: calculated_trade_id,
742
- trade_id: trade_id,
743
- )
744
- p status_code # => 2xx
745
- p headers # => { ... }
746
- p data # => Array<Trade>
747
- rescue SnapTrade::ApiError => e
748
- puts "Exception when calling SnapTrade::PortfolioManagement.get_calculated_trade_by_id: #{e}"
749
- end
750
- ```
751
-
752
- ### Parameters
753
-
754
- | Name | Type | Description | Notes |
755
- | ---- | ---- | ----------- | ----- |
756
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to perform rebalancing calculations | |
757
- | **calculated_trade_id** | **String** | The ID of calculated trade to get account impact | |
758
- | **trade_id** | **String** | The ID of trade object | |
759
-
760
- ### Return type
761
-
762
- [**Array&lt;Trade&gt;**](Trade.md)
763
-
764
- ## get_model_details_by_id
765
-
766
- Get details of a model portfolio
767
-
768
- ### Example
769
-
770
- ```ruby
771
- require 'snaptrade'
772
-
773
- SnapTrade.client_id = "YOUR_CLIENT_ID"
774
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
775
-
776
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
777
-
778
- begin
779
- # Get details of a model portfolio
780
- result = SnapTrade::PortfolioManagement.get_model_details_by_id(
781
- model_portfolio_id: model_portfolio_id,
782
- )
783
- p result
784
- rescue SnapTrade::ApiError => e
785
- puts "Exception when calling SnapTrade::PortfolioManagement.get_model_details_by_id: #{e}"
786
- end
787
- ```
788
-
789
- #### Using the get_model_details_by_id_with_http_info variant
790
-
791
- This returns an Array which contains the response data, status code and headers.
792
-
793
- ```ruby
794
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
795
-
796
- begin
797
- # Get details of a model portfolio
798
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_model_details_by_id_with_http_info(
799
- model_portfolio_id: model_portfolio_id,
800
- )
801
- p status_code # => 2xx
802
- p headers # => { ... }
803
- p data # => ModelPortfolioDetails
804
- rescue SnapTrade::ApiError => e
805
- puts "Exception when calling SnapTrade::PortfolioManagement.get_model_details_by_id: #{e}"
806
- end
807
- ```
808
-
809
- ### Parameters
810
-
811
- | Name | Type | Description | Notes |
812
- | ---- | ---- | ----------- | ----- |
813
- | **model_portfolio_id** | **String** | The ID of the model portfolio to get. | |
814
-
815
- ### Return type
816
-
817
- [**ModelPortfolioDetails**](ModelPortfolioDetails.md)
818
-
819
- ## get_portfolio_balances
820
-
821
- Get sum of cash balances in portfolio group
822
-
823
- ### Example
824
-
825
- ```ruby
826
- require 'snaptrade'
827
-
828
- SnapTrade.client_id = "YOUR_CLIENT_ID"
829
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
830
-
831
- portfolio_group_id = "portfolioGroupId_example"
832
-
833
- begin
834
- # Get sum of cash balances in portfolio group
835
- result = SnapTrade::PortfolioManagement.get_portfolio_balances(
836
- portfolio_group_id: portfolio_group_id,
837
- )
838
- p result
839
- rescue SnapTrade::ApiError => e
840
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_balances: #{e}"
841
- end
842
- ```
843
-
844
- #### Using the get_portfolio_balances_with_http_info variant
845
-
846
- This returns an Array which contains the response data, status code and headers.
847
-
848
- ```ruby
849
- portfolio_group_id = "portfolioGroupId_example"
850
-
851
- begin
852
- # Get sum of cash balances in portfolio group
853
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_balances_with_http_info(
854
- portfolio_group_id: portfolio_group_id,
855
- )
856
- p status_code # => 2xx
857
- p headers # => { ... }
858
- p data # => Array<Balance>
859
- rescue SnapTrade::ApiError => e
860
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_balances: #{e}"
861
- end
862
- ```
863
-
864
- ### Parameters
865
-
866
- | Name | Type | Description | Notes |
867
- | ---- | ---- | ----------- | ----- |
868
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
869
-
870
- ### Return type
871
-
872
- [**Array&lt;Balance&gt;**](Balance.md)
873
-
874
- ## get_portfolio_details_by_id
875
-
876
- Get details of a target portfolio
877
-
878
- ### Example
879
-
880
- ```ruby
881
- require 'snaptrade'
882
-
883
- SnapTrade.client_id = "YOUR_CLIENT_ID"
884
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
885
-
886
- portfolio_group_id = "portfolioGroupId_example"
887
-
888
- begin
889
- # Get details of a target portfolio
890
- result = SnapTrade::PortfolioManagement.get_portfolio_details_by_id(
891
- portfolio_group_id: portfolio_group_id,
892
- )
893
- p result
894
- rescue SnapTrade::ApiError => e
895
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_details_by_id: #{e}"
896
- end
897
- ```
898
-
899
- #### Using the get_portfolio_details_by_id_with_http_info variant
900
-
901
- This returns an Array which contains the response data, status code and headers.
902
-
903
- ```ruby
904
- portfolio_group_id = "portfolioGroupId_example"
905
-
906
- begin
907
- # Get details of a target portfolio
908
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_details_by_id_with_http_info(
909
- portfolio_group_id: portfolio_group_id,
910
- )
911
- p status_code # => 2xx
912
- p headers # => { ... }
913
- p data # => PortfolioGroup
914
- rescue SnapTrade::ApiError => e
915
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_details_by_id: #{e}"
916
- end
917
- ```
918
-
919
- ### Parameters
920
-
921
- | Name | Type | Description | Notes |
922
- | ---- | ---- | ----------- | ----- |
923
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to get. | |
924
-
925
- ### Return type
926
-
927
- [**PortfolioGroup**](PortfolioGroup.md)
928
-
929
- ## get_portfolio_info
930
-
931
- Return a whole bunch of relevant information relating to a portfolio group.
932
-
933
- ### Example
934
-
935
- ```ruby
936
- require 'snaptrade'
937
-
938
- SnapTrade.client_id = "YOUR_CLIENT_ID"
939
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
940
-
941
- portfolio_group_id = "portfolioGroupId_example"
942
-
943
- begin
944
- # Return a whole bunch of relevant information relating to a portfolio group.
945
- result = SnapTrade::PortfolioManagement.get_portfolio_info(
946
- portfolio_group_id: portfolio_group_id,
947
- )
948
- p result
949
- rescue SnapTrade::ApiError => e
950
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_info: #{e}"
951
- end
952
- ```
953
-
954
- #### Using the get_portfolio_info_with_http_info variant
955
-
956
- This returns an Array which contains the response data, status code and headers.
957
-
958
- ```ruby
959
- portfolio_group_id = "portfolioGroupId_example"
960
-
961
- begin
962
- # Return a whole bunch of relevant information relating to a portfolio group.
963
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_info_with_http_info(
964
- portfolio_group_id: portfolio_group_id,
965
- )
966
- p status_code # => 2xx
967
- p headers # => { ... }
968
- p data # => PortfolioGroupInfo
969
- rescue SnapTrade::ApiError => e
970
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_info: #{e}"
971
- end
972
- ```
973
-
974
- ### Parameters
975
-
976
- | Name | Type | Description | Notes |
977
- | ---- | ---- | ----------- | ----- |
978
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
979
-
980
- ### Return type
981
-
982
- [**PortfolioGroupInfo**](PortfolioGroupInfo.md)
983
-
984
- ## get_portfolio_settings
985
-
986
- Get portfolio group settings
987
-
988
- ### Example
989
-
990
- ```ruby
991
- require 'snaptrade'
992
-
993
- SnapTrade.client_id = "YOUR_CLIENT_ID"
994
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
995
-
996
- portfolio_group_id = "portfolioGroupId_example"
997
-
998
- begin
999
- # Get portfolio group settings
1000
- result = SnapTrade::PortfolioManagement.get_portfolio_settings(
1001
- portfolio_group_id: portfolio_group_id,
1002
- )
1003
- p result
1004
- rescue SnapTrade::ApiError => e
1005
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_settings: #{e}"
1006
- end
1007
- ```
1008
-
1009
- #### Using the get_portfolio_settings_with_http_info variant
1010
-
1011
- This returns an Array which contains the response data, status code and headers.
1012
-
1013
- ```ruby
1014
- portfolio_group_id = "portfolioGroupId_example"
1015
-
1016
- begin
1017
- # Get portfolio group settings
1018
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_settings_with_http_info(
1019
- portfolio_group_id: portfolio_group_id,
1020
- )
1021
- p status_code # => 2xx
1022
- p headers # => { ... }
1023
- p data # => PortfolioGroupSettings
1024
- rescue SnapTrade::ApiError => e
1025
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_settings: #{e}"
1026
- end
1027
- ```
1028
-
1029
- ### Parameters
1030
-
1031
- | Name | Type | Description | Notes |
1032
- | ---- | ---- | ----------- | ----- |
1033
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to get the settings. | |
1034
-
1035
- ### Return type
1036
-
1037
- [**PortfolioGroupSettings**](PortfolioGroupSettings.md)
1038
-
1039
- ## get_portfolio_target_by_id
1040
-
1041
- Get a specific target from a portfolio group
1042
-
1043
- ### Example
1044
-
1045
- ```ruby
1046
- require 'snaptrade'
1047
-
1048
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1049
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1050
-
1051
- portfolio_group_id = "portfolioGroupId_example"
1052
- target_asset_id = "targetAssetId_example"
1053
-
1054
- begin
1055
- # Get a specific target from a portfolio group
1056
- result = SnapTrade::PortfolioManagement.get_portfolio_target_by_id(
1057
- portfolio_group_id: portfolio_group_id,
1058
- target_asset_id: target_asset_id,
1059
- )
1060
- p result
1061
- rescue SnapTrade::ApiError => e
1062
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_target_by_id: #{e}"
1063
- end
1064
- ```
1065
-
1066
- #### Using the get_portfolio_target_by_id_with_http_info variant
1067
-
1068
- This returns an Array which contains the response data, status code and headers.
1069
-
1070
- ```ruby
1071
- portfolio_group_id = "portfolioGroupId_example"
1072
- target_asset_id = "targetAssetId_example"
1073
-
1074
- begin
1075
- # Get a specific target from a portfolio group
1076
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_target_by_id_with_http_info(
1077
- portfolio_group_id: portfolio_group_id,
1078
- target_asset_id: target_asset_id,
1079
- )
1080
- p status_code # => 2xx
1081
- p headers # => { ... }
1082
- p data # => TargetAsset
1083
- rescue SnapTrade::ApiError => e
1084
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_target_by_id: #{e}"
1085
- end
1086
- ```
1087
-
1088
- ### Parameters
1089
-
1090
- | Name | Type | Description | Notes |
1091
- | ---- | ---- | ----------- | ----- |
1092
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to get the target asset. | |
1093
- | **target_asset_id** | **String** | The ID of the TargetAsset to get. | |
1094
-
1095
- ### Return type
1096
-
1097
- [**TargetAsset**](TargetAsset.md)
1098
-
1099
- ## get_portfolio_targets
1100
-
1101
- Get all target assets under the specified PortfolioGroup.
1102
-
1103
- ### Example
1104
-
1105
- ```ruby
1106
- require 'snaptrade'
1107
-
1108
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1109
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1110
-
1111
- portfolio_group_id = "portfolioGroupId_example"
1112
-
1113
- begin
1114
- # Get all target assets under the specified PortfolioGroup.
1115
- result = SnapTrade::PortfolioManagement.get_portfolio_targets(
1116
- portfolio_group_id: portfolio_group_id,
1117
- )
1118
- p result
1119
- rescue SnapTrade::ApiError => e
1120
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_targets: #{e}"
1121
- end
1122
- ```
1123
-
1124
- #### Using the get_portfolio_targets_with_http_info variant
1125
-
1126
- This returns an Array which contains the response data, status code and headers.
1127
-
1128
- ```ruby
1129
- portfolio_group_id = "portfolioGroupId_example"
1130
-
1131
- begin
1132
- # Get all target assets under the specified PortfolioGroup.
1133
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_targets_with_http_info(
1134
- portfolio_group_id: portfolio_group_id,
1135
- )
1136
- p status_code # => 2xx
1137
- p headers # => { ... }
1138
- p data # => Array<TargetAsset>
1139
- rescue SnapTrade::ApiError => e
1140
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_targets: #{e}"
1141
- end
1142
- ```
1143
-
1144
- ### Parameters
1145
-
1146
- | Name | Type | Description | Notes |
1147
- | ---- | ---- | ----------- | ----- |
1148
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1149
-
1150
- ### Return type
1151
-
1152
- [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1153
-
1154
- ## get_portoflio_excluded_assets
1155
-
1156
- Get an array of excluded assets associated with a portfolio group\\
1157
-
1158
- ### Example
1159
-
1160
- ```ruby
1161
- require 'snaptrade'
1162
-
1163
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1164
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1165
-
1166
- portfolio_group_id = "portfolioGroupId_example"
1167
-
1168
- begin
1169
- # Get an array of excluded assets associated with a portfolio group\\
1170
- result = SnapTrade::PortfolioManagement.get_portoflio_excluded_assets(
1171
- portfolio_group_id: portfolio_group_id,
1172
- )
1173
- p result
1174
- rescue SnapTrade::ApiError => e
1175
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portoflio_excluded_assets: #{e}"
1176
- end
1177
- ```
1178
-
1179
- #### Using the get_portoflio_excluded_assets_with_http_info variant
1180
-
1181
- This returns an Array which contains the response data, status code and headers.
1182
-
1183
- ```ruby
1184
- portfolio_group_id = "portfolioGroupId_example"
1185
-
1186
- begin
1187
- # Get an array of excluded assets associated with a portfolio group\\
1188
- data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portoflio_excluded_assets_with_http_info(
1189
- portfolio_group_id: portfolio_group_id,
1190
- )
1191
- p status_code # => 2xx
1192
- p headers # => { ... }
1193
- p data # => Array<ExcludedAsset>
1194
- rescue SnapTrade::ApiError => e
1195
- puts "Exception when calling SnapTrade::PortfolioManagement.get_portoflio_excluded_assets: #{e}"
1196
- end
1197
- ```
1198
-
1199
- ### Parameters
1200
-
1201
- | Name | Type | Description | Notes |
1202
- | ---- | ---- | ----------- | ----- |
1203
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which the excluded assets are linked. | |
1204
-
1205
- ### Return type
1206
-
1207
- [**Array&lt;ExcludedAsset&gt;**](ExcludedAsset.md)
1208
-
1209
- ## import_model_portfolio
1210
-
1211
- Import target allocation based on portfolio group
1212
-
1213
- ### Example
1214
-
1215
- ```ruby
1216
- require 'snaptrade'
1217
-
1218
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1219
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1220
-
1221
- portfolio_group_id = "portfolioGroupId_example"
1222
-
1223
- begin
1224
- # Import target allocation based on portfolio group
1225
- result = SnapTrade::PortfolioManagement.import_model_portfolio(
1226
- portfolio_group_id: portfolio_group_id,
1227
- )
1228
- p result
1229
- rescue SnapTrade::ApiError => e
1230
- puts "Exception when calling SnapTrade::PortfolioManagement.import_model_portfolio: #{e}"
1231
- end
1232
- ```
1233
-
1234
- #### Using the import_model_portfolio_with_http_info variant
1235
-
1236
- This returns an Array which contains the response data, status code and headers.
1237
-
1238
- ```ruby
1239
- portfolio_group_id = "portfolioGroupId_example"
1240
-
1241
- begin
1242
- # Import target allocation based on portfolio group
1243
- data, status_code, headers, response = SnapTrade::PortfolioManagement.import_model_portfolio_with_http_info(
1244
- portfolio_group_id: portfolio_group_id,
1245
- )
1246
- p status_code # => 2xx
1247
- p headers # => { ... }
1248
- p data # => Array<TargetAsset>
1249
- rescue SnapTrade::ApiError => e
1250
- puts "Exception when calling SnapTrade::PortfolioManagement.import_model_portfolio: #{e}"
1251
- end
1252
- ```
1253
-
1254
- ### Parameters
1255
-
1256
- | Name | Type | Description | Notes |
1257
- | ---- | ---- | ----------- | ----- |
1258
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1259
-
1260
- ### Return type
1261
-
1262
- [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1263
-
1264
- ## list
1265
-
1266
- List all portfolio groups
1267
-
1268
- ### Example
1269
-
1270
- ```ruby
1271
- require 'snaptrade'
1272
-
1273
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1274
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1275
-
1276
- user_id = "John.doe@snaptrade.com"
1277
- user_secret = "USERSECRET123"
1278
-
1279
- begin
1280
- # List all portfolio groups
1281
- result = SnapTrade::PortfolioManagement.list(
1282
- user_id: user_id,
1283
- user_secret: user_secret,
1284
- )
1285
- p result
1286
- rescue SnapTrade::ApiError => e
1287
- puts "Exception when calling SnapTrade::PortfolioManagement.list: #{e}"
1288
- end
1289
- ```
1290
-
1291
- #### Using the list_with_http_info variant
1292
-
1293
- This returns an Array which contains the response data, status code and headers.
1294
-
1295
- ```ruby
1296
- user_id = "John.doe@snaptrade.com"
1297
- user_secret = "USERSECRET123"
1298
-
1299
- begin
1300
- # List all portfolio groups
1301
- data, status_code, headers, response = SnapTrade::PortfolioManagement.list_with_http_info(
1302
- user_id: user_id,
1303
- user_secret: user_secret,
1304
- )
1305
- p status_code # => 2xx
1306
- p headers # => { ... }
1307
- p data # => Array<PortfolioGroup>
1308
- rescue SnapTrade::ApiError => e
1309
- puts "Exception when calling SnapTrade::PortfolioManagement.list: #{e}"
1310
- end
1311
- ```
1312
-
1313
- ### Parameters
1314
-
1315
- | Name | Type | Description | Notes |
1316
- | ---- | ---- | ----------- | ----- |
1317
- | **user_id** | **String** | | |
1318
- | **user_secret** | **String** | | |
1319
-
1320
- ### Return type
1321
-
1322
- [**Array&lt;PortfolioGroup&gt;**](PortfolioGroup.md)
1323
-
1324
- ## list_asset_classes
1325
-
1326
- List of model asset class
1327
-
1328
- ### Example
1329
-
1330
- ```ruby
1331
- require 'snaptrade'
1332
-
1333
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1334
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1335
-
1336
- user_id = "John.doe@snaptrade.com"
1337
- user_secret = "USERSECRET123"
1338
-
1339
- begin
1340
- # List of model asset class
1341
- result = SnapTrade::PortfolioManagement.list_asset_classes(
1342
- user_id: user_id,
1343
- user_secret: user_secret,
1344
- )
1345
- p result
1346
- rescue SnapTrade::ApiError => e
1347
- puts "Exception when calling SnapTrade::PortfolioManagement.list_asset_classes: #{e}"
1348
- end
1349
- ```
1350
-
1351
- #### Using the list_asset_classes_with_http_info variant
1352
-
1353
- This returns an Array which contains the response data, status code and headers.
1354
-
1355
- ```ruby
1356
- user_id = "John.doe@snaptrade.com"
1357
- user_secret = "USERSECRET123"
1358
-
1359
- begin
1360
- # List of model asset class
1361
- data, status_code, headers, response = SnapTrade::PortfolioManagement.list_asset_classes_with_http_info(
1362
- user_id: user_id,
1363
- user_secret: user_secret,
1364
- )
1365
- p status_code # => 2xx
1366
- p headers # => { ... }
1367
- p data # => Array<ModelAssetClassDetails>
1368
- rescue SnapTrade::ApiError => e
1369
- puts "Exception when calling SnapTrade::PortfolioManagement.list_asset_classes: #{e}"
1370
- end
1371
- ```
1372
-
1373
- ### Parameters
1374
-
1375
- | Name | Type | Description | Notes |
1376
- | ---- | ---- | ----------- | ----- |
1377
- | **user_id** | **String** | | |
1378
- | **user_secret** | **String** | | |
1379
-
1380
- ### Return type
1381
-
1382
- [**Array&lt;ModelAssetClassDetails&gt;**](ModelAssetClassDetails.md)
1383
-
1384
- ## list_calculated_trades
1385
-
1386
- List of trades to make to rebalance portfolio group
1387
-
1388
- ### Example
1389
-
1390
- ```ruby
1391
- require 'snaptrade'
1392
-
1393
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1394
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1395
-
1396
- portfolio_group_id = "portfolioGroupId_example"
1397
-
1398
- begin
1399
- # List of trades to make to rebalance portfolio group
1400
- result = SnapTrade::PortfolioManagement.list_calculated_trades(
1401
- portfolio_group_id: portfolio_group_id,
1402
- )
1403
- p result
1404
- rescue SnapTrade::ApiError => e
1405
- puts "Exception when calling SnapTrade::PortfolioManagement.list_calculated_trades: #{e}"
1406
- end
1407
- ```
1408
-
1409
- #### Using the list_calculated_trades_with_http_info variant
1410
-
1411
- This returns an Array which contains the response data, status code and headers.
1412
-
1413
- ```ruby
1414
- portfolio_group_id = "portfolioGroupId_example"
1415
-
1416
- begin
1417
- # List of trades to make to rebalance portfolio group
1418
- data, status_code, headers, response = SnapTrade::PortfolioManagement.list_calculated_trades_with_http_info(
1419
- portfolio_group_id: portfolio_group_id,
1420
- )
1421
- p status_code # => 2xx
1422
- p headers # => { ... }
1423
- p data # => CalculatedTrade
1424
- rescue SnapTrade::ApiError => e
1425
- puts "Exception when calling SnapTrade::PortfolioManagement.list_calculated_trades: #{e}"
1426
- end
1427
- ```
1428
-
1429
- ### Parameters
1430
-
1431
- | Name | Type | Description | Notes |
1432
- | ---- | ---- | ----------- | ----- |
1433
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to perform rebalancing calculations | |
1434
-
1435
- ### Return type
1436
-
1437
- [**CalculatedTrade**](CalculatedTrade.md)
1438
-
1439
- ## list_model_portfolio
1440
-
1441
- List of model portfolio
1442
-
1443
- ### Example
1444
-
1445
- ```ruby
1446
- require 'snaptrade'
1447
-
1448
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1449
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1450
-
1451
-
1452
- begin
1453
- # List of model portfolio
1454
- result = SnapTrade::PortfolioManagement.list_model_portfolio
1455
- p result
1456
- rescue SnapTrade::ApiError => e
1457
- puts "Exception when calling SnapTrade::PortfolioManagement.list_model_portfolio: #{e}"
1458
- end
1459
- ```
1460
-
1461
- #### Using the list_model_portfolio_with_http_info variant
1462
-
1463
- This returns an Array which contains the response data, status code and headers.
1464
-
1465
- ```ruby
1466
-
1467
- begin
1468
- # List of model portfolio
1469
- data, status_code, headers, response = SnapTrade::PortfolioManagement.list_model_portfolio_with_http_info
1470
- p status_code # => 2xx
1471
- p headers # => { ... }
1472
- p data # => Array<ModelPortfolioDetails>
1473
- rescue SnapTrade::ApiError => e
1474
- puts "Exception when calling SnapTrade::PortfolioManagement.list_model_portfolio: #{e}"
1475
- end
1476
- ```
1477
-
1478
- ### Parameters
1479
-
1480
- This endpoint does not need any parameter.
1481
-
1482
- ### Return type
1483
-
1484
- [**Array&lt;ModelPortfolioDetails&gt;**](ModelPortfolioDetails.md)
1485
-
1486
- ## list_portfolio_accounts
1487
-
1488
- Get all accounts associated with a portfolio group
1489
-
1490
- ### Example
1491
-
1492
- ```ruby
1493
- require 'snaptrade'
1494
-
1495
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1496
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1497
-
1498
- portfolio_group_id = "portfolioGroupId_example"
1499
-
1500
- begin
1501
- # Get all accounts associated with a portfolio group
1502
- result = SnapTrade::PortfolioManagement.list_portfolio_accounts(
1503
- portfolio_group_id: portfolio_group_id,
1504
- )
1505
- p result
1506
- rescue SnapTrade::ApiError => e
1507
- puts "Exception when calling SnapTrade::PortfolioManagement.list_portfolio_accounts: #{e}"
1508
- end
1509
- ```
1510
-
1511
- #### Using the list_portfolio_accounts_with_http_info variant
1512
-
1513
- This returns an Array which contains the response data, status code and headers.
1514
-
1515
- ```ruby
1516
- portfolio_group_id = "portfolioGroupId_example"
1517
-
1518
- begin
1519
- # Get all accounts associated with a portfolio group
1520
- data, status_code, headers, response = SnapTrade::PortfolioManagement.list_portfolio_accounts_with_http_info(
1521
- portfolio_group_id: portfolio_group_id,
1522
- )
1523
- p status_code # => 2xx
1524
- p headers # => { ... }
1525
- p data # => Array<Account>
1526
- rescue SnapTrade::ApiError => e
1527
- puts "Exception when calling SnapTrade::PortfolioManagement.list_portfolio_accounts: #{e}"
1528
- end
1529
- ```
1530
-
1531
- ### Parameters
1532
-
1533
- | Name | Type | Description | Notes |
1534
- | ---- | ---- | ----------- | ----- |
1535
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which the accounts are linked. | |
1536
-
1537
- ### Return type
1538
-
1539
- [**Array&lt;Account&gt;**](Account.md)
1540
-
1541
- ## modify_model_portfolio_by_id
1542
-
1543
- Updates model portfolio object
1544
-
1545
- ### Example
1546
-
1547
- ```ruby
1548
- require 'snaptrade'
1549
-
1550
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1551
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1552
-
1553
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1554
- model_portfolio = {
1555
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1556
- "name" => "Passiv 5x Aggressive Growth Fund",
1557
- "model_type" => -1,
1558
- }
1559
- model_portfolio_security = [
1560
- {
1561
- "percent" => 100,
1562
- }
1563
- ]
1564
- model_portfolio_asset_class = [
1565
- {
1566
- "percent" => 100,
1567
- }
1568
- ]
1569
-
1570
- begin
1571
- # Updates model portfolio object
1572
- SnapTrade::PortfolioManagement.modify_model_portfolio_by_id(
1573
- model_portfolio_id: model_portfolio_id,
1574
- model_portfolio: model_portfolio,
1575
- model_portfolio_security: model_portfolio_security,
1576
- model_portfolio_asset_class: model_portfolio_asset_class,
1577
- )
1578
- rescue SnapTrade::ApiError => e
1579
- puts "Exception when calling SnapTrade::PortfolioManagement.modify_model_portfolio_by_id: #{e}"
1580
- end
1581
- ```
1582
-
1583
- #### Using the modify_model_portfolio_by_id_with_http_info variant
1584
-
1585
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
1586
-
1587
- ```ruby
1588
- model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1589
- model_portfolio = {
1590
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1591
- "name" => "Passiv 5x Aggressive Growth Fund",
1592
- "model_type" => -1,
1593
- }
1594
- model_portfolio_security = [
1595
- {
1596
- "percent" => 100,
1597
- }
1598
- ]
1599
- model_portfolio_asset_class = [
1600
- {
1601
- "percent" => 100,
1602
- }
1603
- ]
1604
-
1605
- begin
1606
- # Updates model portfolio object
1607
- data, status_code, headers, response = SnapTrade::PortfolioManagement.modify_model_portfolio_by_id_with_http_info(
1608
- model_portfolio_id: model_portfolio_id,
1609
- model_portfolio: model_portfolio,
1610
- model_portfolio_security: model_portfolio_security,
1611
- model_portfolio_asset_class: model_portfolio_asset_class,
1612
- )
1613
- p status_code # => 2xx
1614
- p headers # => { ... }
1615
- p data # => nil
1616
- rescue SnapTrade::ApiError => e
1617
- puts "Exception when calling SnapTrade::PortfolioManagement.modify_model_portfolio_by_id: #{e}"
1618
- end
1619
- ```
1620
-
1621
- ### Parameters
1622
-
1623
- | Name | Type | Description | Notes |
1624
- | ---- | ---- | ----------- | ----- |
1625
- | **model_portfolio_id** | **String** | The ID of the model portfolio to update. | |
1626
- | **model_portfolio_details** | [**ModelPortfolioDetails**](ModelPortfolioDetails.md) | Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. &lt;br /&gt;&lt;br /&gt; * The model portfolio name and model portfolio model type is required. &lt;br /&gt; * The model portfolio model type must be either 0 or 1. [0 -&gt; Securities based, 1 -&gt; Asset Class based] &lt;br /&gt;&lt;br /&gt; * If the model portfolio type is 0, the model portfolio asset class must be an empty array. &lt;br /&gt; * If the model portfolio type is 1, the model portfolio security must be an empty array. &lt;br /&gt;&lt;br /&gt; * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object &lt;br /&gt; * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object &lt;br /&gt;&lt;br /&gt; * To remove all model portfolio securities or model portfolio asset class, set then to an empty array | |
1627
-
1628
- ### Return type
1629
-
1630
- nil (empty response body)
1631
-
1632
- ## save_portfolio
1633
-
1634
- Update an existing target portfolio.
1635
-
1636
- ### Example
1637
-
1638
- ```ruby
1639
- require 'snaptrade'
1640
-
1641
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1642
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1643
-
1644
- portfolio_group_id = "portfolioGroupId_example"
1645
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1646
- name = "Combined Retirement Portfolio"
1647
-
1648
- begin
1649
- # Update an existing target portfolio.
1650
- result = SnapTrade::PortfolioManagement.save_portfolio(
1651
- portfolio_group_id: portfolio_group_id,
1652
- id: id,
1653
- name: name,
1654
- )
1655
- p result
1656
- rescue SnapTrade::ApiError => e
1657
- puts "Exception when calling SnapTrade::PortfolioManagement.save_portfolio: #{e}"
1658
- end
1659
- ```
1660
-
1661
- #### Using the save_portfolio_with_http_info variant
1662
-
1663
- This returns an Array which contains the response data, status code and headers.
1664
-
1665
- ```ruby
1666
- portfolio_group_id = "portfolioGroupId_example"
1667
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1668
- name = "Combined Retirement Portfolio"
1669
-
1670
- begin
1671
- # Update an existing target portfolio.
1672
- data, status_code, headers, response = SnapTrade::PortfolioManagement.save_portfolio_with_http_info(
1673
- portfolio_group_id: portfolio_group_id,
1674
- id: id,
1675
- name: name,
1676
- )
1677
- p status_code # => 2xx
1678
- p headers # => { ... }
1679
- p data # => PortfolioGroup
1680
- rescue SnapTrade::ApiError => e
1681
- puts "Exception when calling SnapTrade::PortfolioManagement.save_portfolio: #{e}"
1682
- end
1683
- ```
1684
-
1685
- ### Parameters
1686
-
1687
- | Name | Type | Description | Notes |
1688
- | ---- | ---- | ----------- | ----- |
1689
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to update. | |
1690
- | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | |
1691
-
1692
- ### Return type
1693
-
1694
- [**PortfolioGroup**](PortfolioGroup.md)
1695
-
1696
- ## search_portfolio_symbols
1697
-
1698
- Search for symbols limited to brokerages under the specified portfolio group
1699
-
1700
- ### Example
1701
-
1702
- ```ruby
1703
- require 'snaptrade'
1704
-
1705
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1706
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1707
-
1708
- portfolio_group_id = "portfolioGroupId_example"
1709
- substring = "apple"
1710
-
1711
- begin
1712
- # Search for symbols limited to brokerages under the specified portfolio group
1713
- result = SnapTrade::PortfolioManagement.search_portfolio_symbols(
1714
- portfolio_group_id: portfolio_group_id,
1715
- substring: substring,
1716
- )
1717
- p result
1718
- rescue SnapTrade::ApiError => e
1719
- puts "Exception when calling SnapTrade::PortfolioManagement.search_portfolio_symbols: #{e}"
1720
- end
1721
- ```
1722
-
1723
- #### Using the search_portfolio_symbols_with_http_info variant
1724
-
1725
- This returns an Array which contains the response data, status code and headers.
1726
-
1727
- ```ruby
1728
- portfolio_group_id = "portfolioGroupId_example"
1729
- substring = "apple"
1730
-
1731
- begin
1732
- # Search for symbols limited to brokerages under the specified portfolio group
1733
- data, status_code, headers, response = SnapTrade::PortfolioManagement.search_portfolio_symbols_with_http_info(
1734
- portfolio_group_id: portfolio_group_id,
1735
- substring: substring,
1736
- )
1737
- p status_code # => 2xx
1738
- p headers # => { ... }
1739
- p data # => Array<UniversalSymbol>
1740
- rescue SnapTrade::ApiError => e
1741
- puts "Exception when calling SnapTrade::PortfolioManagement.search_portfolio_symbols: #{e}"
1742
- end
1743
- ```
1744
-
1745
- ### Parameters
1746
-
1747
- | Name | Type | Description | Notes |
1748
- | ---- | ---- | ----------- | ----- |
1749
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to search under | |
1750
- | **symbol_query** | [**SymbolQuery**](SymbolQuery.md) | | [optional] |
1751
-
1752
- ### Return type
1753
-
1754
- [**Array&lt;UniversalSymbol&gt;**](UniversalSymbol.md)
1755
-
1756
- ## set_portfolio_targets
1757
-
1758
- Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
1759
-
1760
- ### Example
1761
-
1762
- ```ruby
1763
- require 'snaptrade'
1764
-
1765
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1766
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1767
-
1768
- portfolio_group_id = "portfolioGroupId_example"
1769
- body = [
1770
- {
1771
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1772
- "percent" => 90,
1773
- "is_supported" => True,
1774
- "is_excluded" => True,
1775
- }
1776
- ]
1777
-
1778
- begin
1779
- # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
1780
- result = SnapTrade::PortfolioManagement.set_portfolio_targets(
1781
- portfolio_group_id: portfolio_group_id,
1782
- body: body,
1783
- )
1784
- p result
1785
- rescue SnapTrade::ApiError => e
1786
- puts "Exception when calling SnapTrade::PortfolioManagement.set_portfolio_targets: #{e}"
1787
- end
1788
- ```
1789
-
1790
- #### Using the set_portfolio_targets_with_http_info variant
1791
-
1792
- This returns an Array which contains the response data, status code and headers.
1793
-
1794
- ```ruby
1795
- portfolio_group_id = "portfolioGroupId_example"
1796
- body = [
1797
- {
1798
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1799
- "percent" => 90,
1800
- "is_supported" => True,
1801
- "is_excluded" => True,
1802
- }
1803
- ]
1804
-
1805
- begin
1806
- # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
1807
- data, status_code, headers, response = SnapTrade::PortfolioManagement.set_portfolio_targets_with_http_info(
1808
- portfolio_group_id: portfolio_group_id,
1809
- body: body,
1810
- )
1811
- p status_code # => 2xx
1812
- p headers # => { ... }
1813
- p data # => Array<TargetAsset>
1814
- rescue SnapTrade::ApiError => e
1815
- puts "Exception when calling SnapTrade::PortfolioManagement.set_portfolio_targets: #{e}"
1816
- end
1817
- ```
1818
-
1819
- ### Parameters
1820
-
1821
- | Name | Type | Description | Notes |
1822
- | ---- | ---- | ----------- | ----- |
1823
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1824
- | **target_asset** | [**Array&lt;TargetAsset&gt;**](TargetAsset.md) | | [optional] |
1825
-
1826
- ### Return type
1827
-
1828
- [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1829
-
1830
- ## update_asset_class
1831
-
1832
- Updates model asset class objects
1833
-
1834
- ### Example
1835
-
1836
- ```ruby
1837
- require 'snaptrade'
1838
-
1839
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1840
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1841
-
1842
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1843
- user_id = "John.doe@snaptrade.com"
1844
- user_secret = "USERSECRET123"
1845
- model_asset_class = {
1846
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1847
- "name" => "Bonds",
1848
- }
1849
- model_asset_class_target = [
1850
- {
1851
- }
1852
- ]
1853
-
1854
- begin
1855
- # Updates model asset class objects
1856
- SnapTrade::PortfolioManagement.update_asset_class(
1857
- model_asset_class_id: model_asset_class_id,
1858
- user_id: user_id,
1859
- user_secret: user_secret,
1860
- model_asset_class: model_asset_class,
1861
- model_asset_class_target: model_asset_class_target,
1862
- )
1863
- rescue SnapTrade::ApiError => e
1864
- puts "Exception when calling SnapTrade::PortfolioManagement.update_asset_class: #{e}"
1865
- end
1866
- ```
1867
-
1868
- #### Using the update_asset_class_with_http_info variant
1869
-
1870
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
1871
-
1872
- ```ruby
1873
- model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1874
- user_id = "John.doe@snaptrade.com"
1875
- user_secret = "USERSECRET123"
1876
- model_asset_class = {
1877
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1878
- "name" => "Bonds",
1879
- }
1880
- model_asset_class_target = [
1881
- {
1882
- }
1883
- ]
1884
-
1885
- begin
1886
- # Updates model asset class objects
1887
- data, status_code, headers, response = SnapTrade::PortfolioManagement.update_asset_class_with_http_info(
1888
- model_asset_class_id: model_asset_class_id,
1889
- user_id: user_id,
1890
- user_secret: user_secret,
1891
- model_asset_class: model_asset_class,
1892
- model_asset_class_target: model_asset_class_target,
1893
- )
1894
- p status_code # => 2xx
1895
- p headers # => { ... }
1896
- p data # => nil
1897
- rescue SnapTrade::ApiError => e
1898
- puts "Exception when calling SnapTrade::PortfolioManagement.update_asset_class: #{e}"
1899
- end
1900
- ```
1901
-
1902
- ### Parameters
1903
-
1904
- | Name | Type | Description | Notes |
1905
- | ---- | ---- | ----------- | ----- |
1906
- | **model_asset_class_id** | **String** | The ID of the model asset class to update. | |
1907
- | **user_id** | **String** | | |
1908
- | **user_secret** | **String** | | |
1909
- | **model_asset_class_details** | [**ModelAssetClassDetails**](ModelAssetClassDetails.md) | Use this endpoint change model asset class name and to add or remove a model asset class target. &lt;br /&gt;&lt;br /&gt; * Only the model asset class name is required for the model asset class object. &lt;br /&gt; * Only the symbol id is required for the symbol object in the model asset class target object. &lt;br /&gt; * To remove all model asset class targets, set the model asset class target as an empty array | |
1910
-
1911
- ### Return type
1912
-
1913
- nil (empty response body)
1914
-
1915
- ## update_portfolio_settings
1916
-
1917
- Updates portfolio group settings
1918
-
1919
- ### Example
1920
-
1921
- ```ruby
1922
- require 'snaptrade'
1923
-
1924
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1925
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1926
-
1927
- portfolio_group_id = "portfolioGroupId_example"
1928
-
1929
- begin
1930
- # Updates portfolio group settings
1931
- result = SnapTrade::PortfolioManagement.update_portfolio_settings(
1932
- portfolio_group_id: portfolio_group_id,
1933
- )
1934
- p result
1935
- rescue SnapTrade::ApiError => e
1936
- puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_settings: #{e}"
1937
- end
1938
- ```
1939
-
1940
- #### Using the update_portfolio_settings_with_http_info variant
1941
-
1942
- This returns an Array which contains the response data, status code and headers.
1943
-
1944
- ```ruby
1945
- portfolio_group_id = "portfolioGroupId_example"
1946
-
1947
- begin
1948
- # Updates portfolio group settings
1949
- data, status_code, headers, response = SnapTrade::PortfolioManagement.update_portfolio_settings_with_http_info(
1950
- portfolio_group_id: portfolio_group_id,
1951
- )
1952
- p status_code # => 2xx
1953
- p headers # => { ... }
1954
- p data # => PortfolioGroupSettings
1955
- rescue SnapTrade::ApiError => e
1956
- puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_settings: #{e}"
1957
- end
1958
- ```
1959
-
1960
- ### Parameters
1961
-
1962
- | Name | Type | Description | Notes |
1963
- | ---- | ---- | ----------- | ----- |
1964
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to patch the settings. | |
1965
-
1966
- ### Return type
1967
-
1968
- [**PortfolioGroupSettings**](PortfolioGroupSettings.md)
1969
-
1970
- ## update_portfolio_target_by_id
1971
-
1972
- Update a TargetAsset under the specified PortfolioGroup.
1973
-
1974
- ### Example
1975
-
1976
- ```ruby
1977
- require 'snaptrade'
1978
-
1979
- SnapTrade.client_id = "YOUR_CLIENT_ID"
1980
- SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1981
-
1982
- portfolio_group_id = "portfolioGroupId_example"
1983
- target_asset_id = "targetAssetId_example"
1984
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1985
- symbol = {
1986
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1987
- "symbol" => "VAB.TO",
1988
- "raw_symbol" => "VAB",
1989
- "description" => "VANGUARD CDN AGGREGATE BOND INDEX ETF",
1990
- }
1991
- percent = 90
1992
- is_supported = True
1993
- is_excluded = True
1994
- meta = {}
1995
-
1996
- begin
1997
- # Update a TargetAsset under the specified PortfolioGroup.
1998
- result = SnapTrade::PortfolioManagement.update_portfolio_target_by_id(
1999
- portfolio_group_id: portfolio_group_id,
2000
- target_asset_id: target_asset_id,
2001
- id: id,
2002
- symbol: symbol,
2003
- percent: percent,
2004
- is_supported: is_supported,
2005
- is_excluded: is_excluded,
2006
- meta: meta,
2007
- )
2008
- p result
2009
- rescue SnapTrade::ApiError => e
2010
- puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_target_by_id: #{e}"
2011
- end
2012
- ```
2013
-
2014
- #### Using the update_portfolio_target_by_id_with_http_info variant
2015
-
2016
- This returns an Array which contains the response data, status code and headers.
2017
-
2018
- ```ruby
2019
- portfolio_group_id = "portfolioGroupId_example"
2020
- target_asset_id = "targetAssetId_example"
2021
- id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
2022
- symbol = {
2023
- "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
2024
- "symbol" => "VAB.TO",
2025
- "raw_symbol" => "VAB",
2026
- "description" => "VANGUARD CDN AGGREGATE BOND INDEX ETF",
2027
- }
2028
- percent = 90
2029
- is_supported = True
2030
- is_excluded = True
2031
- meta = {}
2032
-
2033
- begin
2034
- # Update a TargetAsset under the specified PortfolioGroup.
2035
- data, status_code, headers, response = SnapTrade::PortfolioManagement.update_portfolio_target_by_id_with_http_info(
2036
- portfolio_group_id: portfolio_group_id,
2037
- target_asset_id: target_asset_id,
2038
- id: id,
2039
- symbol: symbol,
2040
- percent: percent,
2041
- is_supported: is_supported,
2042
- is_excluded: is_excluded,
2043
- meta: meta,
2044
- )
2045
- p status_code # => 2xx
2046
- p headers # => { ... }
2047
- p data # => TargetAsset
2048
- rescue SnapTrade::ApiError => e
2049
- puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_target_by_id: #{e}"
2050
- end
2051
- ```
2052
-
2053
- ### Parameters
2054
-
2055
- | Name | Type | Description | Notes |
2056
- | ---- | ---- | ----------- | ----- |
2057
- | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to patch the target asset. | |
2058
- | **target_asset_id** | **String** | The ID of the TargetAsset to patch. | |
2059
- | **target_asset** | [**TargetAsset**](TargetAsset.md) | | |
2060
-
2061
- ### Return type
2062
-
2063
- [**TargetAsset**](TargetAsset.md)
2064
-