diff --git a/api.md b/api.md index 6157766..67a0591 100644 --- a/api.md +++ b/api.md @@ -24,23 +24,23 @@ Methods: - client.entities.retrieve(entityId) -> Entity - client.entities.list() -> EntityListResponse -## PnlSummary +## PnlSummaries Methods: -- client.entities.pnlSummary.retrieve(entityId) -> PnlSummary +- client.entities.pnlSummaries.retrieve(entityId) -> PnlSummary -## RegtMargin +## RegtMargins Methods: -- client.entities.regtMargin.retrieve(entityId) -> RegtMargin +- client.entities.regtMargins.retrieve(entityId) -> RegtMargin -## PortfolioMargin +## PortfolioMargins Methods: -- client.entities.portfolioMargin.retrieve(entityId) -> PortfolioMargin +- client.entities.portfolioMargins.retrieve(entityId) -> PortfolioMargin ## RegtMarginSimulations diff --git a/src/resources/entities/entities.ts b/src/resources/entities/entities.ts index e17bc2f..c6cce93 100644 --- a/src/resources/entities/entities.ts +++ b/src/resources/entities/entities.ts @@ -2,19 +2,18 @@ import { APIResource } from '@clear-street/studio-sdk/resource'; import * as Core from '@clear-street/studio-sdk/core'; -import { PnlSummary } from './pnl-summary'; -import { RegtMargin } from './regt-margin'; -import { PortfolioMargin } from './portfolio-margin'; import * as EntitiesAPI from '@clear-street/studio-sdk/resources/entities/entities'; -import * as PnlSummaryAPI from '@clear-street/studio-sdk/resources/entities/pnl-summary'; -import * as PortfolioMarginAPI from '@clear-street/studio-sdk/resources/entities/portfolio-margin'; -import * as RegtMarginAPI from '@clear-street/studio-sdk/resources/entities/regt-margin'; +import * as PnlSummariesAPI from '@clear-street/studio-sdk/resources/entities/pnl-summaries'; +import * as PortfolioMarginsAPI from '@clear-street/studio-sdk/resources/entities/portfolio-margins'; import * as RegtMarginSimulationsAPI from '@clear-street/studio-sdk/resources/entities/regt-margin-simulations'; +import * as RegtMarginsAPI from '@clear-street/studio-sdk/resources/entities/regt-margins'; export class Entities extends APIResource { - pnlSummary: PnlSummaryAPI.PnlSummary = new PnlSummaryAPI.PnlSummary(this._client); - regtMargin: RegtMarginAPI.RegtMargin = new RegtMarginAPI.RegtMargin(this._client); - portfolioMargin: PortfolioMarginAPI.PortfolioMargin = new PortfolioMarginAPI.PortfolioMargin(this._client); + pnlSummaries: PnlSummariesAPI.PnlSummaries = new PnlSummariesAPI.PnlSummaries(this._client); + regtMargins: RegtMarginsAPI.RegtMargins = new RegtMarginsAPI.RegtMargins(this._client); + portfolioMargins: PortfolioMarginsAPI.PortfolioMargins = new PortfolioMarginsAPI.PortfolioMargins( + this._client, + ); regtMarginSimulations: RegtMarginSimulationsAPI.RegtMarginSimulations = new RegtMarginSimulationsAPI.RegtMarginSimulations(this._client); @@ -553,6 +552,9 @@ export namespace Entities { export import PortfolioMargin = EntitiesAPI.PortfolioMargin; export import RegtMargin = EntitiesAPI.RegtMargin; export import EntityListResponse = EntitiesAPI.EntityListResponse; + export import PnlSummaries = PnlSummariesAPI.PnlSummaries; + export import RegtMargins = RegtMarginsAPI.RegtMargins; + export import PortfolioMargins = PortfolioMarginsAPI.PortfolioMargins; export import RegtMarginSimulations = RegtMarginSimulationsAPI.RegtMarginSimulations; export import SimulationID = RegtMarginSimulationsAPI.SimulationID; export import RegtMarginSimulationCreateResponse = RegtMarginSimulationsAPI.RegtMarginSimulationCreateResponse; diff --git a/src/resources/entities/index.ts b/src/resources/entities/index.ts index 6c9d034..2051976 100644 --- a/src/resources/entities/index.ts +++ b/src/resources/entities/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Entity, PnlSummary, PortfolioMargin, RegtMargin, EntityListResponse, Entities } from './entities'; -export { PnlSummary } from './pnl-summary'; -export { PortfolioMargin } from './portfolio-margin'; -export { RegtMargin } from './regt-margin'; +export { PnlSummaries } from './pnl-summaries'; +export { PortfolioMargins } from './portfolio-margins'; +export { RegtMargins } from './regt-margins'; export { SimulationID, RegtMarginSimulationCreateResponse, diff --git a/src/resources/entities/pnl-summary.ts b/src/resources/entities/pnl-summaries.ts similarity index 91% rename from src/resources/entities/pnl-summary.ts rename to src/resources/entities/pnl-summaries.ts index 3adc3f2..ae8e626 100644 --- a/src/resources/entities/pnl-summary.ts +++ b/src/resources/entities/pnl-summaries.ts @@ -4,7 +4,7 @@ import { APIResource } from '@clear-street/studio-sdk/resource'; import * as Core from '@clear-street/studio-sdk/core'; import * as EntitiesAPI from '@clear-street/studio-sdk/resources/entities/entities'; -export class PnlSummary extends APIResource { +export class PnlSummaries extends APIResource { /** * Get PNL summary for all accounts in an entity. */ diff --git a/src/resources/entities/portfolio-margin.ts b/src/resources/entities/portfolio-margins.ts similarity index 91% rename from src/resources/entities/portfolio-margin.ts rename to src/resources/entities/portfolio-margins.ts index 0d50c7d..570c6b8 100644 --- a/src/resources/entities/portfolio-margin.ts +++ b/src/resources/entities/portfolio-margins.ts @@ -4,7 +4,7 @@ import { APIResource } from '@clear-street/studio-sdk/resource'; import * as Core from '@clear-street/studio-sdk/core'; import * as EntitiesAPI from '@clear-street/studio-sdk/resources/entities/entities'; -export class PortfolioMargin extends APIResource { +export class PortfolioMargins extends APIResource { /** * Get latest portfolio margin calculation for the given entity */ diff --git a/src/resources/entities/regt-margin.ts b/src/resources/entities/regt-margins.ts similarity index 92% rename from src/resources/entities/regt-margin.ts rename to src/resources/entities/regt-margins.ts index bb3febf..a5a7f5a 100644 --- a/src/resources/entities/regt-margin.ts +++ b/src/resources/entities/regt-margins.ts @@ -4,7 +4,7 @@ import { APIResource } from '@clear-street/studio-sdk/resource'; import * as Core from '@clear-street/studio-sdk/core'; import * as EntitiesAPI from '@clear-street/studio-sdk/resources/entities/entities'; -export class RegtMargin extends APIResource { +export class RegtMargins extends APIResource { /** * Get the latest Reg-T margin calculation for the given entity */ diff --git a/tests/api-resources/entities/pnl-summary.test.ts b/tests/api-resources/entities/pnl-summaries.test.ts similarity index 83% rename from tests/api-resources/entities/pnl-summary.test.ts rename to tests/api-resources/entities/pnl-summaries.test.ts index 09d2976..37e32d4 100644 --- a/tests/api-resources/entities/pnl-summary.test.ts +++ b/tests/api-resources/entities/pnl-summaries.test.ts @@ -8,9 +8,9 @@ const studioSDK = new StudioSDK({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource pnlSummary', () => { +describe('resource pnlSummaries', () => { test('retrieve', async () => { - const responsePromise = studioSDK.entities.pnlSummary.retrieve('x'); + const responsePromise = studioSDK.entities.pnlSummaries.retrieve('x'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource pnlSummary', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - studioSDK.entities.pnlSummary.retrieve('x', { path: '/_stainless_unknown_path' }), + studioSDK.entities.pnlSummaries.retrieve('x', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(StudioSDK.NotFoundError); }); }); diff --git a/tests/api-resources/entities/portfolio-margin.test.ts b/tests/api-resources/entities/portfolio-margins.test.ts similarity index 82% rename from tests/api-resources/entities/portfolio-margin.test.ts rename to tests/api-resources/entities/portfolio-margins.test.ts index effe118..cdf2bb1 100644 --- a/tests/api-resources/entities/portfolio-margin.test.ts +++ b/tests/api-resources/entities/portfolio-margins.test.ts @@ -8,9 +8,9 @@ const studioSDK = new StudioSDK({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource portfolioMargin', () => { +describe('resource portfolioMargins', () => { test('retrieve', async () => { - const responsePromise = studioSDK.entities.portfolioMargin.retrieve('x'); + const responsePromise = studioSDK.entities.portfolioMargins.retrieve('x'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource portfolioMargin', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - studioSDK.entities.portfolioMargin.retrieve('x', { path: '/_stainless_unknown_path' }), + studioSDK.entities.portfolioMargins.retrieve('x', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(StudioSDK.NotFoundError); }); }); diff --git a/tests/api-resources/entities/regt-margin.test.ts b/tests/api-resources/entities/regt-margins.test.ts similarity index 83% rename from tests/api-resources/entities/regt-margin.test.ts rename to tests/api-resources/entities/regt-margins.test.ts index 1d90fcb..013e188 100644 --- a/tests/api-resources/entities/regt-margin.test.ts +++ b/tests/api-resources/entities/regt-margins.test.ts @@ -8,9 +8,9 @@ const studioSDK = new StudioSDK({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource regtMargin', () => { +describe('resource regtMargins', () => { test('retrieve', async () => { - const responsePromise = studioSDK.entities.regtMargin.retrieve('x'); + const responsePromise = studioSDK.entities.regtMargins.retrieve('x'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource regtMargin', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - studioSDK.entities.regtMargin.retrieve('x', { path: '/_stainless_unknown_path' }), + studioSDK.entities.regtMargins.retrieve('x', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(StudioSDK.NotFoundError); }); });