Skip to content

Commit

Permalink
regenerate SDKs w/ updated OAS + fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dphuang2 committed Sep 2, 2023
1 parent b14430a commit 3c0bc26
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .konfig/generate-id.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d0b836a4-0851-4738-bb3c-4661abad0c4a
8c14cf8f-0450-48ee-9991-020337a5e9fb
1 change: 1 addition & 0 deletions docs/Api/TransactionsAndReportingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ try {
print_r($result->$getCurrency());
print_r($result->$getDescription());
print_r($result->$getFee());
print_r($result->$getFxRate());
print_r($result->$getInstitution());
print_r($result->$getOptionType());
print_r($result->$getPrice());
Expand Down
1 change: 1 addition & 0 deletions docs/Model/UniversalActivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**currency** | [**\SnapTrade\Model\Currency**](Currency.md) | | [optional]
**description** | **string** | | [optional]
**fee** | **float** | | [optional]
**fx_rate** | **float** | The forex conversion rate involved in the transaction if provided by the brokerage | [optional]
**institution** | **string** | | [optional]
**option_type** | **string** | If an option transaction, then it's type (BUY_TO_OPEN, SELL_TO_CLOSE, etc), otherwise empty string | [optional]
**price** | **float** | | [optional]
Expand Down
43 changes: 43 additions & 0 deletions lib/Model/UniversalActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl
'currency' => '\SnapTrade\Model\Currency',
'description' => 'string',
'fee' => 'float',
'fx_rate' => 'float',
'institution' => 'string',
'option_type' => 'string',
'price' => 'float',
Expand All @@ -83,6 +84,7 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl
'currency' => null,
'description' => null,
'fee' => null,
'fx_rate' => null,
'institution' => null,
'option_type' => null,
'price' => null,
Expand All @@ -107,6 +109,7 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl
'currency' => false,
'description' => false,
'fee' => false,
'fx_rate' => true,
'institution' => false,
'option_type' => false,
'price' => false,
Expand Down Expand Up @@ -211,6 +214,7 @@ public function isNullableSetToNull(string $property): bool
'currency' => 'currency',
'description' => 'description',
'fee' => 'fee',
'fx_rate' => 'fx_rate',
'institution' => 'institution',
'option_type' => 'option_type',
'price' => 'price',
Expand All @@ -235,6 +239,7 @@ public function isNullableSetToNull(string $property): bool
'currency' => 'setCurrency',
'description' => 'setDescription',
'fee' => 'setFee',
'fx_rate' => 'setFxRate',
'institution' => 'setInstitution',
'option_type' => 'setOptionType',
'price' => 'setPrice',
Expand All @@ -259,6 +264,7 @@ public function isNullableSetToNull(string $property): bool
'currency' => 'getCurrency',
'description' => 'getDescription',
'fee' => 'getFee',
'fx_rate' => 'getFxRate',
'institution' => 'getInstitution',
'option_type' => 'getOptionType',
'price' => 'getPrice',
Expand Down Expand Up @@ -334,6 +340,7 @@ public function __construct(array $data = null)
$this->setIfExists('currency', $data ?? [], null);
$this->setIfExists('description', $data ?? [], null);
$this->setIfExists('fee', $data ?? [], null);
$this->setIfExists('fx_rate', $data ?? [], null);
$this->setIfExists('institution', $data ?? [], null);
$this->setIfExists('option_type', $data ?? [], null);
$this->setIfExists('price', $data ?? [], null);
Expand Down Expand Up @@ -569,6 +576,42 @@ public function setFee($fee)
return $this;
}

/**
* Gets fx_rate
*
* @return float|null
*/
public function getFxRate()
{
return $this->container['fx_rate'];
}

/**
* Sets fx_rate
*
* @param float|null $fx_rate The forex conversion rate involved in the transaction if provided by the brokerage
*
* @return self
*/
public function setFxRate($fx_rate)
{

if (is_null($fx_rate)) {
array_push($this->openAPINullablesSetToNull, 'fx_rate');
} else {
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
$index = array_search('fx_rate', $nullablesSetToNull);
if ($index !== FALSE) {
unset($nullablesSetToNull[$index]);
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
}
}

$this->container['fx_rate'] = $fx_rate;

return $this;
}

/**
* Gets institution
*
Expand Down
1 change: 1 addition & 0 deletions test/GettingStartedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function testGettingStarted()

// 3) Create a new user on SnapTrade
$userId = (string)time();
$userId .= "-php-sdk";
$registerResponse = $snaptrade->authentication->registerSnapTradeUser($userId);
$userSecret = $registerResponse->getUserSecret();

Expand Down
9 changes: 9 additions & 0 deletions test/Model/UniversalActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ public function testPropertyFee()
$this->markTestIncomplete('Not implemented');
}

/**
* Test attribute "fx_rate"
*/
public function testPropertyFxRate()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}

/**
* Test attribute "institution"
*/
Expand Down

0 comments on commit 3c0bc26

Please sign in to comment.