From 002f5973266db21f7fbd6ff18caca05f0abe4f77 Mon Sep 17 00:00:00 2001 From: eddiechayes Date: Wed, 24 Jul 2024 16:31:39 -0700 Subject: [PATCH] update ruby-snaptrade integration test --- .../sdks/ruby-snaptrade/api.yaml | 564 +++++++++++++----- .../sdks/ruby-snaptrade/sdks/ruby/README.md | 389 ++++++------ .../ruby-snaptrade/sdks/ruby/lib/snaptrade.rb | 21 +- .../snaptrade/api/account_information_api.rb | 52 +- .../lib/snaptrade/api/authentication_api.rb | 117 +--- .../ruby/lib/snaptrade/api/connections_api.rb | 246 +++++++- .../ruby/lib/snaptrade/api/error_logs_api.rb | 111 ---- .../ruby/lib/snaptrade/api/options_api.rb | 74 ++- .../lib/snaptrade/api/reference_data_api.rb | 124 +++- .../ruby/lib/snaptrade/api/trading_api.rb | 203 +++---- .../models/account_holdings_account.rb | 14 +- .../snaptrade/models/account_order_record.rb | 25 +- .../snaptrade/models/account_sync_status.rb | 17 +- .../models/{action.rb => action_strict.rb} | 6 +- .../sdks/ruby/lib/snaptrade/models/amount.rb | 2 +- .../sdks/ruby/lib/snaptrade/models/balance.rb | 20 +- .../ruby/lib/snaptrade/models/brokerage.rb | 25 +- ...age_authorization_disabled_confirmation.rb | 217 +++++++ ...rage_authorization_refresh_confirmation.rb | 217 +++++++ ..._authorization_type_read_only_brokerage.rb | 4 +- .../models/brokerage_symbol_symbol.rb | 20 +- ...ctions_session_events200_response_inner.rb | 2 +- .../snaptrade/models/delete_user_response.rb | 2 +- ...co_order_request.rb => figi_instrument.rb} | 39 +- .../lib/snaptrade/models/holdings_status.rb | 228 +++++++ .../ruby/lib/snaptrade/models/manual_trade.rb | 6 +- .../lib/snaptrade/models/manual_trade_form.rb | 6 +- .../manual_trade_form_notional_value.rb | 214 +++++++ ...okerage_auth_already_disabled_exception.rb | 228 +++++++ ...del402_brokerage_auth_disabled_response.rb | 228 +++++++ .../model403_feature_not_enabled_response.rb | 228 +++++++ .../lib/snaptrade/models/notional_value.rb | 103 ++++ .../models/option_brokerage_symbol.rb | 235 ++++++++ .../options_place_option_strategy_request.rb | 2 +- .../lib/snaptrade/models/options_position.rb | 2 +- .../{order_type.rb => order_type_strict.rb} | 6 +- .../lib/snaptrade/models/session_event.rb | 2 +- .../snaptrade/models/session_event_type.rb | 14 +- .../snap_trade_holdings_account_account_id.rb | 12 +- ...ade_holdings_account_account_id_balance.rb | 224 +++++++ .../models/snap_trade_holdings_total_value.rb | 2 +- .../snap_trade_register_user_request_body.rb | 2 +- .../snaptrade/models/strategy_order_record.rb | 5 +- .../sdks/ruby/lib/snaptrade/models/symbol.rb | 20 +- .../models/symbol_figi_instrument.rb | 234 ++++++++ .../snaptrade/models/transactions_status.rb | 21 +- .../lib/snaptrade/models/underlying_symbol.rb | 20 +- .../lib/snaptrade/models/universal_symbol.rb | 20 +- .../snaptrade/models/user_i_dand_secret.rb | 4 +- .../snaptrade/models/validated_trade_body.rb | 219 +++++++ .../sdks/ruby/lib/snaptrade/version.rb | 2 +- .../spec/api/account_information_api_spec.rb | 8 +- .../ruby/spec/api/authentication_api_spec.rb | 14 +- .../ruby/spec/api/connections_api_spec.rb | 36 +- .../sdks/ruby/spec/api/error_logs_api_spec.rb | 42 -- .../sdks/ruby/spec/api/options_api_spec.rb | 15 +- .../ruby/spec/api/reference_data_api_spec.rb | 24 +- .../sdks/ruby/spec/api/trading_api_spec.rb | 21 +- .../sdks/ruby/spec/getting_started_spec.rb | 27 +- .../models/account_holdings_account_spec.rb | 6 + .../spec/models/account_order_record_spec.rb | 6 + .../spec/models/account_sync_status_spec.rb | 6 + .../sdks/ruby/spec/models/action_spec.rb | 23 - .../ruby/spec/models/action_strict_spec.rb | 23 + .../sdks/ruby/spec/models/balance_spec.rb | 6 + ...uthorization_disabled_confirmation_spec.rb | 29 + ...authorization_refresh_confirmation_spec.rb | 29 + .../sdks/ruby/spec/models/brokerage_spec.rb | 12 + .../models/brokerage_symbol_symbol_spec.rb | 6 + ...equest_spec.rb => figi_instrument_spec.rb} | 16 +- .../ruby/spec/models/holdings_status_spec.rb | 35 ++ .../manual_trade_form_notional_value_spec.rb | 23 + ...ge_auth_already_disabled_exception_spec.rb | 35 ++ ...2_brokerage_auth_disabled_response_spec.rb | 35 ++ ...el403_feature_not_enabled_response_spec.rb | 35 ++ .../ruby/spec/models/notional_value_spec.rb | 26 + .../models/option_brokerage_symbol_spec.rb | 41 ++ .../sdks/ruby/spec/models/order_type_spec.rb | 23 - .../spec/models/order_type_strict_spec.rb | 23 + ...oldings_account_account_id_balance_spec.rb | 29 + ..._trade_holdings_account_account_id_spec.rb | 6 + .../models/symbol_figi_instrument_spec.rb | 35 ++ .../sdks/ruby/spec/models/symbol_spec.rb | 6 + .../spec/models/transactions_status_spec.rb | 6 + .../spec/models/underlying_symbol_spec.rb | 6 + .../ruby/spec/models/universal_symbol_spec.rb | 6 + .../spec/models/validated_trade_body_spec.rb | 29 + 87 files changed, 4531 insertions(+), 1015 deletions(-) delete mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/error_logs_api.rb rename generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/{action.rb => action_strict.rb} (83%) create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb rename generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/{trading_place_oco_order_request.rb => figi_instrument.rb} (84%) create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/holdings_status.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form_notional_value.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_already_disabled_exception.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_disabled_response.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model403_feature_not_enabled_response.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/notional_value.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/option_brokerage_symbol.rb rename generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/{order_type.rb => order_type_strict.rb} (84%) create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id_balance.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol_figi_instrument.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/validated_trade_body.rb delete mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/error_logs_api_spec.rb delete mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_strict_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_disabled_confirmation_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_refresh_confirmation_spec.rb rename generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/{trading_place_oco_order_request_spec.rb => figi_instrument_spec.rb} (52%) create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/holdings_status_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/manual_trade_form_notional_value_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_disabled_response_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model403_feature_not_enabled_response_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/notional_value_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/option_brokerage_symbol_spec.rb delete mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_strict_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_figi_instrument_spec.rb create mode 100644 generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/validated_trade_body_spec.rb diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/api.yaml b/generator/konfig-integration-tests/sdks/ruby-snaptrade/api.yaml index 9aaac77aa0..196101e02c 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/api.yaml +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/api.yaml @@ -40,8 +40,6 @@ tags: - name: Reference Data description: Retrieve basic information for API use, such as supported brokerages, exchanges, currencies, etc. - - name: Error Logs - description: Retrieve error logs for your SnapTrade users and API requests. - name: Webhooks description: Reach out directly to SnapTrade to enable webhooks in order to be @@ -106,6 +104,9 @@ paths: tags: - Authentication summary: Create SnapTrade user + description: | + Registers a new SnapTrade user under your ClientID. + Most SnapTrade operations require a user to be passed as a parameter. operationId: Authentication_registerSnapTradeUser requestBody: $ref: "#/components/requestBodies/RegisterUserRequestBody" @@ -226,58 +227,14 @@ paths: $ref: "#/components/schemas/404FailedRequestResponse" "500": description: Unexpected Error - /snapTrade/encryptedJWT: - get: - tags: - - Authentication - summary: - Generate encrypted JWT token - operationId: Authentication_getUserJWT - parameters: - - in: query - required: true - name: userId - schema: - $ref: "#/components/schemas/UserID" - - in: query - required: true - name: userSecret - schema: - $ref: "#/components/schemas/UserSecret" - responses: - "200": - description: - Successfully obtained encrypted JWT data. See description on how to - object JWT token - content: - application/json: - schema: - $ref: "#/components/schemas/encryptedResponse" - "400": - description: Bad Request - content: - application/json: - schema: - $ref: "#/components/schemas/400FailedRequestResponse" - "403": - description: Forbidden - content: - application/json: - schema: - $ref: "#/components/schemas/403FailedRequestResponse" - "404": - description: Not Found - content: - application/json: - schema: - $ref: "#/components/schemas/404FailedRequestResponse" - "500": - description: Unexpected Error /snapTrade/resetUserSecret: post: tags: - Authentication summary: Obtain a new user secret for a user + description: | + This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret + is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. operationId: Authentication_resetSnapTradeUserSecret requestBody: $ref: "#/components/requestBodies/ResetUserSecretRequestBody" @@ -313,6 +270,7 @@ paths: tags: - Reference Data summary: Get metadata related to Snaptrade partner + description: Returns useful data related to the specified ClientID, including allowed brokerages and data access. operationId: ReferenceData_getPartnerInfo parameters: [] responses: @@ -352,6 +310,9 @@ paths: summary: List all accounts for the user, plus balances, positions, and orders for each account. + description: | + Lists balances, positions and orders for the specified account. The data returned is similar to + the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. operationId: AccountInformation_getAllUserHoldings parameters: - in: query @@ -402,6 +363,10 @@ paths: tags: - Account Information summary: List balances, positions and orders for the specified account + description: | + Lists balances, positions and orders for the specified account as well as + option_positions and account metadata. The data returned is similar to the + data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. operationId: AccountInformation_getUserHoldings parameters: - in: path @@ -448,6 +413,7 @@ paths: tags: - Account Information summary: List accounts + description: Get a list of all Account objects for the authenticated SnapTrade user. operationId: AccountInformation_listUserAccounts parameters: - in: query @@ -476,6 +442,9 @@ paths: tags: - Account Information summary: Return details of a specific investment account + description: | + Returns an account object with details for the specified account, + including the total account market value. operationId: AccountInformation_getUserAccountDetails parameters: - in: query @@ -495,6 +464,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 responses: "200": description: Details of a specific investment account @@ -508,6 +478,7 @@ paths: tags: - Account Information summary: Update details of an investment account + description: Updates various properties of a specified account. operationId: AccountInformation_updateUserAccount parameters: - in: query @@ -563,6 +534,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 responses: "200": description: List of all balances in investment account @@ -579,6 +551,7 @@ paths: tags: - Account Information summary: List account positions + description: Returns a list of positions in the specified account. operationId: AccountInformation_getUserAccountPositions parameters: - in: query @@ -598,6 +571,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 responses: "200": description: List all positions in investment account @@ -638,7 +612,7 @@ paths: - executed - in: query name: days - description: Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + description: Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. schema: type: integer format: int32 @@ -651,6 +625,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 responses: "200": description: List all orders in account @@ -671,6 +646,7 @@ paths: tags: - Trading summary: Get symbol quotes + description: Returns live quote(s) from the brokerage for the specified symbol(s). operationId: Trading_getUserAccountQuotes parameters: - in: query @@ -700,6 +676,8 @@ paths: description: The ID of the account to get quotes. schema: type: string + format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 responses: "200": description: Returns quotes object with different prices @@ -718,6 +696,9 @@ paths: tags: - Trading summary: Cancel open order in account + description: | + Sends a signal to the brokerage to cancel the specified order. + This will only work if the order has not yet been executed. operationId: Trading_cancelUserAccountOrder parameters: - in: query @@ -737,6 +718,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 requestBody: $ref: '#/components/requestBodies/CancelOrderRequestBody' @@ -769,6 +751,10 @@ paths: - Reference Data summary: Search for symbols available in an account + description: | + Returns a list of universal symbols that are supported by + the specificied account. Returned symbols are based on the + provided search string, matching on ticker and name. operationId: ReferenceData_symbolSearchUserAccount parameters: - in: query @@ -788,6 +774,7 @@ paths: schema: type: string format: uuid + example: 917c8734-8470-4a3e-a18f-57c3f2ee6631 requestBody: content: application/json: @@ -796,7 +783,7 @@ paths: responses: "200": description: - Array of universal symbol supported by account based on substring + List of universal symbol supported by account based on substring sent it content: "*/*": @@ -810,7 +797,9 @@ paths: get: tags: - Options - summary: Get the options holdings in the account + summary: Get account option holdings + description: | + Returns a list of Options Positions. operationId: Options_listOptionHoldings parameters: - in: query @@ -849,7 +838,8 @@ paths: get: tags: - Options - summary: Get the options chain + summary: Get the options chain for a symbol + description: Returns the option chain for the specified symbol in the specified account. operationId: Options_getOptionsChain parameters: - in: query @@ -893,7 +883,9 @@ paths: post: tags: - Options - summary: Creates an option strategy object that will be used to place an option strategy order + summary: Create options strategy + description: | + Creates an option strategy object that will be used to place an option strategy order. operationId: Options_getOptionStrategy parameters: - in: query @@ -935,7 +927,9 @@ paths: get: tags: - Options - summary: Get latest market data of option strategy + summary: Get options strategy quotes + description: | + Returns a Strategy Quotes object which has latest market data of the specified option strategy. operationId: Options_getOptionsStrategyQuote parameters: - in: query @@ -979,7 +973,8 @@ paths: post: tags: - Options - summary: Place an option strategy order on the brokerage + summary: Place an option strategy order + description: Places the option strategy order and returns the order record received from the brokerage. operationId: Options_placeOptionStrategy parameters: - in: query @@ -1024,7 +1019,8 @@ paths: get: tags: - Connections - summary: List all brokerage authorizations for the user + summary: List all brokerage authorizations for the User + description: Returns a list of Brokerage Authorization objects for the user operationId: Connections_listBrokerageAuthorizations parameters: - in: query @@ -1053,6 +1049,7 @@ paths: tags: - Connections summary: Get brokerage authorization details + description: Returns a single brokerage authorization object for the specified ID. operationId: Connections_detailBrokerageAuthorization parameters: - in: path @@ -1084,6 +1081,7 @@ paths: tags: - Connections summary: Delete brokerage authorization + description: Deletes a specified brokerage authorization given by the ID. operationId: Connections_removeBrokerageAuthorization parameters: - in: path @@ -1111,11 +1109,124 @@ paths: description: The specified authorizationId was not found. default: description: Unexpected error. + "/authorizations/{authorizationId}/refresh": + post: + tags: + - Connections + summary: Refresh holdings for a connection + description: Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + operationId: Connections_refreshBrokerageAuthorization + parameters: + - in: path + name: authorizationId + required: true + description: The ID of a brokerage authorization object. + schema: + $ref: "#/components/schemas/Id" + - in: query + required: true + name: userId + schema: + $ref: "#/components/schemas/UserID" + - in: query + required: true + name: userSecret + schema: + $ref: "#/components/schemas/UserSecret" + responses: + "200": + description: Confirmation that the syncs have been scheduled + content: + application/json: + schema: + $ref: "#/components/schemas/BrokerageAuthorizationRefreshConfirmation" + "401": + description: Unauthorized, invalid credentials for this resource + content: + application/json: + schema: + $ref: "#/components/schemas/401FailedRequestResponse" + "402": + description: Unable to sync with brokerage account because the connection is disabled. + content: + application/json: + schema: + $ref: "#/components/schemas/402BrokerageAuthDisabledResponse" + "403": + description: Customer or user does not have access to this feature + content: + application/json: + schema: + $ref: "#/components/schemas/403FeatureNotEnabledResponse" + "404": + description: The requested resource does not exist. + content: + application/json: + schema: + $ref: "#/components/schemas/404FailedRequestResponse" + "/authorizations/{authorizationId}/disable": + post: + tags: + - Connections + summary: Manually disable a connection for testing + description: Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. + Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + operationId: Connections_disableBrokerageAuthorization + parameters: + - in: path + name: authorizationId + required: true + description: The ID of a brokerage authorization object. + schema: + $ref: "#/components/schemas/Id" + - in: query + required: true + name: userId + schema: + $ref: "#/components/schemas/UserID" + - in: query + required: true + name: userSecret + schema: + $ref: "#/components/schemas/UserSecret" + responses: + "200": + description: Confirmation that the connection has been disabled + content: + application/json: + schema: + $ref: "#/components/schemas/BrokerageAuthorizationDisabledConfirmation" + "401": + description: Unauthorized, invalid credentials for this resource + content: + application/json: + schema: + $ref: "#/components/schemas/401FailedRequestResponse" + "402": + description: Unable to sync with brokerage account because the connection is disabled. + content: + application/json: + schema: + $ref: "#/components/schemas/402BrokerageAuthAlreadyDisabledException" + "403": + description: Customer or user does not have access to this feature + content: + application/json: + schema: + $ref: "#/components/schemas/403FeatureNotEnabledResponse" + "404": + description: The requested resource does not exist. + content: + application/json: + schema: + $ref: "#/components/schemas/404FailedRequestResponse" + "/sessionEvents": get: tags: - Connections - summary: List all session events for the partner + summary: Get all session events for a user + description: Returns a list of session events associated with a user. operationId: Connections_sessionEvents parameters: - in: query @@ -1153,7 +1264,8 @@ paths: get: tags: - Reference Data - summary: List brokerages + summary: Get brokerages + description: Returns a list of all defined Brokerage objects. operationId: ReferenceData_listAllBrokerages parameters: [] responses: @@ -1171,7 +1283,8 @@ paths: get: tags: - Reference Data - summary: List of all brokerage authorization types + summary: Get all brokerage authorization types + description: Returns a list of all defined Brokerage authorization Type objects. operationId: ReferenceData_listAllBrokerageAuthorizationType parameters: - in: query @@ -1196,7 +1309,8 @@ paths: get: tags: - Reference Data - summary: List currencies + summary: Get currencies + description: Returns a list of all defined Currency objects. operationId: ReferenceData_listAllCurrencies parameters: [] responses: @@ -1210,37 +1324,12 @@ paths: $ref: "#/components/schemas/Currency" default: description: Unexpected error. - /snapTrade/listUserErrors: - get: - tags: - - Error Logs - summary: Retrieve error logs on behalf of your SnapTrade users - operationId: ErrorLogs_listUserErrors - parameters: - - in: query - required: true - name: userId - schema: - $ref: "#/components/schemas/UserID" - - in: query - required: true - name: userSecret - schema: - $ref: "#/components/schemas/UserSecret" - responses: - "200": - description: A list of all user errors for a particular user in the last 90 days. - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/UserErrorLog" /currencies/rates: get: tags: - Reference Data - summary: List currency exchange rates + summary: Get currency exchange rates + description: Returns a list of all Exchange Rate Pairs for all supported Currencies. operationId: ReferenceData_listAllCurrenciesRates parameters: [] responses: @@ -1256,7 +1345,8 @@ paths: get: tags: - Reference Data - summary: Return the exchange rate of a currency pair + summary: Get exchange rate of a currency pair + description: Returns an Exchange Rate Pair object for the specified Currency Pair. operationId: ReferenceData_getCurrencyExchangeRatePair parameters: - in: path @@ -1276,7 +1366,8 @@ paths: get: tags: - Reference Data - summary: List exchanges + summary: Get exchanges + description: Returns a list of all supported Exchanges. operationId: ReferenceData_getStockExchanges parameters: [] responses: @@ -1312,6 +1403,10 @@ paths: tags: - Reference Data summary: Search for symbols + description: | + Returns a list of Universal Symbol objects that match a defined string. + + Matches on ticker or name. operationId: ReferenceData_getSymbols parameters: [] responses: @@ -1334,7 +1429,8 @@ paths: get: tags: - Reference Data - summary: Get details of a symbol by the ticker or the universal_symbol_id + summary: Get details of a symbol + description: Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. operationId: ReferenceData_getSymbolsByTicker parameters: - in: path @@ -1359,6 +1455,7 @@ paths: tags: - Trading summary: Place a trade with NO validation. + description: Places a specified trade in the specified account. operationId: Trading_placeForceOrder parameters: - in: query @@ -1399,7 +1496,8 @@ paths: post: tags: - Trading - summary: Check impact of trades on account. + summary: Check the impact of a trade on an account + description: Return the trade object and it's impact on the account for the specified order. operationId: Trading_getOrderImpact parameters: - in: query @@ -1440,6 +1538,9 @@ paths: tags: - Trading summary: Place order + description: | + Places the specified trade object. This places the order in the account and + returns the status of the order from the brokerage. operationId: Trading_placeOrder parameters: - in: path @@ -1474,41 +1575,8 @@ paths: $ref: "#/components/schemas/400FailedRequestResponse" "500": description: Unexpected Error - /trade/oco: - post: - deprecated: true - tags: - - Trading - summary: Place a OCO (One Cancels Other) order - operationId: Trading_placeOCOOrder - parameters: - - in: query - required: true - name: userId - schema: - $ref: "#/components/schemas/UserID" - - in: query - required: true - name: userSecret - schema: - $ref: "#/components/schemas/UserSecret" - responses: - "200": - description: Status of order placed - content: - application/json: - schema: - $ref: "#/components/schemas/AccountOrderRecord" - "400": - description: Failed to submit order to broker - content: - application/json: - schema: - $ref: "#/components/schemas/400FailedRequestResponse" - "500": - description: Unexpected Error requestBody: - $ref: "#/components/requestBodies/OCORequestBody" + $ref: "#/components/requestBodies/ValidatedTradeRequestBody" /activities: get: tags: @@ -1663,6 +1731,7 @@ paths: tags: - Webhooks operationId: Webhooks_connectionAdded + description: A webhook that is sent whenever a new connection is added. requestBody: description: Information about a new connection in the system content: @@ -1679,6 +1748,7 @@ paths: tags: - Webhooks operationId: Webhooks_connectionDeleted + description: A webhook that is sent whenever an existing connection is deleted. requestBody: description: Information about the deleted connection content: @@ -1697,6 +1767,7 @@ paths: tags: - Webhooks operationId: Webhooks_userRegistered + description: A webhook that is sent whenever a user is newly registered. requestBody: description: Information about the newly registered user content: @@ -1716,6 +1787,7 @@ paths: tags: - Webhooks operationId: Webhooks_userDeleted + description: A webhook that is sent whenever an existing user is deleted. requestBody: description: Information about the deleted user content: @@ -1733,6 +1805,7 @@ paths: tags: - Webhooks operationId: Webhooks_accountAdded + description: A webhook that is sent whenever a new account is added to an existing brokerage authorization. requestBody: description: Information about the newly added account content: @@ -1746,12 +1819,13 @@ paths: successfully "201": description: Return a 201 status to indicate that the account was added - successfull + successfully /accountDeleted: post: tags: - Webhooks operationId: Webhooks_accountDeleted + description: A webhook that is sent whenever an existing account under a brokerage authorization is deleted. requestBody: description: Information about the deleted account content: @@ -1771,6 +1845,7 @@ paths: tags: - Webhooks operationId: Webhooks_updatedTransactions + description: A webhook that is sent whenever transactions have been updated for an account. requestBody: description: Information about the account for which transactions have been updated content: @@ -1859,8 +1934,12 @@ components: application/json: schema: $ref: "#/components/schemas/ManualTradeForm" - - + ValidatedTradeRequestBody: + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/ValidatedTradeBody" CancelOrderRequestBody: description: The Order ID to be canceled required: true @@ -1891,17 +1970,6 @@ components: description: API Client Secret from brokerage when registering app redirectURI: description: Redirect uri from brokerage when registering app - OCORequestBody: - required: true - content: - application/json: - schema: - type: object - properties: - first_trade_id: - description: The ID of first trade object obtained from trade/impact endpoint - second_trade_id: - description: The ID of second trade object obtained from trade/impact endpoint OptionStrategyRequestBody: required: true @@ -1931,7 +1999,7 @@ components: required: ["order_type", "time_in_force"] properties: order_type: - $ref: "#/components/schemas/OrderType" + $ref: "#/components/schemas/OrderTypeStrict" time_in_force: $ref: "#/components/schemas/TimeInForceStrict" price: @@ -1966,6 +2034,22 @@ components: example: Unable to verify signature sent default_code: example: 1076 + 402BrokerageAuthDisabledResponse: + description: Cannot perform action because connection is disabled + type: object + properties: + detail: + example: Unable to sync with brokerage account because the connection is disabled. + code: + example: 3003 + 402BrokerageAuthAlreadyDisabledException: + description: This connection is already disabled. + type: object + properties: + detail: + example: This connection is already disabled. + code: + example: 3011 403FailedRequestResponse: description: Example for failed request response type: object @@ -1974,6 +2058,14 @@ components: example: User does not have permission to access this resource default_code: example: 1066 + 403FeatureNotEnabledResponse: + description: Example for failed request response + type: object + properties: + detail: + example: Feature is not enabled for this customer or this connection + default_code: + example: 1141 404FailedRequestResponse: description: Example for failed request response type: object @@ -2017,6 +2109,8 @@ components: properties: transactions: $ref: "#/components/schemas/TransactionsStatus" + holdings: + $ref: "#/components/schemas/HoldingsStatus" TransactionsStatus: description: Status of account transaction sync properties: @@ -2024,6 +2118,15 @@ components: type: boolean last_successful_sync: $ref: "#/components/schemas/SyncStatusDate" + first_transaction_date: + $ref: "#/components/schemas/SyncStatusDate" + HoldingsStatus: + description: Status of account holdings sync + properties: + initial_sync_completed: + type: boolean + last_successful_sync: + $ref: "#/components/schemas/HoldingsSyncStatusDate" AccountBalance: description: Balance of the account properties: @@ -2033,7 +2136,7 @@ components: allOf: - $ref: "#/components/schemas/Amount" Amount: - description: Total Value of the account + description: Total value of the account, as reported by the brokerage properties: amount: type: number @@ -2133,6 +2236,11 @@ components: nullable: true items: $ref: "#/components/schemas/Position" + option_positions: + type: array + nullable: true + items: + $ref: "#/components/schemas/OptionsPosition" orders: type: array nullable: true @@ -2158,7 +2266,9 @@ components: action: $ref: "#/components/schemas/Action" total_quantity: - $ref: "#/components/schemas/Units" + nullable: true + allOf: + - $ref: "#/components/schemas/Units" open_quantity: $ref: "#/components/schemas/OpenUnits" canceled_quantity: @@ -2178,7 +2288,13 @@ components: time_placed: $ref: "#/components/schemas/Time" time_updated: - $ref: "#/components/schemas/Time" + nullable: true + allOf: + - $ref: "#/components/schemas/Time" + time_executed: + nullable: true + allOf: + - $ref: "#/components/schemas/Time" expiry_date: $ref: "#/components/schemas/Time" AccountOrderRecordStatus: @@ -2210,7 +2326,7 @@ components: type: object properties: symbol: - $ref: "#/components/schemas/BrokerageSymbol" + $ref: "#/components/schemas/OptionBrokerageSymbol" price: $ref: "#/components/schemas/Price" units: @@ -2649,6 +2765,10 @@ components: institution_name: type: string example: Alpaca + balance: + nullable: true + allOf: + - $ref: "#/components/schemas/AccountBalance" meta: type: object example: @@ -2663,7 +2783,7 @@ components: $ref: "#/components/schemas/Time" SnapTradeHoldingsTotalValue: - description: Summed value of account positions and cash balances + description: Calculated based on the sum of the values of account positions and cash balances type: object properties: value: @@ -2684,6 +2804,10 @@ components: type: number example: 300.71 nullable: true + buying_power: + type: number + example: 410.71 + nullable: true ConsumerKey: description: Shared key used to sign requests type: string @@ -2794,9 +2918,9 @@ components: type: string example: SNAPTRADETEST UserID: - description: SnapTrade User ID + description: SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. type: string - example: John.doe@snaptrade.com + example: snaptrade-user-123 UserSecret: description: SnapTrade User Secret (generated when registering user) type: string @@ -3128,12 +3252,11 @@ components: - v2 - v3 SnapTradeUserID: - description: SnapTrade User ID. Provided by SnapTrade Partner. Can be any - string, as long as it's unique to a user + description: SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. type: string example: snaptrade-user-123 SnapTradeUserSecret: - description: SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user. + description: SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. type: string example: h81@cx1lkalablakwjaltkejraj11= Symbol: @@ -3161,6 +3284,10 @@ components: type: string example: BBG000B9XRY4 nullable: true + figi_instrument: + nullable: true + allOf: + - $ref: "#/components/schemas/FigiInstrument" Timestamp: externalDocs: url: https://en.wikipedia.org/wiki/Unix_time @@ -3227,13 +3354,13 @@ components: name: type: string example: Questrade - description: Name of Brokerage + description: Full name of the brokerage. slug: type: string example: QUESTRADE description: - Slug of Brokerage. It is usually the name of the brokerage in - capital letters + A unique identifier for that brokerage. It is usually the name of the brokerage in + capital letters and will never change. Brokerage: type: object properties: @@ -3242,9 +3369,11 @@ components: name: type: string example: Questrade + description: Full name of the brokerage. display_name: type: string example: Questrade + description: A display-friendly name of the brokerage. description: type: string example: Questrade is an online brokerage firm and wealth management firm based in Canada. It is Canada's largest discount broker. @@ -3252,9 +3381,22 @@ components: type: string format: url example: https://www.snaptrade.com/questrade.logo + aws_s3_square_logo_url: + type: string + format: url + example: https://www.snaptrade.com/questrade.logo + nullable: true + open_url: + type: string + format: url + example: https://www.brokerage.com + nullable: true slug: type: string example: QUESTRADE + description: + A unique identifier for that brokerage. It is usually the name of the brokerage in + capital letters and will never change. url: type: string format: url @@ -3329,6 +3471,20 @@ components: type: object example: identifier: 123456 + BrokerageAuthorizationRefreshConfirmation: + type: object + properties: + detail: + description: Refresh confirmation details + type: string + example: Connection 0b3ebefb-ed47-43df-cd8f-729a4420b5cf scheduled for refresh + BrokerageAuthorizationDisabledConfirmation: + type: object + properties: + detail: + description: Connection disabled confirmation + type: string + example: Connection 0b3ebefb-ed47-43df-cd8f-729a4420b5cf has been disabled SessionEvent: type: object properties: @@ -3337,13 +3493,21 @@ components: session_event_type: type: string enum: - - CONNECTION_FAILED + - OAUTH_REDIRECT - DISCLAIMER_ACCEPTED - BROKERAGE_CONNECTION_INITIATED + - BROKERAGE_RECONNECT_INITIATED - BROKERAGE_AUTHENTICATION - - MFA_AUTHORIZATION + - OAUTH_BROKERAGE_AUTHENTICATION + - MFA_REQUESTED + - MFA_SUBMITTED + - MFA_CHOICE_REQUESTED + - MFA_CHOICE_SUBMITTED - CONNECTION_SUCCESSFUL + - CONNECTION_FAILED - PARTNER_REDIRECT + - CONNECTION_ABORTED + - SESSION_STARTED session_id: $ref: "#/components/schemas/Id" user_id: @@ -3379,6 +3543,17 @@ components: allOf: - $ref: "#/components/schemas/OptionsSymbol" nullable: true + OptionBrokerageSymbol: + description: Option Brokerage symbol + type: object + properties: + id: + $ref: "#/components/schemas/Id" + description: + type: string + example: SPY CALL 7/17 200 + option_symbol: + $ref: "#/components/schemas/OptionsSymbol" PositionSymbol: description: Symbol returned in position object type: object @@ -3730,6 +3905,13 @@ components: example: "2022-01-24" format: date nullable: true + HoldingsSyncStatusDate: + description: + Date in ISO 8601 format or null (YYYY-MM-DD HH:MM:SS.mmmmmmTZ) + type: string + example: "2024-06-28 18:42:46.561408+00:00" + format: datetime + nullable: true TargetAsset: description: Target percentage of a certain asset type: object @@ -3855,15 +4037,17 @@ components: type: string example: 2bcd7cc3-e922-4976-bce1-9855556801c3 order_type: - $ref: "#/components/schemas/OrderType" + $ref: "#/components/schemas/OrderTypeStrict" time_in_force: $ref: "#/components/schemas/TimeInForce" symbol: $ref: "#/components/schemas/ManualTradeSymbol" action: - $ref: "#/components/schemas/Action" + $ref: "#/components/schemas/ActionStrict" units: - $ref: "#/components/schemas/Units" + nullable: true + allOf: + - $ref: "#/components/schemas/Units" price: $ref: "#/components/schemas/Price" ManualTradeSymbol: @@ -3937,9 +4121,9 @@ components: account_id: $ref: "#/components/schemas/Id" action: - $ref: "#/components/schemas/Action" + $ref: "#/components/schemas/ActionStrict" order_type: - $ref: "#/components/schemas/OrderType" + $ref: "#/components/schemas/OrderTypeStrict" price: $ref: "#/components/schemas/Price" stop: @@ -3956,12 +4140,21 @@ components: nullable: true allOf: - $ref: "#/components/schemas/NotionalValue" + ValidatedTradeBody: + description: Validated Trade Form + type: object + properties: + wait_to_confirm: + nullable: true + example: true + type: boolean + description: Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request Cash: description: Cash type: number example: 1.11 nullable: true - OrderType: + OrderTypeStrict: description: Order Type type: string enum: @@ -3969,6 +4162,14 @@ components: - Market - StopLimit - StopLoss + OrderType: + type: string + nullable: true + description: Order Type potential values include (but are not limited to) + - Limit + - Market + - StopLimit + - StopLoss SnapTradeAPIDisclaimerAcceptStatus: description: Status of user acceptance of SnapTrade API disclaimer type: object @@ -3997,12 +4198,23 @@ components: * GTC - Good Til Canceled * GTD - Good Til Date type: string - Action: + ActionStrict: description: Trade Action type: string enum: - BUY - SELL + Action: + type: string + description: Trade Action potential values include (but are not limited to) + - BUY + - SELL + - BUY_COVER + - SELL_SHORT + - BUY_OPEN + - BUY_CLOSE + - SELL_OPEN + - SELL_CLOSE Units: description: Trade Units. Cannot work with notional value. type: number @@ -4024,8 +4236,10 @@ components: nullable: true example: 31.33 NotionalValue: - description: Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca, Alpaca Paper, and Robinhood. Please contact support to get access to place notional trades** - type: number + description: Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca, Alpaca Paper, and Robinhood.** + oneOf: + - type: string + - type: number example: 100.00 StopPrice: description: @@ -4113,6 +4327,18 @@ components: type: number description: Usually but not necessarily an integer example: 5 + FigiInstrument: + description: Open FIGI Identifiers + type: object + properties: + figi_code: + type: string + example: BBG000B9Y5X2 + nullable: true + figi_share_class: + type: string + example: BBG001S5N8V8 + nullable: true UniversalSymbol: description: Universal symbol type: object @@ -4143,6 +4369,10 @@ components: type: string example: BBG000B9XRY4 nullable: true + figi_instrument: + nullable: true + allOf: + - $ref: "#/components/schemas/FigiInstrument" required: - id - symbol @@ -4177,6 +4407,10 @@ components: type: string example: BBG000B9XRY4 nullable: true + figi_instrument: + nullable: true + allOf: + - $ref: "#/components/schemas/FigiInstrument" OptionsSymbol: description: Options Symbol type: object diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/README.md b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/README.md index be3c7b9991..a483c7211b 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/README.md +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/README.md @@ -6,7 +6,7 @@ Connect brokerage accounts to your app for live positions and trading -[![npm](https://img.shields.io/badge/gem-v2.0.4-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.4) +[![npm](https://img.shields.io/badge/gem-v2.0.29-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.29) [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/) @@ -29,16 +29,16 @@ Connect brokerage accounts to your app for live positions and trading * [`snaptrade.account_information.update_user_account`](#snaptradeaccount_informationupdate_user_account) * [`snaptrade.api_status.check`](#snaptradeapi_statuscheck) * [`snaptrade.authentication.delete_snap_trade_user`](#snaptradeauthenticationdelete_snap_trade_user) - * [`snaptrade.authentication.get_user_jwt`](#snaptradeauthenticationget_user_jwt) * [`snaptrade.authentication.list_snap_trade_users`](#snaptradeauthenticationlist_snap_trade_users) * [`snaptrade.authentication.login_snap_trade_user`](#snaptradeauthenticationlogin_snap_trade_user) * [`snaptrade.authentication.register_snap_trade_user`](#snaptradeauthenticationregister_snap_trade_user) * [`snaptrade.authentication.reset_snap_trade_user_secret`](#snaptradeauthenticationreset_snap_trade_user_secret) * [`snaptrade.connections.detail_brokerage_authorization`](#snaptradeconnectionsdetail_brokerage_authorization) + * [`snaptrade.connections.disable_brokerage_authorization`](#snaptradeconnectionsdisable_brokerage_authorization) * [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations) + * [`snaptrade.connections.refresh_brokerage_authorization`](#snaptradeconnectionsrefresh_brokerage_authorization) * [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization) * [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events) - * [`snaptrade.error_logs.list_user_errors`](#snaptradeerror_logslist_user_errors) * [`snaptrade.options.get_option_strategy`](#snaptradeoptionsget_option_strategy) * [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain) * [`snaptrade.options.get_options_strategy_quote`](#snaptradeoptionsget_options_strategy_quote) @@ -59,7 +59,6 @@ Connect brokerage accounts to your app for live positions and trading * [`snaptrade.trading.get_order_impact`](#snaptradetradingget_order_impact) * [`snaptrade.trading.get_user_account_quotes`](#snaptradetradingget_user_account_quotes) * [`snaptrade.trading.place_force_order`](#snaptradetradingplace_force_order) - * [`snaptrade.trading.place_oco_order`](#snaptradetradingplace_oco_order) * [`snaptrade.trading.place_order`](#snaptradetradingplace_order) * [`snaptrade.transactions_and_reporting.get_activities`](#snaptradetransactions_and_reportingget_activities) * [`snaptrade.transactions_and_reporting.get_reporting_custom_range`](#snaptradetransactions_and_reportingget_reporting_custom_range) @@ -71,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading Add to Gemfile: ```ruby -gem 'snaptrade', '~> 2.0.4' +gem 'snaptrade', '~> 2.0.29' ``` ## Getting Started @@ -79,10 +78,12 @@ gem 'snaptrade', '~> 2.0.4' ```ruby require 'snaptrade' -SnapTrade.client_id = "YOUR_CLIENT_ID" -SnapTrade.consumer_key = "YOUR_CONSUMER_KEY" +configuration = SnapTrade::Configuration.new +configuration.client_id = ENV["SNAPTRADE_CLIENT_ID"] +configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"] +snaptrade = SnapTrade::Client.new(configuration) result = snaptrade.account_information.get_all_user_holdings( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) @@ -95,7 +96,7 @@ To access the raw HTTP response, suffix any method with `_with_http_info`. ```ruby result = snaptrade.account_information.get_all_user_holdings_with_http_info( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) @@ -111,13 +112,15 @@ p.result[3] # [Faraday::Response] Raw HTTP response ### `snaptrade.account_information.get_all_user_holdings` ![Deprecated](https://img.shields.io/badge/deprecated-yellow) -List all accounts for the user, plus balances, positions, and orders for each account. +Lists balances, positions and orders for the specified account. The data returned is similar to +the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + #### 🛠️ Usage ```ruby result = snaptrade.account_information.get_all_user_holdings( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) @@ -153,9 +156,9 @@ A list of account balances for the specified account (one per currency that the ```ruby result = snaptrade.account_information.get_user_account_balance( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) p result ``` @@ -182,15 +185,17 @@ The ID of the account to get balances. ### `snaptrade.account_information.get_user_account_details` -Return details of a specific investment account +Returns an account object with details for the specified account, +including the total account market value. + #### 🛠️ Usage ```ruby result = snaptrade.account_information.get_user_account_details( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) p result ``` @@ -223,9 +228,9 @@ Fetch all recent orders from a user's account. ```ruby result = snaptrade.account_information.get_user_account_orders( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", state: "all", days: 30, ) @@ -244,7 +249,7 @@ defaults value is set to \"all\" ##### days: `Integer` Number of days in the past to fetch the most recent orders. Defaults to the last -90 days if no value is passed in. +30 days if no value is passed in. #### 🔄 Return @@ -261,15 +266,15 @@ Number of days in the past to fetch the most recent orders. Defaults to the last ### `snaptrade.account_information.get_user_account_positions` -List account positions +Returns a list of positions in the specified account. #### 🛠️ Usage ```ruby result = snaptrade.account_information.get_user_account_positions( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", ) p result ``` @@ -296,14 +301,17 @@ The ID of the account to get positions. ### `snaptrade.account_information.get_user_holdings` -List balances, positions and orders for the specified account +Lists balances, positions and orders for the specified account as well as +option_positions and account metadata. The data returned is similar to the +data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + #### 🛠️ Usage ```ruby result = snaptrade.account_information.get_user_holdings( account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", ) p result @@ -331,13 +339,13 @@ The ID of the account to fetch holdings for. ### `snaptrade.account_information.list_user_accounts` -List accounts +Get a list of all Account objects for the authenticated SnapTrade user. #### 🛠️ Usage ```ruby result = snaptrade.account_information.list_user_accounts( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", ) p result @@ -362,13 +370,13 @@ p result ### `snaptrade.account_information.update_user_account` -Update details of an investment account +Updates various properties of a specified account. #### 🛠️ Usage ```ruby result = snaptrade.account_information.update_user_account( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "accountId_example", ) @@ -427,7 +435,7 @@ Deletes a user you've registered over the SnapTrade API, and any data associated ```ruby result = snaptrade.authentication.delete_snap_trade_user( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", ) p result ``` @@ -448,37 +456,6 @@ p result --- -### `snaptrade.authentication.get_user_jwt` - -Generate encrypted JWT token - -#### 🛠️ Usage - -```ruby -result = snaptrade.authentication.get_user_jwt( - user_id: "John.doe@snaptrade.com", - user_secret: "USERSECRET123", -) -p result -``` - -#### ⚙️ Parameters - -##### user_id: `String` -##### user_secret: `String` -#### 🔄 Return - -[EncryptedResponse](./lib/snaptrade/models/encrypted_response.rb) - -#### 🌐 Endpoint - -`/snapTrade/encryptedJWT` `GET` - -[🔙 **Back to Table of Contents**](#table-of-contents) - ---- - - ### `snaptrade.authentication.list_snap_trade_users` Returns a list of users you've registered over the SnapTrade API. @@ -507,7 +484,7 @@ Logs in a SnapTrade user and returns an authenticated connection portal URL for ```ruby result = snaptrade.authentication.login_snap_trade_user( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", broker: "ALPACA", immediate_redirect: true, @@ -559,7 +536,9 @@ Sets the version of the connection portal to render, with a default to 'v2' ### `snaptrade.authentication.register_snap_trade_user` -Create SnapTrade user +Registers a new SnapTrade user under your ClientID. +Most SnapTrade operations require a user to be passed as a parameter. + #### 🛠️ Usage @@ -573,8 +552,10 @@ p result #### ⚙️ Parameters ##### userId: `String` -SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as -it's unique to a user +SnapTrade User ID. This is chosen by the API partner and can be any string that +is a) unique to the user, and b) immutable for the user. It is recommended to +NOT use email addresses for this property because they are usually not +immutable. #### 🔄 Return @@ -591,7 +572,9 @@ it's unique to a user ### `snaptrade.authentication.reset_snap_trade_user_secret` -Obtain a new user secret for a user +This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret +is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. + #### 🛠️ Usage @@ -606,13 +589,14 @@ p result #### ⚙️ Parameters ##### userId: `String` -SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as -it's unique to a user +SnapTrade User ID. This is chosen by the API partner and can be any string that +is a) unique to the user, and b) immutable for the user. It is recommended to +NOT use email addresses for this property because they are usually not +immutable. ##### userSecret: `String` -SnapTrade User Secret randomly generated by SnapTrade. This should be considered -priviledged information and if compromised, you should delete and re-create this -SnapTrade user. +SnapTrade User Secret randomly generated by SnapTrade. This is privileged +information and if compromised, should be rotated via the SnapTrade API. #### 🔄 Return @@ -629,14 +613,14 @@ SnapTrade user. ### `snaptrade.connections.detail_brokerage_authorization` -Get brokerage authorization details +Returns a single brokerage authorization object for the specified ID. #### 🛠️ Usage ```ruby result = snaptrade.connections.detail_brokerage_authorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", ) p result @@ -662,15 +646,50 @@ The ID of a brokerage authorization object. --- +### `snaptrade.connections.disable_brokerage_authorization` + +Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + +#### 🛠️ Usage + +```ruby +result = snaptrade.connections.disable_brokerage_authorization( + authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", + user_id: "snaptrade-user-123", + user_secret: "USERSECRET123", +) +p result +``` + +#### ⚙️ Parameters + +##### authorization_id: `String` +The ID of a brokerage authorization object. + +##### user_id: `String` +##### user_secret: `String` +#### 🔄 Return + +[BrokerageAuthorizationDisabledConfirmation](./lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb) + +#### 🌐 Endpoint + +`/authorizations/{authorizationId}/disable` `POST` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + + ### `snaptrade.connections.list_brokerage_authorizations` -List all brokerage authorizations for the user +Returns a list of Brokerage Authorization objects for the user #### 🛠️ Usage ```ruby result = snaptrade.connections.list_brokerage_authorizations( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", ) p result @@ -693,100 +712,104 @@ p result --- -### `snaptrade.connections.remove_brokerage_authorization` +### `snaptrade.connections.refresh_brokerage_authorization` -Delete brokerage authorization +Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes #### 🛠️ Usage ```ruby -snaptrade.connections.remove_brokerage_authorization( +result = snaptrade.connections.refresh_brokerage_authorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", ) +p result ``` #### ⚙️ Parameters ##### authorization_id: `String` -The ID of the Authorization to delete. +The ID of a brokerage authorization object. ##### user_id: `String` ##### user_secret: `String` +#### 🔄 Return + +[BrokerageAuthorizationRefreshConfirmation](./lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb) + #### 🌐 Endpoint -`/authorizations/{authorizationId}` `DELETE` +`/authorizations/{authorizationId}/refresh` `POST` [🔙 **Back to Table of Contents**](#table-of-contents) --- -### `snaptrade.connections.session_events` +### `snaptrade.connections.remove_brokerage_authorization` -List all session events for the partner +Deletes a specified brokerage authorization given by the ID. #### 🛠️ Usage ```ruby -result = snaptrade.connections.session_events( - partner_client_id: "SNAPTRADETEST", - user_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", - session_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", +snaptrade.connections.remove_brokerage_authorization( + authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", + user_id: "snaptrade-user-123", + user_secret: "USERSECRET123", ) -p result ``` #### ⚙️ Parameters -##### partner_client_id: `String` -##### user_id: `String` -Optional comma seperated list of user IDs used to filter the request on specific -users - -##### session_id: `String` -Optional comma seperated list of session IDs used to filter the request on -specific users - -#### 🔄 Return - -[ConnectionsSessionEvents200ResponseInner](./lib/snaptrade/models/connections_session_events200_response_inner.rb) +##### authorization_id: `String` +The ID of the Authorization to delete. +##### user_id: `String` +##### user_secret: `String` #### 🌐 Endpoint -`/sessionEvents` `GET` +`/authorizations/{authorizationId}` `DELETE` [🔙 **Back to Table of Contents**](#table-of-contents) --- -### `snaptrade.error_logs.list_user_errors` +### `snaptrade.connections.session_events` -Retrieve error logs on behalf of your SnapTrade users +Returns a list of session events associated with a user. #### 🛠️ Usage ```ruby -result = snaptrade.error_logs.list_user_errors( - user_id: "John.doe@snaptrade.com", - user_secret: "USERSECRET123", +result = snaptrade.connections.session_events( + partner_client_id: "SNAPTRADETEST", + user_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", + session_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", ) p result ``` #### ⚙️ Parameters +##### partner_client_id: `String` ##### user_id: `String` -##### user_secret: `String` +Optional comma seperated list of user IDs used to filter the request on specific +users + +##### session_id: `String` +Optional comma seperated list of session IDs used to filter the request on +specific users + #### 🔄 Return -[UserErrorLog](./lib/snaptrade/models/user_error_log.rb) +[ConnectionsSessionEvents200ResponseInner](./lib/snaptrade/models/connections_session_events200_response_inner.rb) #### 🌐 Endpoint -`/snapTrade/listUserErrors` `GET` +`/sessionEvents` `GET` [🔙 **Back to Table of Contents**](#table-of-contents) @@ -795,7 +818,8 @@ p result ### `snaptrade.options.get_option_strategy` -Creates an option strategy object that will be used to place an option strategy order +Creates an option strategy object that will be used to place an option strategy order. + #### 🛠️ Usage @@ -810,7 +834,7 @@ result = snaptrade.options.get_option_strategy( } ], strategy_type: "CUSTOM", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "accountId_example", ) @@ -842,13 +866,13 @@ The ID of the account to create the option strategy object in. ### `snaptrade.options.get_options_chain` -Get the options chain +Returns the option chain for the specified symbol in the specified account. #### 🛠️ Usage ```ruby result = snaptrade.options.get_options_chain( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "accountId_example", symbol: "symbol_example", @@ -881,13 +905,14 @@ Universal symbol ID if symbol ### `snaptrade.options.get_options_strategy_quote` -Get latest market data of option strategy +Returns a Strategy Quotes object which has latest market data of the specified option strategy. + #### 🛠️ Usage ```ruby result = snaptrade.options.get_options_strategy_quote( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "accountId_example", option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", @@ -920,13 +945,14 @@ Option strategy id obtained from response when creating option strategy object ### `snaptrade.options.list_option_holdings` -Get the options holdings in the account +Returns a list of Options Positions. + #### 🛠️ Usage ```ruby result = snaptrade.options.list_option_holdings( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "accountId_example", ) @@ -955,7 +981,7 @@ The ID of the account to fetch options holdings for. ### `snaptrade.options.place_option_strategy` -Place an option strategy order on the brokerage +Places the option strategy order and returns the order record received from the brokerage. #### 🛠️ Usage @@ -963,7 +989,7 @@ Place an option strategy order on the brokerage result = snaptrade.options.place_option_strategy( order_type: "Limit", time_in_force: "FOK", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", @@ -974,7 +1000,7 @@ p result #### ⚙️ Parameters -##### order_type: [`OrderType`](./lib/snaptrade/models/order_type.rb) +##### order_type: [`OrderTypeStrict`](./lib/snaptrade/models/order_type_strict.rb) Order Type ##### time_in_force: [`TimeInForceStrict`](./lib/snaptrade/models/time_in_force_strict.rb) @@ -1007,7 +1033,7 @@ Trade Price if limit or stop limit order ### `snaptrade.reference_data.get_currency_exchange_rate_pair` -Return the exchange rate of a currency pair +Returns an Exchange Rate Pair object for the specified Currency Pair. #### 🛠️ Usage @@ -1038,7 +1064,7 @@ A currency pair based on currency code for example, {CAD-USD} ### `snaptrade.reference_data.get_partner_info` -Get metadata related to Snaptrade partner +Returns useful data related to the specified ClientID, including allowed brokerages and data access. #### 🛠️ Usage @@ -1086,7 +1112,7 @@ p result ### `snaptrade.reference_data.get_stock_exchanges` -List exchanges +Returns a list of all supported Exchanges. #### 🛠️ Usage @@ -1110,7 +1136,10 @@ p result ### `snaptrade.reference_data.get_symbols` -Search for symbols +Returns a list of Universal Symbol objects that match a defined string. + +Matches on ticker or name. + #### 🛠️ Usage @@ -1139,7 +1168,7 @@ p result ### `snaptrade.reference_data.get_symbols_by_ticker` -Get details of a symbol by the ticker or the universal_symbol_id +Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. #### 🛠️ Usage @@ -1170,7 +1199,7 @@ The ticker or universal_symbol_id of the UniversalSymbol to get. ### `snaptrade.reference_data.list_all_brokerage_authorization_type` -List of all brokerage authorization types +Returns a list of all defined Brokerage authorization Type objects. #### 🛠️ Usage @@ -1201,7 +1230,7 @@ Comma separated value of brokerage slugs ### `snaptrade.reference_data.list_all_brokerages` -List brokerages +Returns a list of all defined Brokerage objects. #### 🛠️ Usage @@ -1225,7 +1254,7 @@ p result ### `snaptrade.reference_data.list_all_currencies` -List currencies +Returns a list of all defined Currency objects. #### 🛠️ Usage @@ -1249,7 +1278,7 @@ p result ### `snaptrade.reference_data.list_all_currencies_rates` -List currency exchange rates +Returns a list of all Exchange Rate Pairs for all supported Currencies. #### 🛠️ Usage @@ -1273,15 +1302,18 @@ p result ### `snaptrade.reference_data.symbol_search_user_account` -Search for symbols available in an account +Returns a list of universal symbols that are supported by +the specificied account. Returned symbols are based on the +provided search string, matching on ticker and name. + #### 🛠️ Usage ```ruby result = snaptrade.reference_data.symbol_search_user_account( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", substring: "apple", ) p result @@ -1310,15 +1342,17 @@ The ID of the account to search for symbols within. ### `snaptrade.trading.cancel_user_account_order` -Cancel open order in account +Sends a signal to the brokerage to cancel the specified order. +This will only work if the order has not yet been executed. + #### 🛠️ Usage ```ruby result = snaptrade.trading.cancel_user_account_order( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", brokerage_order_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", ) p result @@ -1347,13 +1381,13 @@ The ID of the account to cancel the order in. ### `snaptrade.trading.get_order_impact` -Check impact of trades on account. +Return the trade object and it's impact on the account for the specified order. #### 🛠️ Usage ```ruby result = snaptrade.trading.get_order_impact( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", action: "BUY", @@ -1363,7 +1397,7 @@ result = snaptrade.trading.get_order_impact( time_in_force: "FOK", units: 3.14, universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", - notional_value: 100, + notional_value: None, ) p result ``` @@ -1373,10 +1407,10 @@ p result ##### user_id: `String` ##### user_secret: `String` ##### account_id: `String` -##### action: [`Action`](./lib/snaptrade/models/action.rb) +##### action: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb) Trade Action -##### order_type: [`OrderType`](./lib/snaptrade/models/order_type.rb) +##### order_type: [`OrderTypeStrict`](./lib/snaptrade/models/order_type_strict.rb) Order Type ##### price: `Float` @@ -1391,7 +1425,7 @@ Canceled ##### units: [`Float`](./lib/snaptrade/models/float.rb) ##### universal_symbol_id: `String` -##### notional_value: [`Float`](./lib/snaptrade/models/float.rb) +##### notional_value: [`ManualTradeFormNotionalValue`](./lib/snaptrade/models/manual_trade_form_notional_value.rb) #### 🔄 Return [ManualTradeAndImpact](./lib/snaptrade/models/manual_trade_and_impact.rb) @@ -1407,16 +1441,16 @@ Canceled ### `snaptrade.trading.get_user_account_quotes` -Get symbol quotes +Returns live quote(s) from the brokerage for the specified symbol(s). #### 🛠️ Usage ```ruby result = snaptrade.trading.get_user_account_quotes( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", symbols: "symbols_example", - account_id: "accountId_example", + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", use_ticker: true, ) p result @@ -1450,13 +1484,13 @@ Should be set to True if providing tickers. ### `snaptrade.trading.place_force_order` -Place a trade with NO validation. +Places a specified trade in the specified account. #### 🛠️ Usage ```ruby result = snaptrade.trading.place_force_order( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", action: "BUY", @@ -1466,7 +1500,7 @@ result = snaptrade.trading.place_force_order( time_in_force: "FOK", units: 3.14, universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", - notional_value: 100, + notional_value: None, ) p result ``` @@ -1476,10 +1510,10 @@ p result ##### user_id: `String` ##### user_secret: `String` ##### account_id: `String` -##### action: [`Action`](./lib/snaptrade/models/action.rb) +##### action: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb) Trade Action -##### order_type: [`OrderType`](./lib/snaptrade/models/order_type.rb) +##### order_type: [`OrderTypeStrict`](./lib/snaptrade/models/order_type_strict.rb) Order Type ##### price: `Float` @@ -1494,7 +1528,7 @@ Canceled ##### units: [`Float`](./lib/snaptrade/models/float.rb) ##### universal_symbol_id: `String` -##### notional_value: [`Float`](./lib/snaptrade/models/float.rb) +##### notional_value: [`ManualTradeFormNotionalValue`](./lib/snaptrade/models/manual_trade_form_notional_value.rb) #### 🔄 Return [AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb) @@ -1508,57 +1542,20 @@ Canceled --- -### `snaptrade.trading.place_oco_order` -![Deprecated](https://img.shields.io/badge/deprecated-yellow) - -Place a OCO (One Cancels Other) order - -#### 🛠️ Usage - -```ruby -result = snaptrade.trading.place_oco_order( - user_id: "John.doe@snaptrade.com", - user_secret: "USERSECRET123", - first_trade_id: None, - second_trade_id: None, -) -p result -``` - -#### ⚙️ Parameters - -##### user_id: `String` -##### user_secret: `String` -##### first_trade_id: `Object` -The ID of first trade object obtained from trade/impact endpoint - -##### second_trade_id: `Object` -The ID of second trade object obtained from trade/impact endpoint - -#### 🔄 Return - -[AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb) - -#### 🌐 Endpoint - -`/trade/oco` `POST` - -[🔙 **Back to Table of Contents**](#table-of-contents) - ---- - - ### `snaptrade.trading.place_order` -Place order +Places the specified trade object. This places the order in the account and +returns the status of the order from the brokerage. + #### 🛠️ Usage ```ruby result = snaptrade.trading.place_order( trade_id: "tradeId_example", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", + wait_to_confirm: true, ) p result ``` @@ -1570,6 +1567,12 @@ The ID of trade object obtained from trade/impact endpoint ##### user_id: `String` ##### user_secret: `String` +##### wait_to_confirm: `Boolean` +Optional, defaults to true. Determines if a wait is performed to check on order +status. If false, latency will be reduced but orders returned will be more +likely to be of status PENDING as we will not wait to check on the status before +responding to the request + #### 🔄 Return [AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb) @@ -1591,7 +1594,7 @@ Returns activities (transactions) for a user. Specifying start and end date is h ```ruby result = snaptrade.transactions_and_reporting.get_activities( - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", start_date: "2022-01-24", end_date: "2022-01-24", @@ -1650,7 +1653,7 @@ Returns performance information (contributions, dividends, rate of return, etc) result = snaptrade.transactions_and_reporting.get_reporting_custom_range( start_date: "2022-01-24", end_date: "2022-01-24", - user_id: "John.doe@snaptrade.com", + user_id: "snaptrade-user-123", user_secret: "USERSECRET123", accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", detailed: true, diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade.rb index ae405f10f7..c51e62519d 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade.rb @@ -25,13 +25,15 @@ require 'snaptrade/models/account_order_record_status' require 'snaptrade/models/account_simple' require 'snaptrade/models/account_sync_status' -require 'snaptrade/models/action' +require 'snaptrade/models/action_strict' require 'snaptrade/models/amount' require 'snaptrade/models/auth_type' require 'snaptrade/models/authentication_login_snap_trade_user200_response' require 'snaptrade/models/balance' require 'snaptrade/models/brokerage' require 'snaptrade/models/brokerage_authorization' +require 'snaptrade/models/brokerage_authorization_disabled_confirmation' +require 'snaptrade/models/brokerage_authorization_refresh_confirmation' require 'snaptrade/models/brokerage_authorization_type' require 'snaptrade/models/brokerage_authorization_type_read_only' require 'snaptrade/models/brokerage_authorization_type_read_only_brokerage' @@ -54,16 +56,22 @@ require 'snaptrade/models/exchange' require 'snaptrade/models/exchange_rate_pairs' require 'snaptrade/models/excluded_asset' +require 'snaptrade/models/figi_instrument' +require 'snaptrade/models/holdings_status' require 'snaptrade/models/jwt' require 'snaptrade/models/login_redirect_uri' require 'snaptrade/models/manual_trade' require 'snaptrade/models/manual_trade_and_impact' require 'snaptrade/models/manual_trade_balance' require 'snaptrade/models/manual_trade_form' +require 'snaptrade/models/manual_trade_form_notional_value' require 'snaptrade/models/manual_trade_symbol' require 'snaptrade/models/model400_failed_request_response' require 'snaptrade/models/model401_failed_request_response' +require 'snaptrade/models/model402_brokerage_auth_already_disabled_exception' +require 'snaptrade/models/model402_brokerage_auth_disabled_response' require 'snaptrade/models/model403_failed_request_response' +require 'snaptrade/models/model403_feature_not_enabled_response' require 'snaptrade/models/model404_failed_request_response' require 'snaptrade/models/model500_unexpected_exception_response' require 'snaptrade/models/model_asset_class' @@ -77,6 +85,8 @@ require 'snaptrade/models/monthly_dividends' require 'snaptrade/models/net_contributions' require 'snaptrade/models/net_dividend' +require 'snaptrade/models/notional_value' +require 'snaptrade/models/option_brokerage_symbol' require 'snaptrade/models/option_chain_inner' require 'snaptrade/models/option_chain_inner_chain_per_root_inner' require 'snaptrade/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner' @@ -91,7 +101,7 @@ require 'snaptrade/models/options_position' require 'snaptrade/models/options_position_currency' require 'snaptrade/models/options_symbol' -require 'snaptrade/models/order_type' +require 'snaptrade/models/order_type_strict' require 'snaptrade/models/partner_data' require 'snaptrade/models/past_value' require 'snaptrade/models/performance_custom' @@ -108,6 +118,7 @@ require 'snaptrade/models/snap_trade_api_disclaimer_accept_status' require 'snaptrade/models/snap_trade_holdings_account' require 'snaptrade/models/snap_trade_holdings_account_account_id' +require 'snaptrade/models/snap_trade_holdings_account_account_id_balance' require 'snaptrade/models/snap_trade_holdings_total_value' require 'snaptrade/models/snap_trade_login_user_request_body' require 'snaptrade/models/snap_trade_register_user_request_body' @@ -125,6 +136,7 @@ require 'snaptrade/models/strategy_type' require 'snaptrade/models/sub_period_return_rate' require 'snaptrade/models/symbol' +require 'snaptrade/models/symbol_figi_instrument' require 'snaptrade/models/symbol_query' require 'snaptrade/models/symbols_quotes_inner' require 'snaptrade/models/target_asset' @@ -135,7 +147,6 @@ require 'snaptrade/models/trade_execution_status_action' require 'snaptrade/models/trade_impact' require 'snaptrade/models/trading_cancel_user_account_order_request' -require 'snaptrade/models/trading_place_oco_order_request' require 'snaptrade/models/transactions_status' require 'snaptrade/models/type' require 'snaptrade/models/us_exchange' @@ -145,13 +156,13 @@ require 'snaptrade/models/user_error_log' require 'snaptrade/models/user_i_dand_secret' require 'snaptrade/models/user_settings' +require 'snaptrade/models/validated_trade_body' # APIs require 'snaptrade/api/account_information_api' require 'snaptrade/api/api_status_api' require 'snaptrade/api/authentication_api' require 'snaptrade/api/connections_api' -require 'snaptrade/api/error_logs_api' require 'snaptrade/api/options_api' require 'snaptrade/api/reference_data_api' require 'snaptrade/api/trading_api' @@ -225,7 +236,6 @@ class Client attr_reader :api_status attr_reader :authentication attr_reader :connections - attr_reader :error_logs attr_reader :options attr_reader :reference_data attr_reader :trading @@ -237,7 +247,6 @@ def initialize(config = Configuration.default) @api_status = SnapTrade::APIStatusApi.new(@api_client) @authentication = SnapTrade::AuthenticationApi.new(@api_client) @connections = SnapTrade::ConnectionsApi.new(@api_client) - @error_logs = SnapTrade::ErrorLogsApi.new(@api_client) @options = SnapTrade::OptionsApi.new(@api_client) @reference_data = SnapTrade::ReferenceDataApi.new(@api_client) @trading = SnapTrade::TradingApi.new(@api_client) diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/account_information_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/account_information_api.rb index a9e78c19fa..bdeed89600 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/account_information_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/account_information_api.rb @@ -19,6 +19,9 @@ def initialize(api_client = ApiClient.default) # List all accounts for the user, plus balances, positions, and orders for each account. # + # Lists balances, positions and orders for the specified account. The data returned is similar to + # the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + # # @param user_id [String] # @param user_secret [String] # @param brokerage_authorizations [String] Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). @@ -31,6 +34,9 @@ def get_all_user_holdings(user_id:, user_secret:, brokerage_authorizations: SENT # List all accounts for the user, plus balances, positions, and orders for each account. # + # Lists balances, positions and orders for the specified account. The data returned is similar to + # the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + # # @param user_id [String] # @param user_secret [String] # @param brokerage_authorizations [String] Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). @@ -41,6 +47,7 @@ def get_all_user_holdings_with_http_info(user_id:, user_secret:, brokerage_autho end # List all accounts for the user, plus balances, positions, and orders for each account. + # Lists balances, positions and orders for the specified account. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -52,6 +59,7 @@ def get_all_user_holdings_with_http_info(user_id:, user_secret:, brokerage_autho end # List all accounts for the user, plus balances, positions, and orders for each account. + # Lists balances, positions and orders for the specified account. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -218,6 +226,9 @@ def get_user_account_balance_with_http_info(user_id:, user_secret:, account_id:, # Return details of a specific investment account # + # Returns an account object with details for the specified account, + # including the total account market value. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get detail of. @@ -229,6 +240,9 @@ def get_user_account_details(user_id:, user_secret:, account_id:, extra: {}) # Return details of a specific investment account # + # Returns an account object with details for the specified account, + # including the total account market value. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get detail of. @@ -238,6 +252,7 @@ def get_user_account_details_with_http_info(user_id:, user_secret:, account_id:, end # Return details of a specific investment account + # Returns an account object with details for the specified account, including the total account market value. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get detail of. @@ -249,6 +264,7 @@ def get_user_account_details_with_http_info(user_id:, user_secret:, account_id:, end # Return details of a specific investment account + # Returns an account object with details for the specified account, including the total account market value. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get detail of. @@ -321,7 +337,7 @@ def get_user_account_details_with_http_info(user_id:, user_secret:, account_id:, # @param user_secret [String] # @param account_id [String] The ID of the account to get orders. # @param state [String] defaults value is set to \"all\" - # @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + # @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) extra[:state] = state if state != SENTINEL @@ -338,7 +354,7 @@ def get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL # @param user_secret [String] # @param account_id [String] The ID of the account to get orders. # @param state [String] defaults value is set to \"all\" - # @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + # @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) extra[:state] = state if state != SENTINEL @@ -353,7 +369,7 @@ def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, # @param account_id [String] The ID of the account to get orders. # @param [Hash] opts the optional parameters # @option opts [String] :state defaults value is set to \"all\" - # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. # @return [Array] private def get_user_account_orders_impl(user_id, user_secret, account_id, opts = {}) data, _status_code, _headers = get_user_account_orders_with_http_info(user_id, user_secret, account_id, opts) @@ -367,7 +383,7 @@ def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, # @param account_id [String] The ID of the account to get orders. # @param [Hash] opts the optional parameters # @option opts [String] :state defaults value is set to \"all\" - # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers private def get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {}) if @api_client.config.debugging @@ -440,6 +456,8 @@ def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, # List account positions # + # Returns a list of positions in the specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get positions. @@ -451,6 +469,8 @@ def get_user_account_positions(user_id:, user_secret:, account_id:, extra: {}) # List account positions # + # Returns a list of positions in the specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get positions. @@ -460,6 +480,7 @@ def get_user_account_positions_with_http_info(user_id:, user_secret:, account_id end # List account positions + # Returns a list of positions in the specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get positions. @@ -471,6 +492,7 @@ def get_user_account_positions_with_http_info(user_id:, user_secret:, account_id end # List account positions + # Returns a list of positions in the specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get positions. @@ -537,6 +559,10 @@ def get_user_account_positions_with_http_info(user_id:, user_secret:, account_id # List balances, positions and orders for the specified account # + # Lists balances, positions and orders for the specified account as well as + # option_positions and account metadata. The data returned is similar to the + # data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + # # @param account_id [String] The ID of the account to fetch holdings for. # @param user_id [String] # @param user_secret [String] @@ -548,6 +574,10 @@ def get_user_holdings(account_id:, user_id:, user_secret:, extra: {}) # List balances, positions and orders for the specified account # + # Lists balances, positions and orders for the specified account as well as + # option_positions and account metadata. The data returned is similar to the + # data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. + # # @param account_id [String] The ID of the account to fetch holdings for. # @param user_id [String] # @param user_secret [String] @@ -557,6 +587,7 @@ def get_user_holdings_with_http_info(account_id:, user_id:, user_secret:, extra: end # List balances, positions and orders for the specified account + # Lists balances, positions and orders for the specified account as well as option_positions and account metadata. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param account_id [String] The ID of the account to fetch holdings for. # @param user_id [String] # @param user_secret [String] @@ -568,6 +599,7 @@ def get_user_holdings_with_http_info(account_id:, user_id:, user_secret:, extra: end # List balances, positions and orders for the specified account + # Lists balances, positions and orders for the specified account as well as option_positions and account metadata. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param account_id [String] The ID of the account to fetch holdings for. # @param user_id [String] # @param user_secret [String] @@ -634,6 +666,8 @@ def get_user_holdings_with_http_info(account_id:, user_id:, user_secret:, extra: # List accounts # + # Get a list of all Account objects for the authenticated SnapTrade user. + # # @param user_id [String] # @param user_secret [String] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -644,6 +678,8 @@ def list_user_accounts(user_id:, user_secret:, extra: {}) # List accounts # + # Get a list of all Account objects for the authenticated SnapTrade user. + # # @param user_id [String] # @param user_secret [String] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -652,6 +688,7 @@ def list_user_accounts_with_http_info(user_id:, user_secret:, extra: {}) end # List accounts + # Get a list of all Account objects for the authenticated SnapTrade user. # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -662,6 +699,7 @@ def list_user_accounts_with_http_info(user_id:, user_secret:, extra: {}) end # List accounts + # Get a list of all Account objects for the authenticated SnapTrade user. # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -723,6 +761,8 @@ def list_user_accounts_with_http_info(user_id:, user_secret:, extra: {}) # Update details of an investment account # + # Updates various properties of a specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to update. @@ -734,6 +774,8 @@ def update_user_account(user_id:, user_secret:, account_id:, extra: {}) # Update details of an investment account # + # Updates various properties of a specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to update. @@ -743,6 +785,7 @@ def update_user_account_with_http_info(user_id:, user_secret:, account_id:, extr end # Update details of an investment account + # Updates various properties of a specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to update. @@ -754,6 +797,7 @@ def update_user_account_with_http_info(user_id:, user_secret:, account_id:, extr end # Update details of an investment account + # Updates various properties of a specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to update. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/authentication_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/authentication_api.rb index c03d979d0c..0ffc5d237a 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/authentication_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/authentication_api.rb @@ -103,95 +103,6 @@ def delete_snap_trade_user_with_http_info(user_id:, extra: {}) end - # Generate encrypted JWT token - # - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def get_user_jwt(user_id:, user_secret:, extra: {}) - data, _status_code, _headers = get_user_jwt_with_http_info_impl(user_id, user_secret, extra) - data - end - - # Generate encrypted JWT token - # - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def get_user_jwt_with_http_info(user_id:, user_secret:, extra: {}) - get_user_jwt_with_http_info_impl(user_id, user_secret, extra) - end - - # Generate encrypted JWT token - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] opts the optional parameters - # @return [EncryptedResponse] - private def get_user_jwt_impl(user_id, user_secret, opts = {}) - data, _status_code, _headers = get_user_jwt_with_http_info(user_id, user_secret, opts) - data - end - - # Generate encrypted JWT token - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] opts the optional parameters - # @return [Array<(EncryptedResponse, Integer, Hash)>] EncryptedResponse data, response status code and response headers - private def get_user_jwt_with_http_info_impl(user_id, user_secret, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_user_jwt ...' - end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthenticationApi.get_user_jwt" - end - # verify the required parameter 'user_secret' is set - if @api_client.config.client_side_validation && user_secret.nil? - fail ArgumentError, "Missing the required parameter 'user_secret' when calling AuthenticationApi.get_user_jwt" - end - # resource path - local_var_path = '/snapTrade/encryptedJWT' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'userId'] = user_id - query_params[:'userSecret'] = user_secret - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'EncryptedResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp'] - - new_options = opts.merge( - :operation => :"AuthenticationApi.get_user_jwt", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AuthenticationApi#get_user_jwt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers, response - end - - # List SnapTrade users # # Returns a list of users you've registered over the SnapTrade API. @@ -403,7 +314,10 @@ def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINE # Create SnapTrade user # - # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # Registers a new SnapTrade user under your ClientID. + # Most SnapTrade operations require a user to be passed as a parameter. + # + # @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. # @param body [SnapTradeRegisterUserRequestBody] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def register_snap_trade_user(user_id: SENTINEL, extra: {}) @@ -416,7 +330,10 @@ def register_snap_trade_user(user_id: SENTINEL, extra: {}) # Create SnapTrade user # - # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # Registers a new SnapTrade user under your ClientID. + # Most SnapTrade operations require a user to be passed as a parameter. + # + # @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. # @param body [SnapTradeRegisterUserRequestBody] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {}) @@ -427,6 +344,7 @@ def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {}) end # Create SnapTrade user + # Registers a new SnapTrade user under your ClientID. Most SnapTrade operations require a user to be passed as a parameter. # @param snap_trade_register_user_request_body [SnapTradeRegisterUserRequestBody] # @param [Hash] opts the optional parameters # @return [UserIDandSecret] @@ -436,6 +354,7 @@ def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {}) end # Create SnapTrade user + # Registers a new SnapTrade user under your ClientID. Most SnapTrade operations require a user to be passed as a parameter. # @param snap_trade_register_user_request_body [SnapTradeRegisterUserRequestBody] # @param [Hash] opts the optional parameters # @return [Array<(UserIDandSecret, Integer, Hash)>] UserIDandSecret data, response status code and response headers @@ -495,8 +414,11 @@ def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {}) # Obtain a new user secret for a user # - # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user - # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user. + # This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret + # is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. + # + # @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. + # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. # @param body [UserIDandSecret] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra: {}) @@ -510,8 +432,11 @@ def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra # Obtain a new user secret for a user # - # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user - # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user. + # This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret + # is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. + # + # @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. + # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. # @param body [UserIDandSecret] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: SENTINEL, extra: {}) @@ -523,6 +448,7 @@ def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: end # Obtain a new user secret for a user + # This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. # @param user_i_dand_secret [UserIDandSecret] # @param [Hash] opts the optional parameters # @return [UserIDandSecret] @@ -532,6 +458,7 @@ def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: end # Obtain a new user secret for a user + # This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. # @param user_i_dand_secret [UserIDandSecret] # @param [Hash] opts the optional parameters # @return [Array<(UserIDandSecret, Integer, Hash)>] UserIDandSecret data, response status code and response headers diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/connections_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/connections_api.rb index 14ed00f763..58795f1ed5 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/connections_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/connections_api.rb @@ -19,6 +19,8 @@ def initialize(api_client = ApiClient.default) # Get brokerage authorization details # + # Returns a single brokerage authorization object for the specified ID. + # # @param authorization_id [String] The ID of a brokerage authorization object. # @param user_id [String] # @param user_secret [String] @@ -30,6 +32,8 @@ def detail_brokerage_authorization(authorization_id:, user_id:, user_secret:, ex # Get brokerage authorization details # + # Returns a single brokerage authorization object for the specified ID. + # # @param authorization_id [String] The ID of a brokerage authorization object. # @param user_id [String] # @param user_secret [String] @@ -39,6 +43,7 @@ def detail_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end # Get brokerage authorization details + # Returns a single brokerage authorization object for the specified ID. # @param authorization_id [String] The ID of a brokerage authorization object. # @param user_id [String] # @param user_secret [String] @@ -50,6 +55,7 @@ def detail_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end # Get brokerage authorization details + # Returns a single brokerage authorization object for the specified ID. # @param authorization_id [String] The ID of a brokerage authorization object. # @param user_id [String] # @param user_secret [String] @@ -114,7 +120,112 @@ def detail_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end - # List all brokerage authorizations for the user + # Manually disable a connection for testing + # + # Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + # + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name + def disable_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) + data, _status_code, _headers = disable_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra) + data + end + + # Manually disable a connection for testing + # + # Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + # + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name + def disable_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) + disable_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra) + end + + # Manually disable a connection for testing + # Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] opts the optional parameters + # @return [BrokerageAuthorizationDisabledConfirmation] + private def disable_brokerage_authorization_impl(authorization_id, user_id, user_secret, opts = {}) + data, _status_code, _headers = disable_brokerage_authorization_with_http_info(authorization_id, user_id, user_secret, opts) + data + end + + # Manually disable a connection for testing + # Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] opts the optional parameters + # @return [Array<(BrokerageAuthorizationDisabledConfirmation, Integer, Hash)>] BrokerageAuthorizationDisabledConfirmation data, response status code and response headers + private def disable_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConnectionsApi.disable_brokerage_authorization ...' + end + # verify the required parameter 'authorization_id' is set + if @api_client.config.client_side_validation && authorization_id.nil? + fail ArgumentError, "Missing the required parameter 'authorization_id' when calling ConnectionsApi.disable_brokerage_authorization" + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.disable_brokerage_authorization" + end + # verify the required parameter 'user_secret' is set + if @api_client.config.client_side_validation && user_secret.nil? + fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.disable_brokerage_authorization" + end + # resource path + local_var_path = '/authorizations/{authorizationId}/disable'.sub('{' + 'authorizationId' + '}', CGI.escape(authorization_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'userId'] = user_id + query_params[:'userSecret'] = user_secret + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'BrokerageAuthorizationDisabledConfirmation' + + # auth_names + auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp'] + + new_options = opts.merge( + :operation => :"ConnectionsApi.disable_brokerage_authorization", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConnectionsApi#disable_brokerage_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers, response + end + + + # List all brokerage authorizations for the User + # + # Returns a list of Brokerage Authorization objects for the user # # @param user_id [String] # @param user_secret [String] @@ -124,7 +235,9 @@ def list_brokerage_authorizations(user_id:, user_secret:, extra: {}) data end - # List all brokerage authorizations for the user + # List all brokerage authorizations for the User + # + # Returns a list of Brokerage Authorization objects for the user # # @param user_id [String] # @param user_secret [String] @@ -133,7 +246,8 @@ def list_brokerage_authorizations_with_http_info(user_id:, user_secret:, extra: list_brokerage_authorizations_with_http_info_impl(user_id, user_secret, extra) end - # List all brokerage authorizations for the user + # List all brokerage authorizations for the User + # Returns a list of Brokerage Authorization objects for the user # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -143,7 +257,8 @@ def list_brokerage_authorizations_with_http_info(user_id:, user_secret:, extra: data end - # List all brokerage authorizations for the user + # List all brokerage authorizations for the User + # Returns a list of Brokerage Authorization objects for the user # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters @@ -203,8 +318,113 @@ def list_brokerage_authorizations_with_http_info(user_id:, user_secret:, extra: end + # Refresh holdings for a connection + # + # Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + # + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name + def refresh_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) + data, _status_code, _headers = refresh_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra) + data + end + + # Refresh holdings for a connection + # + # Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + # + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name + def refresh_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) + refresh_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra) + end + + # Refresh holdings for a connection + # Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] opts the optional parameters + # @return [BrokerageAuthorizationRefreshConfirmation] + private def refresh_brokerage_authorization_impl(authorization_id, user_id, user_secret, opts = {}) + data, _status_code, _headers = refresh_brokerage_authorization_with_http_info(authorization_id, user_id, user_secret, opts) + data + end + + # Refresh holdings for a connection + # Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + # @param authorization_id [String] The ID of a brokerage authorization object. + # @param user_id [String] + # @param user_secret [String] + # @param [Hash] opts the optional parameters + # @return [Array<(BrokerageAuthorizationRefreshConfirmation, Integer, Hash)>] BrokerageAuthorizationRefreshConfirmation data, response status code and response headers + private def refresh_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConnectionsApi.refresh_brokerage_authorization ...' + end + # verify the required parameter 'authorization_id' is set + if @api_client.config.client_side_validation && authorization_id.nil? + fail ArgumentError, "Missing the required parameter 'authorization_id' when calling ConnectionsApi.refresh_brokerage_authorization" + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.refresh_brokerage_authorization" + end + # verify the required parameter 'user_secret' is set + if @api_client.config.client_side_validation && user_secret.nil? + fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.refresh_brokerage_authorization" + end + # resource path + local_var_path = '/authorizations/{authorizationId}/refresh'.sub('{' + 'authorizationId' + '}', CGI.escape(authorization_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'userId'] = user_id + query_params[:'userSecret'] = user_secret + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'BrokerageAuthorizationRefreshConfirmation' + + # auth_names + auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp'] + + new_options = opts.merge( + :operation => :"ConnectionsApi.refresh_brokerage_authorization", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConnectionsApi#refresh_brokerage_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers, response + end + + # Delete brokerage authorization # + # Deletes a specified brokerage authorization given by the ID. + # # @param authorization_id [String] The ID of the Authorization to delete. # @param user_id [String] # @param user_secret [String] @@ -216,6 +436,8 @@ def remove_brokerage_authorization(authorization_id:, user_id:, user_secret:, ex # Delete brokerage authorization # + # Deletes a specified brokerage authorization given by the ID. + # # @param authorization_id [String] The ID of the Authorization to delete. # @param user_id [String] # @param user_secret [String] @@ -225,6 +447,7 @@ def remove_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end # Delete brokerage authorization + # Deletes a specified brokerage authorization given by the ID. # @param authorization_id [String] The ID of the Authorization to delete. # @param user_id [String] # @param user_secret [String] @@ -236,6 +459,7 @@ def remove_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end # Delete brokerage authorization + # Deletes a specified brokerage authorization given by the ID. # @param authorization_id [String] The ID of the Authorization to delete. # @param user_id [String] # @param user_secret [String] @@ -298,7 +522,9 @@ def remove_brokerage_authorization_with_http_info(authorization_id:, user_id:, u end - # List all session events for the partner + # Get all session events for a user + # + # Returns a list of session events associated with a user. # # @param partner_client_id [String] # @param user_id [String] Optional comma seperated list of user IDs used to filter the request on specific users @@ -311,7 +537,9 @@ def session_events(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, data end - # List all session events for the partner + # Get all session events for a user + # + # Returns a list of session events associated with a user. # # @param partner_client_id [String] # @param user_id [String] Optional comma seperated list of user IDs used to filter the request on specific users @@ -323,7 +551,8 @@ def session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session session_events_with_http_info_impl(partner_client_id, extra) end - # List all session events for the partner + # Get all session events for a user + # Returns a list of session events associated with a user. # @param partner_client_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :user_id Optional comma seperated list of user IDs used to filter the request on specific users @@ -334,7 +563,8 @@ def session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session data end - # List all session events for the partner + # Get all session events for a user + # Returns a list of session events associated with a user. # @param partner_client_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :user_id Optional comma seperated list of user IDs used to filter the request on specific users diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/error_logs_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/error_logs_api.rb deleted file mode 100644 index 0ab88d4b59..0000000000 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/error_logs_api.rb +++ /dev/null @@ -1,111 +0,0 @@ -=begin -#SnapTrade - -#Connect brokerage accounts to your app for live positions and trading - -The version of the OpenAPI document: 1.0.0 -Contact: api@snaptrade.com -=end - -require 'cgi' - -module SnapTrade - class ErrorLogsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - - # Retrieve error logs on behalf of your SnapTrade users - # - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def list_user_errors(user_id:, user_secret:, extra: {}) - data, _status_code, _headers = list_user_errors_with_http_info_impl(user_id, user_secret, extra) - data - end - - # Retrieve error logs on behalf of your SnapTrade users - # - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def list_user_errors_with_http_info(user_id:, user_secret:, extra: {}) - list_user_errors_with_http_info_impl(user_id, user_secret, extra) - end - - # Retrieve error logs on behalf of your SnapTrade users - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] opts the optional parameters - # @return [Array] - private def list_user_errors_impl(user_id, user_secret, opts = {}) - data, _status_code, _headers = list_user_errors_with_http_info(user_id, user_secret, opts) - data - end - - # Retrieve error logs on behalf of your SnapTrade users - # @param user_id [String] - # @param user_secret [String] - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - private def list_user_errors_with_http_info_impl(user_id, user_secret, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ErrorLogsApi.list_user_errors ...' - end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling ErrorLogsApi.list_user_errors" - end - # verify the required parameter 'user_secret' is set - if @api_client.config.client_side_validation && user_secret.nil? - fail ArgumentError, "Missing the required parameter 'user_secret' when calling ErrorLogsApi.list_user_errors" - end - # resource path - local_var_path = '/snapTrade/listUserErrors' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'userId'] = user_id - query_params[:'userSecret'] = user_secret - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Array' - - # auth_names - auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp'] - - new_options = opts.merge( - :operation => :"ErrorLogsApi.list_user_errors", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ErrorLogsApi#list_user_errors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers, response - end - end - - # top-level client access to avoid having the user to insantiate their own API instances - ErrorLogs = ErrorLogsApi::new -end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/options_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/options_api.rb index 70363a13a2..5d41858c18 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/options_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/options_api.rb @@ -17,7 +17,9 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end - # Creates an option strategy object that will be used to place an option strategy order + # Create options strategy + # + # Creates an option strategy object that will be used to place an option strategy order. # # @param underlying_symbol_id [String] # @param legs [Array] @@ -37,7 +39,9 @@ def get_option_strategy(underlying_symbol_id:, legs:, strategy_type:, user_id:, data end - # Creates an option strategy object that will be used to place an option strategy order + # Create options strategy + # + # Creates an option strategy object that will be used to place an option strategy order. # # @param underlying_symbol_id [String] # @param legs [Array] @@ -56,7 +60,8 @@ def get_option_strategy_with_http_info(underlying_symbol_id:, legs:, strategy_ty get_option_strategy_with_http_info_impl(user_id, user_secret, account_id, options_get_option_strategy_request, extra) end - # Creates an option strategy object that will be used to place an option strategy order + # Create options strategy + # Creates an option strategy object that will be used to place an option strategy order. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to create the option strategy object in. @@ -68,7 +73,8 @@ def get_option_strategy_with_http_info(underlying_symbol_id:, legs:, strategy_ty data end - # Creates an option strategy object that will be used to place an option strategy order + # Create options strategy + # Creates an option strategy object that will be used to place an option strategy order. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to create the option strategy object in. @@ -143,7 +149,9 @@ def get_option_strategy_with_http_info(underlying_symbol_id:, legs:, strategy_ty end - # Get the options chain + # Get the options chain for a symbol + # + # Returns the option chain for the specified symbol in the specified account. # # @param user_id [String] # @param user_secret [String] @@ -155,7 +163,9 @@ def get_options_chain(user_id:, user_secret:, account_id:, symbol:, extra: {}) data end - # Get the options chain + # Get the options chain for a symbol + # + # Returns the option chain for the specified symbol in the specified account. # # @param user_id [String] # @param user_secret [String] @@ -166,7 +176,8 @@ def get_options_chain_with_http_info(user_id:, user_secret:, account_id:, symbol get_options_chain_with_http_info_impl(user_id, user_secret, account_id, symbol, extra) end - # Get the options chain + # Get the options chain for a symbol + # Returns the option chain for the specified symbol in the specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get the options chain from. @@ -178,7 +189,8 @@ def get_options_chain_with_http_info(user_id:, user_secret:, account_id:, symbol data end - # Get the options chain + # Get the options chain for a symbol + # Returns the option chain for the specified symbol in the specified account. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to get the options chain from. @@ -249,7 +261,9 @@ def get_options_chain_with_http_info(user_id:, user_secret:, account_id:, symbol end - # Get latest market data of option strategy + # Get options strategy quotes + # + # Returns a Strategy Quotes object which has latest market data of the specified option strategy. # # @param user_id [String] # @param user_secret [String] @@ -261,7 +275,9 @@ def get_options_strategy_quote(user_id:, user_secret:, account_id:, option_strat data end - # Get latest market data of option strategy + # Get options strategy quotes + # + # Returns a Strategy Quotes object which has latest market data of the specified option strategy. # # @param user_id [String] # @param user_secret [String] @@ -272,7 +288,8 @@ def get_options_strategy_quote_with_http_info(user_id:, user_secret:, account_id get_options_strategy_quote_with_http_info_impl(user_id, user_secret, account_id, option_strategy_id, extra) end - # Get latest market data of option strategy + # Get options strategy quotes + # Returns a Strategy Quotes object which has latest market data of the specified option strategy. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account the strategy will be placed in. @@ -284,7 +301,8 @@ def get_options_strategy_quote_with_http_info(user_id:, user_secret:, account_id data end - # Get latest market data of option strategy + # Get options strategy quotes + # Returns a Strategy Quotes object which has latest market data of the specified option strategy. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account the strategy will be placed in. @@ -354,7 +372,9 @@ def get_options_strategy_quote_with_http_info(user_id:, user_secret:, account_id end - # Get the options holdings in the account + # Get account option holdings + # + # Returns a list of Options Positions. # # @param user_id [String] # @param user_secret [String] @@ -365,7 +385,9 @@ def list_option_holdings(user_id:, user_secret:, account_id:, extra: {}) data end - # Get the options holdings in the account + # Get account option holdings + # + # Returns a list of Options Positions. # # @param user_id [String] # @param user_secret [String] @@ -375,7 +397,8 @@ def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, ext list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra) end - # Get the options holdings in the account + # Get account option holdings + # Returns a list of Options Positions. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to fetch options holdings for. @@ -386,7 +409,8 @@ def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, ext data end - # Get the options holdings in the account + # Get account option holdings + # Returns a list of Options Positions. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to fetch options holdings for. @@ -451,9 +475,11 @@ def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, ext end - # Place an option strategy order on the brokerage + # Place an option strategy order # - # @param order_type [OrderType] Order Type + # Places the option strategy order and returns the order record received from the brokerage. + # + # @param order_type [OrderTypeStrict] Order Type # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param user_id [String] # @param user_secret [String] @@ -472,9 +498,11 @@ def place_option_strategy(order_type:, time_in_force:, user_id:, user_secret:, a data end - # Place an option strategy order on the brokerage + # Place an option strategy order + # + # Places the option strategy order and returns the order record received from the brokerage. # - # @param order_type [OrderType] Order Type + # @param order_type [OrderTypeStrict] Order Type # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param user_id [String] # @param user_secret [String] @@ -492,7 +520,8 @@ def place_option_strategy_with_http_info(order_type:, time_in_force:, user_id:, place_option_strategy_with_http_info_impl(user_id, user_secret, account_id, option_strategy_id, options_place_option_strategy_request, extra) end - # Place an option strategy order on the brokerage + # Place an option strategy order + # Places the option strategy order and returns the order record received from the brokerage. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to execute the strategy in. @@ -505,7 +534,8 @@ def place_option_strategy_with_http_info(order_type:, time_in_force:, user_id:, data end - # Place an option strategy order on the brokerage + # Place an option strategy order + # Places the option strategy order and returns the order record received from the brokerage. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to execute the strategy in. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/reference_data_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/reference_data_api.rb index f5d015d997..96f287fb9c 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/reference_data_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/reference_data_api.rb @@ -17,7 +17,9 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end - # Return the exchange rate of a currency pair + # Get exchange rate of a currency pair + # + # Returns an Exchange Rate Pair object for the specified Currency Pair. # # @param currency_pair [String] A currency pair based on currency code for example, {CAD-USD} # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -26,7 +28,9 @@ def get_currency_exchange_rate_pair(currency_pair:, extra: {}) data end - # Return the exchange rate of a currency pair + # Get exchange rate of a currency pair + # + # Returns an Exchange Rate Pair object for the specified Currency Pair. # # @param currency_pair [String] A currency pair based on currency code for example, {CAD-USD} # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -34,7 +38,8 @@ def get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) get_currency_exchange_rate_pair_with_http_info_impl(currency_pair, extra) end - # Return the exchange rate of a currency pair + # Get exchange rate of a currency pair + # Returns an Exchange Rate Pair object for the specified Currency Pair. # @param currency_pair [String] A currency pair based on currency code for example, {CAD-USD} # @param [Hash] opts the optional parameters # @return [ExchangeRatePairs] @@ -43,7 +48,8 @@ def get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) data end - # Return the exchange rate of a currency pair + # Get exchange rate of a currency pair + # Returns an Exchange Rate Pair object for the specified Currency Pair. # @param currency_pair [String] A currency pair based on currency code for example, {CAD-USD} # @param [Hash] opts the optional parameters # @return [Array<(ExchangeRatePairs, Integer, Hash)>] ExchangeRatePairs data, response status code and response headers @@ -98,6 +104,8 @@ def get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) # Get metadata related to Snaptrade partner # + # Returns useful data related to the specified ClientID, including allowed brokerages and data access. + # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_partner_info(extra: {}) data, _status_code, _headers = get_partner_info_with_http_info_impl(extra) @@ -106,12 +114,15 @@ def get_partner_info(extra: {}) # Get metadata related to Snaptrade partner # + # Returns useful data related to the specified ClientID, including allowed brokerages and data access. + # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_partner_info_with_http_info(extra: {}) get_partner_info_with_http_info_impl(extra) end # Get metadata related to Snaptrade partner + # Returns useful data related to the specified ClientID, including allowed brokerages and data access. # @param [Hash] opts the optional parameters # @return [PartnerData] private def get_partner_info_impl(opts = {}) @@ -120,6 +131,7 @@ def get_partner_info_with_http_info(extra: {}) end # Get metadata related to Snaptrade partner + # Returns useful data related to the specified ClientID, including allowed brokerages and data access. # @param [Hash] opts the optional parameters # @return [Array<(PartnerData, Integer, Hash)>] PartnerData data, response status code and response headers private def get_partner_info_with_http_info_impl(opts = {}) @@ -244,7 +256,9 @@ def get_security_types_with_http_info(extra: {}) end - # List exchanges + # Get exchanges + # + # Returns a list of all supported Exchanges. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_stock_exchanges(extra: {}) @@ -252,14 +266,17 @@ def get_stock_exchanges(extra: {}) data end - # List exchanges + # Get exchanges + # + # Returns a list of all supported Exchanges. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_stock_exchanges_with_http_info(extra: {}) get_stock_exchanges_with_http_info_impl(extra) end - # List exchanges + # Get exchanges + # Returns a list of all supported Exchanges. # @param [Hash] opts the optional parameters # @return [Array] private def get_stock_exchanges_impl(opts = {}) @@ -267,7 +284,8 @@ def get_stock_exchanges_with_http_info(extra: {}) data end - # List exchanges + # Get exchanges + # Returns a list of all supported Exchanges. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers private def get_stock_exchanges_with_http_info_impl(opts = {}) @@ -317,6 +335,10 @@ def get_stock_exchanges_with_http_info(extra: {}) # Search for symbols # + # Returns a list of Universal Symbol objects that match a defined string. + # + # Matches on ticker or name. + # # @param substring [String] # @param body [SymbolQuery] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -330,6 +352,10 @@ def get_symbols(substring: SENTINEL, extra: {}) # Search for symbols # + # Returns a list of Universal Symbol objects that match a defined string. + # + # Matches on ticker or name. + # # @param substring [String] # @param body [SymbolQuery] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -341,6 +367,7 @@ def get_symbols_with_http_info(substring: SENTINEL, extra: {}) end # Search for symbols + # Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. # @param [Hash] opts the optional parameters # @option opts [SymbolQuery] :symbol_query # @return [Array] @@ -350,6 +377,7 @@ def get_symbols_with_http_info(substring: SENTINEL, extra: {}) end # Search for symbols + # Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. # @param [Hash] opts the optional parameters # @option opts [SymbolQuery] :symbol_query # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers @@ -403,7 +431,9 @@ def get_symbols_with_http_info(substring: SENTINEL, extra: {}) end - # Get details of a symbol by the ticker or the universal_symbol_id + # Get details of a symbol + # + # Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. # # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get. # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -412,7 +442,9 @@ def get_symbols_by_ticker(query:, extra: {}) data end - # Get details of a symbol by the ticker or the universal_symbol_id + # Get details of a symbol + # + # Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. # # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get. # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -420,7 +452,8 @@ def get_symbols_by_ticker_with_http_info(query:, extra: {}) get_symbols_by_ticker_with_http_info_impl(query, extra) end - # Get details of a symbol by the ticker or the universal_symbol_id + # Get details of a symbol + # Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get. # @param [Hash] opts the optional parameters # @return [UniversalSymbol] @@ -429,7 +462,8 @@ def get_symbols_by_ticker_with_http_info(query:, extra: {}) data end - # Get details of a symbol by the ticker or the universal_symbol_id + # Get details of a symbol + # Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get. # @param [Hash] opts the optional parameters # @return [Array<(UniversalSymbol, Integer, Hash)>] UniversalSymbol data, response status code and response headers @@ -482,7 +516,9 @@ def get_symbols_by_ticker_with_http_info(query:, extra: {}) end - # List of all brokerage authorization types + # Get all brokerage authorization types + # + # Returns a list of all defined Brokerage authorization Type objects. # # @param brokerage [String] Comma separated value of brokerage slugs # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -492,7 +528,9 @@ def list_all_brokerage_authorization_type(brokerage: SENTINEL, extra: {}) data end - # List of all brokerage authorization types + # Get all brokerage authorization types + # + # Returns a list of all defined Brokerage authorization Type objects. # # @param brokerage [String] Comma separated value of brokerage slugs # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name @@ -501,7 +539,8 @@ def list_all_brokerage_authorization_type_with_http_info(brokerage: SENTINEL, ex list_all_brokerage_authorization_type_with_http_info_impl(extra) end - # List of all brokerage authorization types + # Get all brokerage authorization types + # Returns a list of all defined Brokerage authorization Type objects. # @param [Hash] opts the optional parameters # @option opts [String] :brokerage Comma separated value of brokerage slugs # @return [Array] @@ -510,7 +549,8 @@ def list_all_brokerage_authorization_type_with_http_info(brokerage: SENTINEL, ex data end - # List of all brokerage authorization types + # Get all brokerage authorization types + # Returns a list of all defined Brokerage authorization Type objects. # @param [Hash] opts the optional parameters # @option opts [String] :brokerage Comma separated value of brokerage slugs # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers @@ -560,7 +600,9 @@ def list_all_brokerage_authorization_type_with_http_info(brokerage: SENTINEL, ex end - # List brokerages + # Get brokerages + # + # Returns a list of all defined Brokerage objects. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_brokerages(extra: {}) @@ -568,14 +610,17 @@ def list_all_brokerages(extra: {}) data end - # List brokerages + # Get brokerages + # + # Returns a list of all defined Brokerage objects. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_brokerages_with_http_info(extra: {}) list_all_brokerages_with_http_info_impl(extra) end - # List brokerages + # Get brokerages + # Returns a list of all defined Brokerage objects. # @param [Hash] opts the optional parameters # @return [Array] private def list_all_brokerages_impl(opts = {}) @@ -583,7 +628,8 @@ def list_all_brokerages_with_http_info(extra: {}) data end - # List brokerages + # Get brokerages + # Returns a list of all defined Brokerage objects. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers private def list_all_brokerages_with_http_info_impl(opts = {}) @@ -631,7 +677,9 @@ def list_all_brokerages_with_http_info(extra: {}) end - # List currencies + # Get currencies + # + # Returns a list of all defined Currency objects. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_currencies(extra: {}) @@ -639,14 +687,17 @@ def list_all_currencies(extra: {}) data end - # List currencies + # Get currencies + # + # Returns a list of all defined Currency objects. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_currencies_with_http_info(extra: {}) list_all_currencies_with_http_info_impl(extra) end - # List currencies + # Get currencies + # Returns a list of all defined Currency objects. # @param [Hash] opts the optional parameters # @return [Array] private def list_all_currencies_impl(opts = {}) @@ -654,7 +705,8 @@ def list_all_currencies_with_http_info(extra: {}) data end - # List currencies + # Get currencies + # Returns a list of all defined Currency objects. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers private def list_all_currencies_with_http_info_impl(opts = {}) @@ -702,7 +754,9 @@ def list_all_currencies_with_http_info(extra: {}) end - # List currency exchange rates + # Get currency exchange rates + # + # Returns a list of all Exchange Rate Pairs for all supported Currencies. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_currencies_rates(extra: {}) @@ -710,14 +764,17 @@ def list_all_currencies_rates(extra: {}) data end - # List currency exchange rates + # Get currency exchange rates + # + # Returns a list of all Exchange Rate Pairs for all supported Currencies. # # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def list_all_currencies_rates_with_http_info(extra: {}) list_all_currencies_rates_with_http_info_impl(extra) end - # List currency exchange rates + # Get currency exchange rates + # Returns a list of all Exchange Rate Pairs for all supported Currencies. # @param [Hash] opts the optional parameters # @return [Array] private def list_all_currencies_rates_impl(opts = {}) @@ -725,7 +782,8 @@ def list_all_currencies_rates_with_http_info(extra: {}) data end - # List currency exchange rates + # Get currency exchange rates + # Returns a list of all Exchange Rate Pairs for all supported Currencies. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers private def list_all_currencies_rates_with_http_info_impl(opts = {}) @@ -775,6 +833,10 @@ def list_all_currencies_rates_with_http_info(extra: {}) # Search for symbols available in an account # + # Returns a list of universal symbols that are supported by + # the specificied account. Returned symbols are based on the + # provided search string, matching on ticker and name. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to search for symbols within. @@ -791,6 +853,10 @@ def symbol_search_user_account(user_id:, user_secret:, account_id:, substring: S # Search for symbols available in an account # + # Returns a list of universal symbols that are supported by + # the specificied account. Returned symbols are based on the + # provided search string, matching on ticker and name. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to search for symbols within. @@ -805,6 +871,7 @@ def symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id end # Search for symbols available in an account + # Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to search for symbols within. @@ -817,6 +884,7 @@ def symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id end # Search for symbols available in an account + # Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to search for symbols within. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/trading_api.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/trading_api.rb index 6fdb8284bc..97b3a7969f 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/trading_api.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/api/trading_api.rb @@ -19,6 +19,9 @@ def initialize(api_client = ApiClient.default) # Cancel open order in account # + # Sends a signal to the brokerage to cancel the specified order. + # This will only work if the order has not yet been executed. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to cancel the order in. @@ -35,6 +38,9 @@ def cancel_user_account_order(user_id:, user_secret:, account_id:, brokerage_ord # Cancel open order in account # + # Sends a signal to the brokerage to cancel the specified order. + # This will only work if the order has not yet been executed. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to cancel the order in. @@ -49,6 +55,7 @@ def cancel_user_account_order_with_http_info(user_id:, user_secret:, account_id: end # Cancel open order in account + # Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to cancel the order in. @@ -61,6 +68,7 @@ def cancel_user_account_order_with_http_info(user_id:, user_secret:, account_id: end # Cancel open order in account + # Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. # @param user_id [String] # @param user_secret [String] # @param account_id [String] The ID of the account to cancel the order in. @@ -135,19 +143,21 @@ def cancel_user_account_order_with_http_info(user_id:, user_secret:, account_id: end - # Check impact of trades on account. + # Check the impact of a trade on an account + # + # Return the trade object and it's impact on the account for the specified order. # # @param user_id [String] # @param user_secret [String] # @param account_id [String] - # @param action [Action] Trade Action - # @param order_type [OrderType] Order Type + # @param action [ActionStrict] Trade Action + # @param order_type [OrderTypeStrict] Order Type # @param price [Float] Trade Price if limit or stop limit order # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param units [Float] # @param universal_symbol_id [String] - # @param notional_value [Float] + # @param notional_value [ManualTradeFormNotionalValue] # @param body [ManualTradeForm] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_order_impact(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {}) @@ -166,19 +176,21 @@ def get_order_impact(user_id:, user_secret:, account_id: SENTINEL, action: SENTI data end - # Check impact of trades on account. + # Check the impact of a trade on an account + # + # Return the trade object and it's impact on the account for the specified order. # # @param user_id [String] # @param user_secret [String] # @param account_id [String] - # @param action [Action] Trade Action - # @param order_type [OrderType] Order Type + # @param action [ActionStrict] Trade Action + # @param order_type [OrderTypeStrict] Order Type # @param price [Float] Trade Price if limit or stop limit order # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param units [Float] # @param universal_symbol_id [String] - # @param notional_value [Float] + # @param notional_value [ManualTradeFormNotionalValue] # @param body [ManualTradeForm] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {}) @@ -196,7 +208,8 @@ def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL get_order_impact_with_http_info_impl(user_id, user_secret, manual_trade_form, extra) end - # Check impact of trades on account. + # Check the impact of a trade on an account + # Return the trade object and it's impact on the account for the specified order. # @param user_id [String] # @param user_secret [String] # @param manual_trade_form [ManualTradeForm] @@ -207,7 +220,8 @@ def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL data end - # Check impact of trades on account. + # Check the impact of a trade on an account + # Return the trade object and it's impact on the account for the specified order. # @param user_id [String] # @param user_secret [String] # @param manual_trade_form [ManualTradeForm] @@ -279,6 +293,8 @@ def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL # Get symbol quotes # + # Returns live quote(s) from the brokerage for the specified symbol(s). + # # @param user_id [String] # @param user_secret [String] # @param symbols [String] List of universal_symbol_id or tickers to get quotes for. @@ -293,6 +309,8 @@ def get_user_account_quotes(user_id:, user_secret:, symbols:, account_id:, use_t # Get symbol quotes # + # Returns live quote(s) from the brokerage for the specified symbol(s). + # # @param user_id [String] # @param user_secret [String] # @param symbols [String] List of universal_symbol_id or tickers to get quotes for. @@ -305,6 +323,7 @@ def get_user_account_quotes_with_http_info(user_id:, user_secret:, symbols:, acc end # Get symbol quotes + # Returns live quote(s) from the brokerage for the specified symbol(s). # @param user_id [String] # @param user_secret [String] # @param symbols [String] List of universal_symbol_id or tickers to get quotes for. @@ -318,6 +337,7 @@ def get_user_account_quotes_with_http_info(user_id:, user_secret:, symbols:, acc end # Get symbol quotes + # Returns live quote(s) from the brokerage for the specified symbol(s). # @param user_id [String] # @param user_secret [String] # @param symbols [String] List of universal_symbol_id or tickers to get quotes for. @@ -392,17 +412,19 @@ def get_user_account_quotes_with_http_info(user_id:, user_secret:, symbols:, acc # Place a trade with NO validation. # + # Places a specified trade in the specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] - # @param action [Action] Trade Action - # @param order_type [OrderType] Order Type + # @param action [ActionStrict] Trade Action + # @param order_type [OrderTypeStrict] Order Type # @param price [Float] Trade Price if limit or stop limit order # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param units [Float] # @param universal_symbol_id [String] - # @param notional_value [Float] + # @param notional_value [ManualTradeFormNotionalValue] # @param body [ManualTradeForm] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def place_force_order(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {}) @@ -423,17 +445,19 @@ def place_force_order(user_id:, user_secret:, account_id: SENTINEL, action: SENT # Place a trade with NO validation. # + # Places a specified trade in the specified account. + # # @param user_id [String] # @param user_secret [String] # @param account_id [String] - # @param action [Action] Trade Action - # @param order_type [OrderType] Order Type + # @param action [ActionStrict] Trade Action + # @param order_type [OrderTypeStrict] Order Type # @param price [Float] Trade Price if limit or stop limit order # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled # @param units [Float] # @param universal_symbol_id [String] - # @param notional_value [Float] + # @param notional_value [ManualTradeFormNotionalValue] # @param body [ManualTradeForm] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {}) @@ -452,6 +476,7 @@ def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINE end # Place a trade with NO validation. + # Places a specified trade in the specified account. # @param user_id [String] # @param user_secret [String] # @param manual_trade_form [ManualTradeForm] @@ -463,6 +488,7 @@ def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINE end # Place a trade with NO validation. + # Places a specified trade in the specified account. # @param user_id [String] # @param user_secret [String] # @param manual_trade_form [ManualTradeForm] @@ -532,146 +558,50 @@ def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINE end - # Place a OCO (One Cancels Other) order - # - # @param user_id [String] - # @param user_secret [String] - # @param first_trade_id [Object] The ID of first trade object obtained from trade/impact endpoint - # @param second_trade_id [Object] The ID of second trade object obtained from trade/impact endpoint - # @param body [TradingPlaceOCOOrderRequest] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def place_oco_order(user_id:, user_secret:, first_trade_id: SENTINEL, second_trade_id: SENTINEL, extra: {}) - _body = {} - _body[:first_trade_id] = first_trade_id if first_trade_id != SENTINEL - _body[:second_trade_id] = second_trade_id if second_trade_id != SENTINEL - trading_place_oco_order_request = _body - data, _status_code, _headers = place_oco_order_with_http_info_impl(user_id, user_secret, trading_place_oco_order_request, extra) - data - end - - # Place a OCO (One Cancels Other) order - # - # @param user_id [String] - # @param user_secret [String] - # @param first_trade_id [Object] The ID of first trade object obtained from trade/impact endpoint - # @param second_trade_id [Object] The ID of second trade object obtained from trade/impact endpoint - # @param body [TradingPlaceOCOOrderRequest] - # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def place_oco_order_with_http_info(user_id:, user_secret:, first_trade_id: SENTINEL, second_trade_id: SENTINEL, extra: {}) - _body = {} - _body[:first_trade_id] = first_trade_id if first_trade_id != SENTINEL - _body[:second_trade_id] = second_trade_id if second_trade_id != SENTINEL - trading_place_oco_order_request = _body - place_oco_order_with_http_info_impl(user_id, user_secret, trading_place_oco_order_request, extra) - end - - # Place a OCO (One Cancels Other) order - # @param user_id [String] - # @param user_secret [String] - # @param trading_place_oco_order_request [TradingPlaceOCOOrderRequest] - # @param [Hash] opts the optional parameters - # @return [AccountOrderRecord] - private def place_oco_order_impl(user_id, user_secret, trading_place_oco_order_request, opts = {}) - data, _status_code, _headers = place_oco_order_with_http_info(user_id, user_secret, trading_place_oco_order_request, opts) - data - end - - # Place a OCO (One Cancels Other) order - # @param user_id [String] - # @param user_secret [String] - # @param trading_place_oco_order_request [TradingPlaceOCOOrderRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AccountOrderRecord, Integer, Hash)>] AccountOrderRecord data, response status code and response headers - private def place_oco_order_with_http_info_impl(user_id, user_secret, trading_place_oco_order_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TradingApi.place_oco_order ...' - end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling TradingApi.place_oco_order" - end - # verify the required parameter 'user_secret' is set - if @api_client.config.client_side_validation && user_secret.nil? - fail ArgumentError, "Missing the required parameter 'user_secret' when calling TradingApi.place_oco_order" - end - # verify the required parameter 'trading_place_oco_order_request' is set - if @api_client.config.client_side_validation && trading_place_oco_order_request.nil? - fail ArgumentError, "Missing the required parameter 'trading_place_oco_order_request' when calling TradingApi.place_oco_order" - end - # resource path - local_var_path = '/trade/oco' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'userId'] = user_id - query_params[:'userSecret'] = user_secret - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(trading_place_oco_order_request) - - # return_type - return_type = opts[:debug_return_type] || 'AccountOrderRecord' - - # auth_names - auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp'] - - new_options = opts.merge( - :operation => :"TradingApi.place_oco_order", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: TradingApi#place_oco_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers, response - end - - # Place order # + # Places the specified trade object. This places the order in the account and + # returns the status of the order from the brokerage. + # # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint # @param user_id [String] # @param user_secret [String] + # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request + # @param body [ValidatedTradeBody] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def place_order(trade_id:, user_id:, user_secret:, extra: {}) + def place_order(trade_id:, user_id:, user_secret:, wait_to_confirm: SENTINEL, extra: {}) + _body = {} + _body[:wait_to_confirm] = wait_to_confirm if wait_to_confirm != SENTINEL + extra[:validated_trade_body] = _body if !_body.empty? data, _status_code, _headers = place_order_with_http_info_impl(trade_id, user_id, user_secret, extra) data end # Place order # + # Places the specified trade object. This places the order in the account and + # returns the status of the order from the brokerage. + # # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint # @param user_id [String] # @param user_secret [String] + # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request + # @param body [ValidatedTradeBody] # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name - def place_order_with_http_info(trade_id:, user_id:, user_secret:, extra: {}) + def place_order_with_http_info(trade_id:, user_id:, user_secret:, wait_to_confirm: SENTINEL, extra: {}) + _body = {} + _body[:wait_to_confirm] = wait_to_confirm if wait_to_confirm != SENTINEL + extra[:validated_trade_body] = _body if !_body.empty? place_order_with_http_info_impl(trade_id, user_id, user_secret, extra) end # Place order + # Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters + # @option opts [ValidatedTradeBody] :validated_trade_body # @return [AccountOrderRecord] private def place_order_impl(trade_id, user_id, user_secret, opts = {}) data, _status_code, _headers = place_order_with_http_info(trade_id, user_id, user_secret, opts) @@ -679,10 +609,12 @@ def place_order_with_http_info(trade_id:, user_id:, user_secret:, extra: {}) end # Place order + # Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint # @param user_id [String] # @param user_secret [String] # @param [Hash] opts the optional parameters + # @option opts [ValidatedTradeBody] :validated_trade_body # @return [Array<(AccountOrderRecord, Integer, Hash)>] AccountOrderRecord data, response status code and response headers private def place_order_with_http_info_impl(trade_id, user_id, user_secret, opts = {}) if @api_client.config.debugging @@ -712,12 +644,17 @@ def place_order_with_http_info(trade_id:, user_id:, user_secret:, extra: {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'validated_trade_body']) # return_type return_type = opts[:debug_return_type] || 'AccountOrderRecord' diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_holdings_account.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_holdings_account.rb index 8543e73f0e..6690f47d74 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_holdings_account.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_holdings_account.rb @@ -19,6 +19,8 @@ class AccountHoldingsAccount attr_accessor :positions + attr_accessor :option_positions + attr_accessor :orders attr_accessor :total_value @@ -29,6 +31,7 @@ def self.attribute_map :'account' => :'account', :'balances' => :'balances', :'positions' => :'positions', + :'option_positions' => :'option_positions', :'orders' => :'orders', :'total_value' => :'total_value' } @@ -45,6 +48,7 @@ def self.openapi_types :'account' => :'SnapTradeHoldingsAccountAccountId', :'balances' => :'Array', :'positions' => :'Array', + :'option_positions' => :'Array', :'orders' => :'Array', :'total_value' => :'SnapTradeHoldingsTotalValue' } @@ -55,6 +59,7 @@ def self.openapi_nullable Set.new([ :'balances', :'positions', + :'option_positions', :'orders', ]) end @@ -90,6 +95,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'option_positions') + if (value = attributes[:'option_positions']).is_a?(Array) + self.option_positions = value + end + end + if attributes.key?(:'orders') if (value = attributes[:'orders']).is_a?(Array) self.orders = value @@ -122,6 +133,7 @@ def ==(o) account == o.account && balances == o.balances && positions == o.positions && + option_positions == o.option_positions && orders == o.orders && total_value == o.total_value end @@ -135,7 +147,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [account, balances, positions, orders, total_value].hash + [account, balances, positions, option_positions, orders, total_value].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_order_record.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_order_record.rb index 2cb7f4fac9..5be22d5c71 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_order_record.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_order_record.rb @@ -24,10 +24,9 @@ class AccountOrderRecord attr_accessor :option_symbol - # Trade Action + # Trade Action potential values include (but are not limited to) - BUY - SELL - BUY_COVER - SELL_SHORT - BUY_OPEN - BUY_CLOSE - SELL_OPEN - SELL_CLOSE attr_accessor :action - # Trade Units. Cannot work with notional value. attr_accessor :total_quantity # Trade Units @@ -48,7 +47,7 @@ class AccountOrderRecord # Stop Price. If stop loss or stop limit order, the price to trigger the stop attr_accessor :stop_price - # Order Type + # Order Type potential values include (but are not limited to) - Limit - Market - StopLimit - StopLoss attr_accessor :order_type # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date @@ -57,9 +56,10 @@ class AccountOrderRecord # Time attr_accessor :time_placed - # Time attr_accessor :time_updated + attr_accessor :time_executed + # Time attr_accessor :expiry_date @@ -83,6 +83,7 @@ def self.attribute_map :'time_in_force' => :'time_in_force', :'time_placed' => :'time_placed', :'time_updated' => :'time_updated', + :'time_executed' => :'time_executed', :'expiry_date' => :'expiry_date' } end @@ -100,7 +101,7 @@ def self.openapi_types :'symbol' => :'String', :'universal_symbol' => :'UniversalSymbol', :'option_symbol' => :'OptionsSymbol', - :'action' => :'Action', + :'action' => :'String', :'total_quantity' => :'Float', :'open_quantity' => :'Float', :'canceled_quantity' => :'Float', @@ -108,10 +109,11 @@ def self.openapi_types :'execution_price' => :'Float', :'limit_price' => :'Float', :'stop_price' => :'Float', - :'order_type' => :'OrderType', + :'order_type' => :'String', :'time_in_force' => :'String', :'time_placed' => :'String', :'time_updated' => :'String', + :'time_executed' => :'String', :'expiry_date' => :'String' } end @@ -119,12 +121,16 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_quantity', :'open_quantity', :'canceled_quantity', :'filled_quantity', :'execution_price', :'limit_price', :'stop_price', + :'order_type', + :'time_updated', + :'time_executed', ]) end @@ -211,6 +217,10 @@ def initialize(attributes = {}) self.time_updated = attributes[:'time_updated'] end + if attributes.key?(:'time_executed') + self.time_executed = attributes[:'time_executed'] + end + if attributes.key?(:'expiry_date') self.expiry_date = attributes[:'expiry_date'] end @@ -251,6 +261,7 @@ def ==(o) time_in_force == o.time_in_force && time_placed == o.time_placed && time_updated == o.time_updated && + time_executed == o.time_executed && expiry_date == o.expiry_date end @@ -263,7 +274,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [brokerage_order_id, status, symbol, universal_symbol, option_symbol, action, total_quantity, open_quantity, canceled_quantity, filled_quantity, execution_price, limit_price, stop_price, order_type, time_in_force, time_placed, time_updated, expiry_date].hash + [brokerage_order_id, status, symbol, universal_symbol, option_symbol, action, total_quantity, open_quantity, canceled_quantity, filled_quantity, execution_price, limit_price, stop_price, order_type, time_in_force, time_placed, time_updated, time_executed, expiry_date].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_sync_status.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_sync_status.rb index c3aa2b0e08..8b4523339d 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_sync_status.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/account_sync_status.rb @@ -15,10 +15,13 @@ module SnapTrade class AccountSyncStatus attr_accessor :transactions + attr_accessor :holdings + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'transactions' => :'transactions' + :'transactions' => :'transactions', + :'holdings' => :'holdings' } end @@ -30,7 +33,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'transactions' => :'TransactionsStatus' + :'transactions' => :'TransactionsStatus', + :'holdings' => :'HoldingsStatus' } end @@ -58,6 +62,10 @@ def initialize(attributes = {}) if attributes.key?(:'transactions') self.transactions = attributes[:'transactions'] end + + if attributes.key?(:'holdings') + self.holdings = attributes[:'holdings'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -78,7 +86,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - transactions == o.transactions + transactions == o.transactions && + holdings == o.holdings end # @see the `==` method @@ -90,7 +99,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [transactions].hash + [transactions, holdings].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action_strict.rb similarity index 83% rename from generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action.rb rename to generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action_strict.rb index ffd9a4ea52..5d8fc4689c 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/action_strict.rb @@ -11,7 +11,7 @@ require 'time' module SnapTrade - class Action + class ActionStrict BUY = "BUY".freeze SELL = "SELL".freeze @@ -30,8 +30,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if Action.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Action" + return value if ActionStrict.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #ActionStrict" end end end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/amount.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/amount.rb index 3100ca4901..53c253649e 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/amount.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/amount.rb @@ -11,7 +11,7 @@ require 'time' module SnapTrade - # Total Value of the account + # Total value of the account, as reported by the brokerage class Amount attr_accessor :amount diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/balance.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/balance.rb index 376d14c65c..a21a7bbfef 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/balance.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/balance.rb @@ -17,11 +17,14 @@ class Balance attr_accessor :cash + attr_accessor :buying_power + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'currency' => :'currency', - :'cash' => :'cash' + :'cash' => :'cash', + :'buying_power' => :'buying_power' } end @@ -34,14 +37,16 @@ def self.acceptable_attributes def self.openapi_types { :'currency' => :'Currency', - :'cash' => :'Float' + :'cash' => :'Float', + :'buying_power' => :'Float' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'cash' + :'cash', + :'buying_power' ]) end @@ -67,6 +72,10 @@ def initialize(attributes = {}) if attributes.key?(:'cash') self.cash = attributes[:'cash'] end + + if attributes.key?(:'buying_power') + self.buying_power = attributes[:'buying_power'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -88,7 +97,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && currency == o.currency && - cash == o.cash + cash == o.cash && + buying_power == o.buying_power end # @see the `==` method @@ -100,7 +110,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [currency, cash].hash + [currency, cash, buying_power].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage.rb index e208917392..5da85bad40 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage.rb @@ -14,14 +14,21 @@ module SnapTrade class Brokerage attr_accessor :id + # Full name of the brokerage. attr_accessor :name + # A display-friendly name of the brokerage. attr_accessor :display_name attr_accessor :description attr_accessor :aws_s3_logo_url + attr_accessor :aws_s3_square_logo_url + + attr_accessor :open_url + + # A unique identifier for that brokerage. It is usually the name of the brokerage in capital letters and will never change. attr_accessor :slug attr_accessor :url @@ -57,6 +64,8 @@ def self.attribute_map :'display_name' => :'display_name', :'description' => :'description', :'aws_s3_logo_url' => :'aws_s3_logo_url', + :'aws_s3_square_logo_url' => :'aws_s3_square_logo_url', + :'open_url' => :'open_url', :'slug' => :'slug', :'url' => :'url', :'enabled' => :'enabled', @@ -86,6 +95,8 @@ def self.openapi_types :'display_name' => :'String', :'description' => :'String', :'aws_s3_logo_url' => :'String', + :'aws_s3_square_logo_url' => :'String', + :'open_url' => :'String', :'slug' => :'String', :'url' => :'String', :'enabled' => :'Boolean', @@ -105,6 +116,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'aws_s3_square_logo_url', + :'open_url', :'allows_fractional_units', :'allows_trading', :'has_reporting', @@ -147,6 +160,14 @@ def initialize(attributes = {}) self.aws_s3_logo_url = attributes[:'aws_s3_logo_url'] end + if attributes.key?(:'aws_s3_square_logo_url') + self.aws_s3_square_logo_url = attributes[:'aws_s3_square_logo_url'] + end + + if attributes.key?(:'open_url') + self.open_url = attributes[:'open_url'] + end + if attributes.key?(:'slug') self.slug = attributes[:'slug'] end @@ -225,6 +246,8 @@ def ==(o) display_name == o.display_name && description == o.description && aws_s3_logo_url == o.aws_s3_logo_url && + aws_s3_square_logo_url == o.aws_s3_square_logo_url && + open_url == o.open_url && slug == o.slug && url == o.url && enabled == o.enabled && @@ -249,7 +272,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, display_name, description, aws_s3_logo_url, slug, url, enabled, maintenance_mode, allows_fractional_units, allows_trading, has_reporting, is_real_time_connection, allows_trading_through_snaptrade_api, is_scraping_integration, default_currency, brokerage_type, exchanges].hash + [id, name, display_name, description, aws_s3_logo_url, aws_s3_square_logo_url, open_url, slug, url, enabled, maintenance_mode, allows_fractional_units, allows_trading, has_reporting, is_real_time_connection, allows_trading_through_snaptrade_api, is_scraping_integration, default_currency, brokerage_type, exchanges].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb new file mode 100644 index 0000000000..e876c724a8 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb @@ -0,0 +1,217 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + class BrokerageAuthorizationDisabledConfirmation + # Connection disabled confirmation + attr_accessor :detail + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detail' => :'detail' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'detail' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BrokerageAuthorizationDisabledConfirmation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BrokerageAuthorizationDisabledConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [detail].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb new file mode 100644 index 0000000000..50f08f9531 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb @@ -0,0 +1,217 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + class BrokerageAuthorizationRefreshConfirmation + # Refresh confirmation details + attr_accessor :detail + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detail' => :'detail' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'detail' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BrokerageAuthorizationRefreshConfirmation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BrokerageAuthorizationRefreshConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [detail].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb index 78793c7abd..02961c5513 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb @@ -14,10 +14,10 @@ module SnapTrade class BrokerageAuthorizationTypeReadOnlyBrokerage attr_accessor :id - # Name of Brokerage + # Full name of the brokerage. attr_accessor :name - # Slug of Brokerage. It is usually the name of the brokerage in capital letters + # A unique identifier for that brokerage. It is usually the name of the brokerage in capital letters and will never change. attr_accessor :slug # Attribute mapping from ruby-style variable name to JSON key. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_symbol_symbol.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_symbol_symbol.rb index 6ad73429b4..4c6a937e19 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_symbol_symbol.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/brokerage_symbol_symbol.rb @@ -30,6 +30,8 @@ class BrokerageSymbolSymbol attr_accessor :figi_code + attr_accessor :figi_instrument + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -41,7 +43,8 @@ def self.attribute_map :'exchange' => :'exchange', :'type' => :'type', :'currencies' => :'currencies', - :'figi_code' => :'figi_code' + :'figi_code' => :'figi_code', + :'figi_instrument' => :'figi_instrument' } end @@ -61,7 +64,8 @@ def self.openapi_types :'exchange' => :'Exchange', :'type' => :'SecurityType', :'currencies' => :'Array', - :'figi_code' => :'String' + :'figi_code' => :'String', + :'figi_instrument' => :'SymbolFigiInstrument' } end @@ -69,7 +73,8 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'description', - :'figi_code' + :'figi_code', + :'figi_instrument' ]) end @@ -132,6 +137,10 @@ def initialize(attributes = {}) if attributes.key?(:'figi_code') self.figi_code = attributes[:'figi_code'] end + + if attributes.key?(:'figi_instrument') + self.figi_instrument = attributes[:'figi_instrument'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -190,7 +199,8 @@ def ==(o) exchange == o.exchange && type == o.type && currencies == o.currencies && - figi_code == o.figi_code + figi_code == o.figi_code && + figi_instrument == o.figi_instrument end # @see the `==` method @@ -202,7 +212,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code].hash + [id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/connections_session_events200_response_inner.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/connections_session_events200_response_inner.rb index a2233403f8..18421c3f6b 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/connections_session_events200_response_inner.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/connections_session_events200_response_inner.rb @@ -18,7 +18,7 @@ class ConnectionsSessionEvents200ResponseInner attr_accessor :session_id - # SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. attr_accessor :user_id # Time diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/delete_user_response.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/delete_user_response.rb index 0526058822..c3e5d7ecd8 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/delete_user_response.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/delete_user_response.rb @@ -16,7 +16,7 @@ class DeleteUserResponse # Delete status attr_accessor :status - # SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/trading_place_oco_order_request.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/figi_instrument.rb similarity index 84% rename from generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/trading_place_oco_order_request.rb rename to generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/figi_instrument.rb index 7cbdd4a364..30dacc0ccd 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/trading_place_oco_order_request.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/figi_instrument.rb @@ -11,18 +11,17 @@ require 'time' module SnapTrade - class TradingPlaceOCOOrderRequest - # The ID of first trade object obtained from trade/impact endpoint - attr_accessor :first_trade_id + # Open FIGI Identifiers + class FigiInstrument + attr_accessor :figi_code - # The ID of second trade object obtained from trade/impact endpoint - attr_accessor :second_trade_id + attr_accessor :figi_share_class # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'first_trade_id' => :'first_trade_id', - :'second_trade_id' => :'second_trade_id' + :'figi_code' => :'figi_code', + :'figi_share_class' => :'figi_share_class' } end @@ -34,16 +33,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'first_trade_id' => :'Object', - :'second_trade_id' => :'Object' + :'figi_code' => :'String', + :'figi_share_class' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'first_trade_id', - :'second_trade_id' + :'figi_code', + :'figi_share_class' ]) end @@ -51,23 +50,23 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::TradingPlaceOCOOrderRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::FigiInstrument` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::TradingPlaceOCOOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::FigiInstrument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'first_trade_id') - self.first_trade_id = attributes[:'first_trade_id'] + if attributes.key?(:'figi_code') + self.figi_code = attributes[:'figi_code'] end - if attributes.key?(:'second_trade_id') - self.second_trade_id = attributes[:'second_trade_id'] + if attributes.key?(:'figi_share_class') + self.figi_share_class = attributes[:'figi_share_class'] end end @@ -89,8 +88,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - first_trade_id == o.first_trade_id && - second_trade_id == o.second_trade_id + figi_code == o.figi_code && + figi_share_class == o.figi_share_class end # @see the `==` method @@ -102,7 +101,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [first_trade_id, second_trade_id].hash + [figi_code, figi_share_class].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/holdings_status.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/holdings_status.rb new file mode 100644 index 0000000000..68f34690cf --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/holdings_status.rb @@ -0,0 +1,228 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Status of account holdings sync + class HoldingsStatus + attr_accessor :initial_sync_completed + + # Date in ISO 8601 format or null (YYYY-MM-DD HH:MM:SS.mmmmmmTZ) + attr_accessor :last_successful_sync + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'initial_sync_completed' => :'initial_sync_completed', + :'last_successful_sync' => :'last_successful_sync' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'initial_sync_completed' => :'Boolean', + :'last_successful_sync' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'last_successful_sync' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::HoldingsStatus` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::HoldingsStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'initial_sync_completed') + self.initial_sync_completed = attributes[:'initial_sync_completed'] + end + + if attributes.key?(:'last_successful_sync') + self.last_successful_sync = attributes[:'last_successful_sync'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + initial_sync_completed == o.initial_sync_completed && + last_successful_sync == o.last_successful_sync + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [initial_sync_completed, last_successful_sync].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade.rb index 6c982d0336..de8e9f1aae 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade.rb @@ -28,7 +28,6 @@ class ManualTrade # Trade Action attr_accessor :action - # Trade Units. Cannot work with notional value. attr_accessor :units # Trade Price if limit or stop limit order @@ -58,10 +57,10 @@ def self.openapi_types { :'id' => :'String', :'account' => :'String', - :'order_type' => :'OrderType', + :'order_type' => :'OrderTypeStrict', :'time_in_force' => :'String', :'symbol' => :'ManualTradeSymbol', - :'action' => :'Action', + :'action' => :'ActionStrict', :'units' => :'Float', :'price' => :'Float' } @@ -70,6 +69,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'units', :'price' ]) end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form.rb index aae86b7306..a3eb07801d 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form.rb @@ -60,14 +60,14 @@ def self.acceptable_attributes def self.openapi_types { :'account_id' => :'String', - :'action' => :'Action', - :'order_type' => :'OrderType', + :'action' => :'ActionStrict', + :'order_type' => :'OrderTypeStrict', :'price' => :'Float', :'stop' => :'Float', :'time_in_force' => :'TimeInForceStrict', :'units' => :'Float', :'universal_symbol_id' => :'String', - :'notional_value' => :'Float' + :'notional_value' => :'ManualTradeFormNotionalValue' } end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form_notional_value.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form_notional_value.rb new file mode 100644 index 0000000000..3e992b1584 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/manual_trade_form_notional_value.rb @@ -0,0 +1,214 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + class ManualTradeFormNotionalValue + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'NotionalValue' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ManualTradeFormNotionalValue` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ManualTradeFormNotionalValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_already_disabled_exception.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_already_disabled_exception.rb new file mode 100644 index 0000000000..3d2fd013c7 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_already_disabled_exception.rb @@ -0,0 +1,228 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # This connection is already disabled. + class Model402BrokerageAuthAlreadyDisabledException + attr_accessor :detail + + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detail' => :'detail', + :'code' => :'code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'detail' => :'Object', + :'code' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'detail', + :'code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Model402BrokerageAuthAlreadyDisabledException` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Model402BrokerageAuthAlreadyDisabledException`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [detail, code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_disabled_response.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_disabled_response.rb new file mode 100644 index 0000000000..0f898a617b --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model402_brokerage_auth_disabled_response.rb @@ -0,0 +1,228 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Cannot perform action because connection is disabled + class Model402BrokerageAuthDisabledResponse + attr_accessor :detail + + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detail' => :'detail', + :'code' => :'code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'detail' => :'Object', + :'code' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'detail', + :'code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Model402BrokerageAuthDisabledResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Model402BrokerageAuthDisabledResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [detail, code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model403_feature_not_enabled_response.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model403_feature_not_enabled_response.rb new file mode 100644 index 0000000000..34d6ba9573 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/model403_feature_not_enabled_response.rb @@ -0,0 +1,228 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Example for failed request response + class Model403FeatureNotEnabledResponse + attr_accessor :detail + + attr_accessor :default_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detail' => :'detail', + :'default_code' => :'default_code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'detail' => :'Object', + :'default_code' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'detail', + :'default_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Model403FeatureNotEnabledResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Model403FeatureNotEnabledResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'default_code') + self.default_code = attributes[:'default_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + detail == o.detail && + default_code == o.default_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [detail, default_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/notional_value.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/notional_value.rb new file mode 100644 index 0000000000..cbb40479dc --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/notional_value.rb @@ -0,0 +1,103 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca, Alpaca Paper, and Robinhood.** + module NotionalValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Float', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = SnapTrade.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/option_brokerage_symbol.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/option_brokerage_symbol.rb new file mode 100644 index 0000000000..6aa2c956a5 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/option_brokerage_symbol.rb @@ -0,0 +1,235 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Option Brokerage symbol + class OptionBrokerageSymbol + attr_accessor :id + + attr_accessor :description + + attr_accessor :option_symbol + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'description' => :'description', + :'option_symbol' => :'option_symbol' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'description' => :'String', + :'option_symbol' => :'OptionsSymbol' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::OptionBrokerageSymbol` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::OptionBrokerageSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'option_symbol') + self.option_symbol = attributes[:'option_symbol'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + description == o.description && + option_symbol == o.option_symbol + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, description, option_symbol].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_place_option_strategy_request.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_place_option_strategy_request.rb index 53e64c2c03..6959ed2924 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_place_option_strategy_request.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_place_option_strategy_request.rb @@ -38,7 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'order_type' => :'OrderType', + :'order_type' => :'OrderTypeStrict', :'time_in_force' => :'TimeInForceStrict', :'price' => :'Float' } diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_position.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_position.rb index d2bccecf6e..3060bbf5e9 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_position.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/options_position.rb @@ -44,7 +44,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'symbol' => :'BrokerageSymbol', + :'symbol' => :'OptionBrokerageSymbol', :'price' => :'Float', :'units' => :'Float', :'currency' => :'OptionsPositionCurrency', diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type_strict.rb similarity index 84% rename from generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type.rb rename to generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type_strict.rb index 0cd5ef38bb..d70245b707 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/order_type_strict.rb @@ -11,7 +11,7 @@ require 'time' module SnapTrade - class OrderType + class OrderTypeStrict LIMIT = "Limit".freeze MARKET = "Market".freeze STOP_LIMIT = "StopLimit".freeze @@ -32,8 +32,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if OrderType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #OrderType" + return value if OrderTypeStrict.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #OrderTypeStrict" end end end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event.rb index 4153264207..aff18b11ca 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event.rb @@ -18,7 +18,7 @@ class SessionEvent attr_accessor :session_id - # SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. attr_accessor :user_id # Time diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event_type.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event_type.rb index 098bf07039..0a45c80a40 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event_type.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/session_event_type.rb @@ -12,16 +12,24 @@ module SnapTrade class SessionEventType - CONNECTION_FAILED = "CONNECTION_FAILED".freeze + OAUTH_REDIRECT = "OAUTH_REDIRECT".freeze DISCLAIMER_ACCEPTED = "DISCLAIMER_ACCEPTED".freeze BROKERAGE_CONNECTION_INITIATED = "BROKERAGE_CONNECTION_INITIATED".freeze + BROKERAGE_RECONNECT_INITIATED = "BROKERAGE_RECONNECT_INITIATED".freeze BROKERAGE_AUTHENTICATION = "BROKERAGE_AUTHENTICATION".freeze - MFA_AUTHORIZATION = "MFA_AUTHORIZATION".freeze + OAUTH_BROKERAGE_AUTHENTICATION = "OAUTH_BROKERAGE_AUTHENTICATION".freeze + MFA_REQUESTED = "MFA_REQUESTED".freeze + MFA_SUBMITTED = "MFA_SUBMITTED".freeze + MFA_CHOICE_REQUESTED = "MFA_CHOICE_REQUESTED".freeze + MFA_CHOICE_SUBMITTED = "MFA_CHOICE_SUBMITTED".freeze CONNECTION_SUCCESSFUL = "CONNECTION_SUCCESSFUL".freeze + CONNECTION_FAILED = "CONNECTION_FAILED".freeze PARTNER_REDIRECT = "PARTNER_REDIRECT".freeze + CONNECTION_ABORTED = "CONNECTION_ABORTED".freeze + SESSION_STARTED = "SESSION_STARTED".freeze def self.all_vars - @all_vars ||= [CONNECTION_FAILED, DISCLAIMER_ACCEPTED, BROKERAGE_CONNECTION_INITIATED, BROKERAGE_AUTHENTICATION, MFA_AUTHORIZATION, CONNECTION_SUCCESSFUL, PARTNER_REDIRECT].freeze + @all_vars ||= [OAUTH_REDIRECT, DISCLAIMER_ACCEPTED, BROKERAGE_CONNECTION_INITIATED, BROKERAGE_RECONNECT_INITIATED, BROKERAGE_AUTHENTICATION, OAUTH_BROKERAGE_AUTHENTICATION, MFA_REQUESTED, MFA_SUBMITTED, MFA_CHOICE_REQUESTED, MFA_CHOICE_SUBMITTED, CONNECTION_SUCCESSFUL, CONNECTION_FAILED, PARTNER_REDIRECT, CONNECTION_ABORTED, SESSION_STARTED].freeze end # Builds the enum from string diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb index acd72eb08a..0774fa6de5 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb @@ -25,6 +25,8 @@ class SnapTradeHoldingsAccountAccountId attr_accessor :institution_name + attr_accessor :balance + attr_accessor :meta attr_accessor :cash_restrictions @@ -41,6 +43,7 @@ def self.attribute_map :'name' => :'name', :'number' => :'number', :'institution_name' => :'institution_name', + :'balance' => :'balance', :'meta' => :'meta', :'cash_restrictions' => :'cash_restrictions', :'created_date' => :'created_date' @@ -61,6 +64,7 @@ def self.openapi_types :'name' => :'String', :'number' => :'String', :'institution_name' => :'String', + :'balance' => :'SnapTradeHoldingsAccountAccountIdBalance', :'meta' => :'Hash', :'cash_restrictions' => :'Array', :'created_date' => :'String' @@ -71,6 +75,7 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'name', + :'balance', ]) end @@ -113,6 +118,10 @@ def initialize(attributes = {}) self.institution_name = attributes[:'institution_name'] end + if attributes.key?(:'balance') + self.balance = attributes[:'balance'] + end + if attributes.key?(:'meta') if (value = attributes[:'meta']).is_a?(Hash) self.meta = value @@ -154,6 +163,7 @@ def ==(o) name == o.name && number == o.number && institution_name == o.institution_name && + balance == o.balance && meta == o.meta && cash_restrictions == o.cash_restrictions && created_date == o.created_date @@ -168,7 +178,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, brokerage_authorization, portfolio_group, name, number, institution_name, meta, cash_restrictions, created_date].hash + [id, brokerage_authorization, portfolio_group, name, number, institution_name, balance, meta, cash_restrictions, created_date].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id_balance.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id_balance.rb new file mode 100644 index 0000000000..049e024613 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_account_account_id_balance.rb @@ -0,0 +1,224 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + class SnapTradeHoldingsAccountAccountIdBalance + attr_accessor :total + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total' => :'total' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'total' => :'AccountBalanceTotal' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'total' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'AccountBalance' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SnapTradeHoldingsAccountAccountIdBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SnapTradeHoldingsAccountAccountIdBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total == o.total + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [total].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_total_value.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_total_value.rb index 314d97c833..a15fa5da40 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_total_value.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_holdings_total_value.rb @@ -11,7 +11,7 @@ require 'time' module SnapTrade - # Summed value of account positions and cash balances + # Calculated based on the sum of the values of account positions and cash balances class SnapTradeHoldingsTotalValue attr_accessor :value diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_register_user_request_body.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_register_user_request_body.rb index fec0ee2660..2ee1fc54df 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_register_user_request_body.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/snap_trade_register_user_request_body.rb @@ -13,7 +13,7 @@ module SnapTrade # Data required to register a user via SnapTrade Partner class SnapTradeRegisterUserRequestBody - # SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/strategy_order_record.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/strategy_order_record.rb index abc90b25b9..763dc3b6d9 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/strategy_order_record.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/strategy_order_record.rb @@ -23,7 +23,7 @@ class StrategyOrderRecord attr_accessor :closed_quantity - # Order Type + # Order Type potential values include (but are not limited to) - Limit - Market - StopLimit - StopLoss attr_accessor :order_type # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date @@ -71,7 +71,7 @@ def self.openapi_types :'filled_quantity' => :'Float', :'open_quantity' => :'Float', :'closed_quantity' => :'Float', - :'order_type' => :'OrderType', + :'order_type' => :'String', :'time_in_force' => :'String', :'limit_price' => :'Float', :'execution_price' => :'Float', @@ -83,6 +83,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'order_type', :'limit_price', :'execution_price', ]) diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol.rb index c4bdadf5fc..dd5e5b1adc 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol.rb @@ -29,6 +29,8 @@ class Symbol attr_accessor :figi_code + attr_accessor :figi_instrument + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -39,7 +41,8 @@ def self.attribute_map :'currency' => :'currency', :'exchange' => :'exchange', :'type' => :'type', - :'figi_code' => :'figi_code' + :'figi_code' => :'figi_code', + :'figi_instrument' => :'figi_instrument' } end @@ -58,14 +61,16 @@ def self.openapi_types :'currency' => :'Currency', :'exchange' => :'Exchange', :'type' => :'SecurityType', - :'figi_code' => :'String' + :'figi_code' => :'String', + :'figi_instrument' => :'SymbolFigiInstrument' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'figi_code' + :'figi_code', + :'figi_instrument' ]) end @@ -115,6 +120,10 @@ def initialize(attributes = {}) if attributes.key?(:'figi_code') self.figi_code = attributes[:'figi_code'] end + + if attributes.key?(:'figi_instrument') + self.figi_instrument = attributes[:'figi_instrument'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -142,7 +151,8 @@ def ==(o) currency == o.currency && exchange == o.exchange && type == o.type && - figi_code == o.figi_code + figi_code == o.figi_code && + figi_instrument == o.figi_instrument end # @see the `==` method @@ -154,7 +164,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, symbol, raw_symbol, name, currency, exchange, type, figi_code].hash + [id, symbol, raw_symbol, name, currency, exchange, type, figi_code, figi_instrument].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol_figi_instrument.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol_figi_instrument.rb new file mode 100644 index 0000000000..28da805e33 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/symbol_figi_instrument.rb @@ -0,0 +1,234 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + class SymbolFigiInstrument + attr_accessor :figi_code + + attr_accessor :figi_share_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'figi_code' => :'figi_code', + :'figi_share_class' => :'figi_share_class' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'figi_code' => :'String', + :'figi_share_class' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'figi_code', + :'figi_share_class' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'FigiInstrument' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SymbolFigiInstrument` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SymbolFigiInstrument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'figi_code') + self.figi_code = attributes[:'figi_code'] + end + + if attributes.key?(:'figi_share_class') + self.figi_share_class = attributes[:'figi_share_class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + figi_code == o.figi_code && + figi_share_class == o.figi_share_class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [figi_code, figi_share_class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/transactions_status.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/transactions_status.rb index 2fdfdd2095..c4cf1b1b33 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/transactions_status.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/transactions_status.rb @@ -18,11 +18,15 @@ class TransactionsStatus # Date in YYYY-MM-DD format or null attr_accessor :last_successful_sync + # Date in YYYY-MM-DD format or null + attr_accessor :first_transaction_date + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'initial_sync_completed' => :'initial_sync_completed', - :'last_successful_sync' => :'last_successful_sync' + :'last_successful_sync' => :'last_successful_sync', + :'first_transaction_date' => :'first_transaction_date' } end @@ -35,14 +39,16 @@ def self.acceptable_attributes def self.openapi_types { :'initial_sync_completed' => :'Boolean', - :'last_successful_sync' => :'Date' + :'last_successful_sync' => :'Date', + :'first_transaction_date' => :'Date' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'last_successful_sync' + :'last_successful_sync', + :'first_transaction_date' ]) end @@ -68,6 +74,10 @@ def initialize(attributes = {}) if attributes.key?(:'last_successful_sync') self.last_successful_sync = attributes[:'last_successful_sync'] end + + if attributes.key?(:'first_transaction_date') + self.first_transaction_date = attributes[:'first_transaction_date'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -89,7 +99,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && initial_sync_completed == o.initial_sync_completed && - last_successful_sync == o.last_successful_sync + last_successful_sync == o.last_successful_sync && + first_transaction_date == o.first_transaction_date end # @see the `==` method @@ -101,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [initial_sync_completed, last_successful_sync].hash + [initial_sync_completed, last_successful_sync, first_transaction_date].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/underlying_symbol.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/underlying_symbol.rb index 2e88938ecd..fb54703a5c 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/underlying_symbol.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/underlying_symbol.rb @@ -29,6 +29,8 @@ class UnderlyingSymbol attr_accessor :figi_code + attr_accessor :figi_instrument + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -39,7 +41,8 @@ def self.attribute_map :'exchange' => :'exchange', :'type' => :'type', :'currencies' => :'currencies', - :'figi_code' => :'figi_code' + :'figi_code' => :'figi_code', + :'figi_instrument' => :'figi_instrument' } end @@ -58,7 +61,8 @@ def self.openapi_types :'exchange' => :'USExchange', :'type' => :'SecurityType', :'currencies' => :'Array', - :'figi_code' => :'String' + :'figi_code' => :'String', + :'figi_instrument' => :'SymbolFigiInstrument' } end @@ -66,7 +70,8 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'description', - :'figi_code' + :'figi_code', + :'figi_instrument' ]) end @@ -118,6 +123,10 @@ def initialize(attributes = {}) if attributes.key?(:'figi_code') self.figi_code = attributes[:'figi_code'] end + + if attributes.key?(:'figi_instrument') + self.figi_instrument = attributes[:'figi_instrument'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -145,7 +154,8 @@ def ==(o) exchange == o.exchange && type == o.type && currencies == o.currencies && - figi_code == o.figi_code + figi_code == o.figi_code && + figi_instrument == o.figi_instrument end # @see the `==` method @@ -157,7 +167,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, symbol, description, currency, exchange, type, currencies, figi_code].hash + [id, symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/universal_symbol.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/universal_symbol.rb index 622007eeaa..64cab9e0d8 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/universal_symbol.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/universal_symbol.rb @@ -31,6 +31,8 @@ class UniversalSymbol attr_accessor :figi_code + attr_accessor :figi_instrument + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -42,7 +44,8 @@ def self.attribute_map :'exchange' => :'exchange', :'type' => :'type', :'currencies' => :'currencies', - :'figi_code' => :'figi_code' + :'figi_code' => :'figi_code', + :'figi_instrument' => :'figi_instrument' } end @@ -62,7 +65,8 @@ def self.openapi_types :'exchange' => :'Exchange', :'type' => :'SecurityType', :'currencies' => :'Array', - :'figi_code' => :'String' + :'figi_code' => :'String', + :'figi_instrument' => :'SymbolFigiInstrument' } end @@ -70,7 +74,8 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'description', - :'figi_code' + :'figi_code', + :'figi_instrument' ]) end @@ -126,6 +131,10 @@ def initialize(attributes = {}) if attributes.key?(:'figi_code') self.figi_code = attributes[:'figi_code'] end + + if attributes.key?(:'figi_instrument') + self.figi_instrument = attributes[:'figi_instrument'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -184,7 +193,8 @@ def ==(o) exchange == o.exchange && type == o.type && currencies == o.currencies && - figi_code == o.figi_code + figi_code == o.figi_code && + figi_instrument == o.figi_instrument end # @see the `==` method @@ -196,7 +206,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code].hash + [id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash end # Builds the object from hash diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/user_i_dand_secret.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/user_i_dand_secret.rb index 1bf4e32785..f3dd8db963 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/user_i_dand_secret.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/user_i_dand_secret.rb @@ -13,10 +13,10 @@ module SnapTrade # Response when register user is successful class UserIDandSecret - # SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user + # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable. attr_accessor :user_id - # SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user. + # SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. attr_accessor :user_secret # Attribute mapping from ruby-style variable name to JSON key. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/validated_trade_body.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/validated_trade_body.rb new file mode 100644 index 0000000000..0dee4fb304 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/models/validated_trade_body.rb @@ -0,0 +1,219 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'date' +require 'time' + +module SnapTrade + # Validated Trade Form + class ValidatedTradeBody + # Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request + attr_accessor :wait_to_confirm + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'wait_to_confirm' => :'wait_to_confirm' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'wait_to_confirm' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'wait_to_confirm' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ValidatedTradeBody` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ValidatedTradeBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'wait_to_confirm') + self.wait_to_confirm = attributes[:'wait_to_confirm'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + wait_to_confirm == o.wait_to_confirm + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [wait_to_confirm].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SnapTrade.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/version.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/version.rb index 0f3e70f44d..aeb839d687 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/version.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/lib/snaptrade/version.rb @@ -8,5 +8,5 @@ =end module SnapTrade - VERSION = '2.0.4' + VERSION = '2.0.29' end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/account_information_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/account_information_api_spec.rb index c48a03dbd5..38203c3ed1 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/account_information_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/account_information_api_spec.rb @@ -29,6 +29,7 @@ # unit tests for get_all_user_holdings # List all accounts for the user, plus balances, positions, and orders for each account. + # Lists balances, positions and orders for the specified account. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param user_id # @param user_secret # @param [Hash] opts the optional parameters @@ -56,6 +57,7 @@ # unit tests for get_user_account_details # Return details of a specific investment account + # Returns an account object with details for the specified account, including the total account market value. # @param user_id # @param user_secret # @param account_id The ID of the account to get detail of. @@ -75,7 +77,7 @@ # @param account_id The ID of the account to get orders. # @param [Hash] opts the optional parameters # @option opts [String] :state defaults value is set to \"all\" - # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. + # @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. # @return [Array] describe 'get_user_account_orders test' do it 'should work' do @@ -85,6 +87,7 @@ # unit tests for get_user_account_positions # List account positions + # Returns a list of positions in the specified account. # @param user_id # @param user_secret # @param account_id The ID of the account to get positions. @@ -98,6 +101,7 @@ # unit tests for get_user_holdings # List balances, positions and orders for the specified account + # Lists balances, positions and orders for the specified account as well as option_positions and account metadata. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints. # @param account_id The ID of the account to fetch holdings for. # @param user_id # @param user_secret @@ -111,6 +115,7 @@ # unit tests for list_user_accounts # List accounts + # Get a list of all Account objects for the authenticated SnapTrade user. # @param user_id # @param user_secret # @param [Hash] opts the optional parameters @@ -123,6 +128,7 @@ # unit tests for update_user_account # Update details of an investment account + # Updates various properties of a specified account. # @param user_id # @param user_secret # @param account_id The ID of the account to update. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/authentication_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/authentication_api_spec.rb index 2ae605d546..ec1e4b3dc8 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/authentication_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/authentication_api_spec.rb @@ -39,18 +39,6 @@ end end - # unit tests for get_user_jwt - # Generate encrypted JWT token - # @param user_id - # @param user_secret - # @param [Hash] opts the optional parameters - # @return [EncryptedResponse] - describe 'get_user_jwt test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - # unit tests for list_snap_trade_users # List SnapTrade users # Returns a list of users you've registered over the SnapTrade API. @@ -78,6 +66,7 @@ # unit tests for register_snap_trade_user # Create SnapTrade user + # Registers a new SnapTrade user under your ClientID. Most SnapTrade operations require a user to be passed as a parameter. # @param snap_trade_register_user_request_body # @param [Hash] opts the optional parameters # @return [UserIDandSecret] @@ -89,6 +78,7 @@ # unit tests for reset_snap_trade_user_secret # Obtain a new user secret for a user + # This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. # @param user_i_dand_secret # @param [Hash] opts the optional parameters # @return [UserIDandSecret] diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/connections_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/connections_api_spec.rb index 67a5d62175..182e186671 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/connections_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/connections_api_spec.rb @@ -29,6 +29,7 @@ # unit tests for detail_brokerage_authorization # Get brokerage authorization details + # Returns a single brokerage authorization object for the specified ID. # @param authorization_id The ID of a brokerage authorization object. # @param user_id # @param user_secret @@ -40,8 +41,23 @@ end end + # unit tests for disable_brokerage_authorization + # Manually disable a connection for testing + # Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + # @param authorization_id The ID of a brokerage authorization object. + # @param user_id + # @param user_secret + # @param [Hash] opts the optional parameters + # @return [BrokerageAuthorizationDisabledConfirmation] + describe 'disable_brokerage_authorization test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for list_brokerage_authorizations - # List all brokerage authorizations for the user + # List all brokerage authorizations for the User + # Returns a list of Brokerage Authorization objects for the user # @param user_id # @param user_secret # @param [Hash] opts the optional parameters @@ -52,8 +68,23 @@ end end + # unit tests for refresh_brokerage_authorization + # Refresh holdings for a connection + # Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes + # @param authorization_id The ID of a brokerage authorization object. + # @param user_id + # @param user_secret + # @param [Hash] opts the optional parameters + # @return [BrokerageAuthorizationRefreshConfirmation] + describe 'refresh_brokerage_authorization test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for remove_brokerage_authorization # Delete brokerage authorization + # Deletes a specified brokerage authorization given by the ID. # @param authorization_id The ID of the Authorization to delete. # @param user_id # @param user_secret @@ -66,7 +97,8 @@ end # unit tests for session_events - # List all session events for the partner + # Get all session events for a user + # Returns a list of session events associated with a user. # @param partner_client_id # @param [Hash] opts the optional parameters # @option opts [String] :user_id Optional comma seperated list of user IDs used to filter the request on specific users diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/error_logs_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/error_logs_api_spec.rb deleted file mode 100644 index d2b9f9bc70..0000000000 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/error_logs_api_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#SnapTrade - -#Connect brokerage accounts to your app for live positions and trading - -The version of the OpenAPI document: 1.0.0 -Contact: api@snaptrade.com -=end - -require 'spec_helper' -require 'json' - -# Unit tests for SnapTrade::ErrorLogsApi -describe 'ErrorLogsApi' do - before do - # run before each test - @api_instance = SnapTrade::ErrorLogsApi.new - end - - after do - # run after each test - end - - describe 'test an instance of ErrorLogsApi' do - it 'should create an instance of ErrorLogsApi' do - expect(@api_instance).to be_instance_of(SnapTrade::ErrorLogsApi) - end - end - - # unit tests for list_user_errors - # Retrieve error logs on behalf of your SnapTrade users - # @param user_id - # @param user_secret - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_user_errors test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/options_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/options_api_spec.rb index 4ed46a23e1..9aa95dbf71 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/options_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/options_api_spec.rb @@ -28,7 +28,8 @@ end # unit tests for get_option_strategy - # Creates an option strategy object that will be used to place an option strategy order + # Create options strategy + # Creates an option strategy object that will be used to place an option strategy order. # @param user_id # @param user_secret # @param account_id The ID of the account to create the option strategy object in. @@ -42,7 +43,8 @@ end # unit tests for get_options_chain - # Get the options chain + # Get the options chain for a symbol + # Returns the option chain for the specified symbol in the specified account. # @param user_id # @param user_secret # @param account_id The ID of the account to get the options chain from. @@ -56,7 +58,8 @@ end # unit tests for get_options_strategy_quote - # Get latest market data of option strategy + # Get options strategy quotes + # Returns a Strategy Quotes object which has latest market data of the specified option strategy. # @param user_id # @param user_secret # @param account_id The ID of the account the strategy will be placed in. @@ -70,7 +73,8 @@ end # unit tests for list_option_holdings - # Get the options holdings in the account + # Get account option holdings + # Returns a list of Options Positions. # @param user_id # @param user_secret # @param account_id The ID of the account to fetch options holdings for. @@ -83,7 +87,8 @@ end # unit tests for place_option_strategy - # Place an option strategy order on the brokerage + # Place an option strategy order + # Places the option strategy order and returns the order record received from the brokerage. # @param user_id # @param user_secret # @param account_id The ID of the account to execute the strategy in. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/reference_data_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/reference_data_api_spec.rb index 013145f3b2..912e8a3fa0 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/reference_data_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/reference_data_api_spec.rb @@ -28,7 +28,8 @@ end # unit tests for get_currency_exchange_rate_pair - # Return the exchange rate of a currency pair + # Get exchange rate of a currency pair + # Returns an Exchange Rate Pair object for the specified Currency Pair. # @param currency_pair A currency pair based on currency code for example, {CAD-USD} # @param [Hash] opts the optional parameters # @return [ExchangeRatePairs] @@ -40,6 +41,7 @@ # unit tests for get_partner_info # Get metadata related to Snaptrade partner + # Returns useful data related to the specified ClientID, including allowed brokerages and data access. # @param [Hash] opts the optional parameters # @return [PartnerData] describe 'get_partner_info test' do @@ -60,7 +62,8 @@ end # unit tests for get_stock_exchanges - # List exchanges + # Get exchanges + # Returns a list of all supported Exchanges. # @param [Hash] opts the optional parameters # @return [Array] describe 'get_stock_exchanges test' do @@ -71,6 +74,7 @@ # unit tests for get_symbols # Search for symbols + # Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. # @param [Hash] opts the optional parameters # @option opts [SymbolQuery] :symbol_query # @return [Array] @@ -81,7 +85,8 @@ end # unit tests for get_symbols_by_ticker - # Get details of a symbol by the ticker or the universal_symbol_id + # Get details of a symbol + # Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. # @param query The ticker or universal_symbol_id of the UniversalSymbol to get. # @param [Hash] opts the optional parameters # @return [UniversalSymbol] @@ -92,7 +97,8 @@ end # unit tests for list_all_brokerage_authorization_type - # List of all brokerage authorization types + # Get all brokerage authorization types + # Returns a list of all defined Brokerage authorization Type objects. # @param [Hash] opts the optional parameters # @option opts [String] :brokerage Comma separated value of brokerage slugs # @return [Array] @@ -103,7 +109,8 @@ end # unit tests for list_all_brokerages - # List brokerages + # Get brokerages + # Returns a list of all defined Brokerage objects. # @param [Hash] opts the optional parameters # @return [Array] describe 'list_all_brokerages test' do @@ -113,7 +120,8 @@ end # unit tests for list_all_currencies - # List currencies + # Get currencies + # Returns a list of all defined Currency objects. # @param [Hash] opts the optional parameters # @return [Array] describe 'list_all_currencies test' do @@ -123,7 +131,8 @@ end # unit tests for list_all_currencies_rates - # List currency exchange rates + # Get currency exchange rates + # Returns a list of all Exchange Rate Pairs for all supported Currencies. # @param [Hash] opts the optional parameters # @return [Array] describe 'list_all_currencies_rates test' do @@ -134,6 +143,7 @@ # unit tests for symbol_search_user_account # Search for symbols available in an account + # Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. # @param user_id # @param user_secret # @param account_id The ID of the account to search for symbols within. diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/trading_api_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/trading_api_spec.rb index 9489327d3b..1010994a06 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/trading_api_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/api/trading_api_spec.rb @@ -29,6 +29,7 @@ # unit tests for cancel_user_account_order # Cancel open order in account + # Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. # @param user_id # @param user_secret # @param account_id The ID of the account to cancel the order in. @@ -42,7 +43,8 @@ end # unit tests for get_order_impact - # Check impact of trades on account. + # Check the impact of a trade on an account + # Return the trade object and it's impact on the account for the specified order. # @param user_id # @param user_secret # @param manual_trade_form @@ -56,6 +58,7 @@ # unit tests for get_user_account_quotes # Get symbol quotes + # Returns live quote(s) from the brokerage for the specified symbol(s). # @param user_id # @param user_secret # @param symbols List of universal_symbol_id or tickers to get quotes for. @@ -71,6 +74,7 @@ # unit tests for place_force_order # Place a trade with NO validation. + # Places a specified trade in the specified account. # @param user_id # @param user_secret # @param manual_trade_form @@ -82,25 +86,14 @@ end end - # unit tests for place_oco_order - # Place a OCO (One Cancels Other) order - # @param user_id - # @param user_secret - # @param trading_place_oco_order_request - # @param [Hash] opts the optional parameters - # @return [AccountOrderRecord] - describe 'place_oco_order test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - # unit tests for place_order # Place order + # Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. # @param trade_id The ID of trade object obtained from trade/impact endpoint # @param user_id # @param user_secret # @param [Hash] opts the optional parameters + # @option opts [ValidatedTradeBody] :validated_trade_body # @return [AccountOrderRecord] describe 'place_order test' do it 'should work' do diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/getting_started_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/getting_started_spec.rb index 3cc68b734b..884b85af6a 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/getting_started_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/getting_started_spec.rb @@ -25,9 +25,9 @@ describe 'optional non body parameters should be passed' do it 'should pass' do configuration = SnapTrade::Configuration.new - configuration.client_id = "SNAPTRADE_CLIENT_ID" - configuration.consumer_key = "SNAPTRADE_CONSUMER_KEY" - configuration.host = "http://127.0.0.1:4072" + configuration.client_id = ENV["SNAPTRADE_CLIENT_ID"] + configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"] + configuration.host = "http://127.0.0.1:4010" snaptrade = SnapTrade::Client.new(configuration) data, status_code, headers, response = snaptrade.account_information.get_user_account_orders_with_http_info( @@ -46,9 +46,8 @@ describe 'getting started flow static pattern' do it 'should work' do # 1) Setup - SnapTrade.client_id = "SNAPTRADE_CLIENT_ID" - SnapTrade.consumer_key = "SNAPTRADE_CONSUMER_KEY" - SnapTrade.host = "http://127.0.0.1:4072" + SnapTrade.client_id = ENV["SNAPTRADE_CLIENT_ID"] + SnapTrade.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"] # 2) Check API Status response = SnapTrade::APIStatus.check() @@ -78,9 +77,8 @@ it 'should work' do # 1) Setup configuration = SnapTrade::Configuration.new - configuration.client_id = "SNAPTRADE_CLIENT_ID" - configuration.consumer_key = "SNAPTRADE_CONSUMER_KEY" - configuration.host = "http://127.0.0.1:4072" + configuration.client_id = ENV["SNAPTRADE_CLIENT_ID"] + configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"] snaptrade = SnapTrade::Client.new(configuration) # 2) Check that the client is able to make a request to the API server. @@ -107,19 +105,10 @@ end end - it 'with_http_info' do - SnapTrade.client_id = "SNAPTRADE_CLIENT_ID" - SnapTrade.consumer_key = "SNAPTRADE_CONSUMER_KEY" - SnapTrade.host = "http://127.0.0.1:4072" - response = SnapTrade::APIStatus.check_with_http_info - expect(response).not_to be_nil - expect(response[1]).to eq(200) - end - describe 'setting consumer key to nil' do it 'should fail with ArgumentError' do expect { SnapTrade.consumer_key = nil }.to raise_error(ArgumentError) - SnapTrade.consumer_key = "SNAPTRADE_CONSUMER_KEY" + SnapTrade.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"] end end end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_holdings_account_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_holdings_account_spec.rb index 32be38b9e4..5324ce3ded 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_holdings_account_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_holdings_account_spec.rb @@ -38,6 +38,12 @@ end end + describe 'test attribute "option_positions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "orders"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_order_record_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_order_record_spec.rb index 28bab79c89..ada87f135b 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_order_record_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_order_record_spec.rb @@ -122,6 +122,12 @@ end end + describe 'test attribute "time_executed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "expiry_date"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_sync_status_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_sync_status_spec.rb index 50bbb34129..c9305641d3 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_sync_status_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/account_sync_status_spec.rb @@ -26,4 +26,10 @@ end end + describe 'test attribute "holdings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_spec.rb deleted file mode 100644 index 7d768fa8ae..0000000000 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -=begin -#SnapTrade - -#Connect brokerage accounts to your app for live positions and trading - -The version of the OpenAPI document: 1.0.0 -Contact: api@snaptrade.com -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SnapTrade::Action -describe SnapTrade::Action do - let(:instance) { SnapTrade::Action.new } - - describe 'test an instance of Action' do - it 'should create an instance of Action' do - expect(instance).to be_instance_of(SnapTrade::Action) - end - end -end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_strict_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_strict_spec.rb new file mode 100644 index 0000000000..102475509b --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/action_strict_spec.rb @@ -0,0 +1,23 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::ActionStrict +describe SnapTrade::ActionStrict do + let(:instance) { SnapTrade::ActionStrict.new } + + describe 'test an instance of ActionStrict' do + it 'should create an instance of ActionStrict' do + expect(instance).to be_instance_of(SnapTrade::ActionStrict) + end + end +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/balance_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/balance_spec.rb index 833a1b923d..9316664ac3 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/balance_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/balance_spec.rb @@ -32,4 +32,10 @@ end end + describe 'test attribute "buying_power"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_disabled_confirmation_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_disabled_confirmation_spec.rb new file mode 100644 index 0000000000..6813f0a09d --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_disabled_confirmation_spec.rb @@ -0,0 +1,29 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::BrokerageAuthorizationDisabledConfirmation +describe SnapTrade::BrokerageAuthorizationDisabledConfirmation do + let(:instance) { SnapTrade::BrokerageAuthorizationDisabledConfirmation.new } + + describe 'test an instance of BrokerageAuthorizationDisabledConfirmation' do + it 'should create an instance of BrokerageAuthorizationDisabledConfirmation' do + expect(instance).to be_instance_of(SnapTrade::BrokerageAuthorizationDisabledConfirmation) + end + end + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_refresh_confirmation_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_refresh_confirmation_spec.rb new file mode 100644 index 0000000000..ed92314023 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_authorization_refresh_confirmation_spec.rb @@ -0,0 +1,29 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::BrokerageAuthorizationRefreshConfirmation +describe SnapTrade::BrokerageAuthorizationRefreshConfirmation do + let(:instance) { SnapTrade::BrokerageAuthorizationRefreshConfirmation.new } + + describe 'test an instance of BrokerageAuthorizationRefreshConfirmation' do + it 'should create an instance of BrokerageAuthorizationRefreshConfirmation' do + expect(instance).to be_instance_of(SnapTrade::BrokerageAuthorizationRefreshConfirmation) + end + end + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_spec.rb index c28534e2e8..6ddbc9e3ce 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_spec.rb @@ -50,6 +50,18 @@ end end + describe 'test attribute "aws_s3_square_logo_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "open_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "slug"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_symbol_symbol_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_symbol_symbol_spec.rb index ecd03c1c85..cb1ad9d784 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_symbol_symbol_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/brokerage_symbol_symbol_spec.rb @@ -74,4 +74,10 @@ end end + describe 'test attribute "figi_instrument"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/trading_place_oco_order_request_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/figi_instrument_spec.rb similarity index 52% rename from generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/trading_place_oco_order_request_spec.rb rename to generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/figi_instrument_spec.rb index a683098020..62b9023b0f 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/trading_place_oco_order_request_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/figi_instrument_spec.rb @@ -11,22 +11,22 @@ require 'json' require 'date' -# Unit tests for SnapTrade::TradingPlaceOCOOrderRequest -describe SnapTrade::TradingPlaceOCOOrderRequest do - let(:instance) { SnapTrade::TradingPlaceOCOOrderRequest.new } +# Unit tests for SnapTrade::FigiInstrument +describe SnapTrade::FigiInstrument do + let(:instance) { SnapTrade::FigiInstrument.new } - describe 'test an instance of TradingPlaceOCOOrderRequest' do - it 'should create an instance of TradingPlaceOCOOrderRequest' do - expect(instance).to be_instance_of(SnapTrade::TradingPlaceOCOOrderRequest) + describe 'test an instance of FigiInstrument' do + it 'should create an instance of FigiInstrument' do + expect(instance).to be_instance_of(SnapTrade::FigiInstrument) end end - describe 'test attribute "first_trade_id"' do + describe 'test attribute "figi_code"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "second_trade_id"' do + describe 'test attribute "figi_share_class"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/holdings_status_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/holdings_status_spec.rb new file mode 100644 index 0000000000..979f5c64a6 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/holdings_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::HoldingsStatus +describe SnapTrade::HoldingsStatus do + let(:instance) { SnapTrade::HoldingsStatus.new } + + describe 'test an instance of HoldingsStatus' do + it 'should create an instance of HoldingsStatus' do + expect(instance).to be_instance_of(SnapTrade::HoldingsStatus) + end + end + describe 'test attribute "initial_sync_completed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_successful_sync"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/manual_trade_form_notional_value_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/manual_trade_form_notional_value_spec.rb new file mode 100644 index 0000000000..15bfabf8fe --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/manual_trade_form_notional_value_spec.rb @@ -0,0 +1,23 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::ManualTradeFormNotionalValue +describe SnapTrade::ManualTradeFormNotionalValue do + let(:instance) { SnapTrade::ManualTradeFormNotionalValue.new } + + describe 'test an instance of ManualTradeFormNotionalValue' do + it 'should create an instance of ManualTradeFormNotionalValue' do + expect(instance).to be_instance_of(SnapTrade::ManualTradeFormNotionalValue) + end + end +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb new file mode 100644 index 0000000000..b4246c2670 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb @@ -0,0 +1,35 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::Model402BrokerageAuthAlreadyDisabledException +describe SnapTrade::Model402BrokerageAuthAlreadyDisabledException do + let(:instance) { SnapTrade::Model402BrokerageAuthAlreadyDisabledException.new } + + describe 'test an instance of Model402BrokerageAuthAlreadyDisabledException' do + it 'should create an instance of Model402BrokerageAuthAlreadyDisabledException' do + expect(instance).to be_instance_of(SnapTrade::Model402BrokerageAuthAlreadyDisabledException) + end + end + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_disabled_response_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_disabled_response_spec.rb new file mode 100644 index 0000000000..bf020867e8 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model402_brokerage_auth_disabled_response_spec.rb @@ -0,0 +1,35 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::Model402BrokerageAuthDisabledResponse +describe SnapTrade::Model402BrokerageAuthDisabledResponse do + let(:instance) { SnapTrade::Model402BrokerageAuthDisabledResponse.new } + + describe 'test an instance of Model402BrokerageAuthDisabledResponse' do + it 'should create an instance of Model402BrokerageAuthDisabledResponse' do + expect(instance).to be_instance_of(SnapTrade::Model402BrokerageAuthDisabledResponse) + end + end + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model403_feature_not_enabled_response_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model403_feature_not_enabled_response_spec.rb new file mode 100644 index 0000000000..ef0deab472 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/model403_feature_not_enabled_response_spec.rb @@ -0,0 +1,35 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::Model403FeatureNotEnabledResponse +describe SnapTrade::Model403FeatureNotEnabledResponse do + let(:instance) { SnapTrade::Model403FeatureNotEnabledResponse.new } + + describe 'test an instance of Model403FeatureNotEnabledResponse' do + it 'should create an instance of Model403FeatureNotEnabledResponse' do + expect(instance).to be_instance_of(SnapTrade::Model403FeatureNotEnabledResponse) + end + end + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "default_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/notional_value_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/notional_value_spec.rb new file mode 100644 index 0000000000..e50a421dc8 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/notional_value_spec.rb @@ -0,0 +1,26 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::NotionalValue +describe SnapTrade::NotionalValue do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/option_brokerage_symbol_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/option_brokerage_symbol_spec.rb new file mode 100644 index 0000000000..8043274a59 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/option_brokerage_symbol_spec.rb @@ -0,0 +1,41 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::OptionBrokerageSymbol +describe SnapTrade::OptionBrokerageSymbol do + let(:instance) { SnapTrade::OptionBrokerageSymbol.new } + + describe 'test an instance of OptionBrokerageSymbol' do + it 'should create an instance of OptionBrokerageSymbol' do + expect(instance).to be_instance_of(SnapTrade::OptionBrokerageSymbol) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "option_symbol"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_spec.rb deleted file mode 100644 index 8af960ebdf..0000000000 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -=begin -#SnapTrade - -#Connect brokerage accounts to your app for live positions and trading - -The version of the OpenAPI document: 1.0.0 -Contact: api@snaptrade.com -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SnapTrade::OrderType -describe SnapTrade::OrderType do - let(:instance) { SnapTrade::OrderType.new } - - describe 'test an instance of OrderType' do - it 'should create an instance of OrderType' do - expect(instance).to be_instance_of(SnapTrade::OrderType) - end - end -end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_strict_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_strict_spec.rb new file mode 100644 index 0000000000..cc1032f400 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/order_type_strict_spec.rb @@ -0,0 +1,23 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::OrderTypeStrict +describe SnapTrade::OrderTypeStrict do + let(:instance) { SnapTrade::OrderTypeStrict.new } + + describe 'test an instance of OrderTypeStrict' do + it 'should create an instance of OrderTypeStrict' do + expect(instance).to be_instance_of(SnapTrade::OrderTypeStrict) + end + end +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb new file mode 100644 index 0000000000..c571df33eb --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb @@ -0,0 +1,29 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::SnapTradeHoldingsAccountAccountIdBalance +describe SnapTrade::SnapTradeHoldingsAccountAccountIdBalance do + let(:instance) { SnapTrade::SnapTradeHoldingsAccountAccountIdBalance.new } + + describe 'test an instance of SnapTradeHoldingsAccountAccountIdBalance' do + it 'should create an instance of SnapTradeHoldingsAccountAccountIdBalance' do + expect(instance).to be_instance_of(SnapTrade::SnapTradeHoldingsAccountAccountIdBalance) + end + end + describe 'test attribute "total"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_spec.rb index d832314283..f4b8e03cb0 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/snap_trade_holdings_account_account_id_spec.rb @@ -56,6 +56,12 @@ end end + describe 'test attribute "balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "meta"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_figi_instrument_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_figi_instrument_spec.rb new file mode 100644 index 0000000000..1a76389ee2 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_figi_instrument_spec.rb @@ -0,0 +1,35 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::SymbolFigiInstrument +describe SnapTrade::SymbolFigiInstrument do + let(:instance) { SnapTrade::SymbolFigiInstrument.new } + + describe 'test an instance of SymbolFigiInstrument' do + it 'should create an instance of SymbolFigiInstrument' do + expect(instance).to be_instance_of(SnapTrade::SymbolFigiInstrument) + end + end + describe 'test attribute "figi_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "figi_share_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_spec.rb index ddc13a8ba2..32b229a54b 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/symbol_spec.rb @@ -68,4 +68,10 @@ end end + describe 'test attribute "figi_instrument"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/transactions_status_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/transactions_status_spec.rb index b74d9dcb0a..662e883075 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/transactions_status_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/transactions_status_spec.rb @@ -32,4 +32,10 @@ end end + describe 'test attribute "first_transaction_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/underlying_symbol_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/underlying_symbol_spec.rb index 75ca872908..b95f1e9576 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/underlying_symbol_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/underlying_symbol_spec.rb @@ -68,4 +68,10 @@ end end + describe 'test attribute "figi_instrument"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/universal_symbol_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/universal_symbol_spec.rb index 67eb50ca81..0f74762c73 100644 --- a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/universal_symbol_spec.rb +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/universal_symbol_spec.rb @@ -74,4 +74,10 @@ end end + describe 'test attribute "figi_instrument"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/validated_trade_body_spec.rb b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/validated_trade_body_spec.rb new file mode 100644 index 0000000000..56452c2a3d --- /dev/null +++ b/generator/konfig-integration-tests/sdks/ruby-snaptrade/sdks/ruby/spec/models/validated_trade_body_spec.rb @@ -0,0 +1,29 @@ +=begin +#SnapTrade + +#Connect brokerage accounts to your app for live positions and trading + +The version of the OpenAPI document: 1.0.0 +Contact: api@snaptrade.com +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SnapTrade::ValidatedTradeBody +describe SnapTrade::ValidatedTradeBody do + let(:instance) { SnapTrade::ValidatedTradeBody.new } + + describe 'test an instance of ValidatedTradeBody' do + it 'should create an instance of ValidatedTradeBody' do + expect(instance).to be_instance_of(SnapTrade::ValidatedTradeBody) + end + end + describe 'test attribute "wait_to_confirm"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end