diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 486a203f..4bab9967 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.120.0" + ".": "0.121.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2715c40d..e029231b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 241 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1f2c653a8b55e63d756d60f9110ceadb18f87a6039762b5ee31b5373bbc4499a.yml -openapi_spec_hash: a7b01c23c92b07f280117e6ba6262a7e -config_hash: cb5b8736705c06b670f6a25484622d62 +configured_endpoints: 232 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4615e5953fac5a76724144fc2e1f9f675a9722dc05adaeab23e4d09c9577086b.yml +openapi_spec_hash: 6db98497c4dda09b575d5ee12371ef83 +config_hash: b24ba63471a818520cec39b4695e1825 diff --git a/CHANGELOG.md b/CHANGELOG.md index 04811424..41abf0cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.121.0 (2026-04-22) + +Full Changelog: [v0.120.0...v0.121.0](https://github.com/Increase/increase-php/compare/v0.120.0...v0.121.0) + +### Features + +* **api:** api update ([e2a9e0d](https://github.com/Increase/increase-php/commit/e2a9e0d05c12e01dacaa27b02995592ee3d63903)) + ## 0.120.0 (2026-04-20) Full Changelog: [v0.119.0...v0.120.0](https://github.com/Increase/increase-php/compare/v0.119.0...v0.120.0) diff --git a/README.md b/README.md index ff3b2b5b..6a03a53b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ``` -composer require "increase/increase 0.120.0" +composer require "increase/increase 0.121.0" ``` diff --git a/src/BookkeepingAccounts/BookkeepingAccount.php b/src/BookkeepingAccounts/BookkeepingAccount.php deleted file mode 100644 index b501b7e5..00000000 --- a/src/BookkeepingAccounts/BookkeepingAccount.php +++ /dev/null @@ -1,222 +0,0 @@ -, - * entityID: string|null, - * idempotencyKey: string|null, - * name: string, - * type: Type|value-of, - * } - */ -final class BookkeepingAccount implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - - /** - * The account identifier. - */ - #[Required] - public string $id; - - /** - * The API Account associated with this bookkeeping account. - */ - #[Required('account_id')] - public ?string $accountID; - - /** - * The compliance category of the account. - * - * @var value-of|null $complianceCategory - */ - #[Required('compliance_category', enum: ComplianceCategory::class)] - public ?string $complianceCategory; - - /** - * The Entity associated with this bookkeeping account. - */ - #[Required('entity_id')] - public ?string $entityID; - - /** - * The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - #[Required('idempotency_key')] - public ?string $idempotencyKey; - - /** - * The name you choose for the account. - */ - #[Required] - public string $name; - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_account`. - * - * @var value-of $type - */ - #[Required(enum: Type::class)] - public string $type; - - /** - * `new BookkeepingAccount()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingAccount::with( - * id: ..., - * accountID: ..., - * complianceCategory: ..., - * entityID: ..., - * idempotencyKey: ..., - * name: ..., - * type: ..., - * ) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingAccount) - * ->withID(...) - * ->withAccountID(...) - * ->withComplianceCategory(...) - * ->withEntityID(...) - * ->withIdempotencyKey(...) - * ->withName(...) - * ->withType(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param ComplianceCategory|value-of|null $complianceCategory - * @param Type|value-of $type - */ - public static function with( - string $id, - ?string $accountID, - ComplianceCategory|string|null $complianceCategory, - ?string $entityID, - ?string $idempotencyKey, - string $name, - Type|string $type, - ): self { - $self = new self; - - $self['id'] = $id; - $self['accountID'] = $accountID; - $self['complianceCategory'] = $complianceCategory; - $self['entityID'] = $entityID; - $self['idempotencyKey'] = $idempotencyKey; - $self['name'] = $name; - $self['type'] = $type; - - return $self; - } - - /** - * The account identifier. - */ - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } - - /** - * The API Account associated with this bookkeeping account. - */ - public function withAccountID(?string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * The compliance category of the account. - * - * @param ComplianceCategory|value-of|null $complianceCategory - */ - public function withComplianceCategory( - ComplianceCategory|string|null $complianceCategory - ): self { - $self = clone $this; - $self['complianceCategory'] = $complianceCategory; - - return $self; - } - - /** - * The Entity associated with this bookkeeping account. - */ - public function withEntityID(?string $entityID): self - { - $self = clone $this; - $self['entityID'] = $entityID; - - return $self; - } - - /** - * The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - public function withIdempotencyKey(?string $idempotencyKey): self - { - $self = clone $this; - $self['idempotencyKey'] = $idempotencyKey; - - return $self; - } - - /** - * The name you choose for the account. - */ - public function withName(string $name): self - { - $self = clone $this; - $self['name'] = $name; - - return $self; - } - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_account`. - * - * @param Type|value-of $type - */ - public function withType(Type|string $type): self - { - $self = clone $this; - $self['type'] = $type; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingAccount/ComplianceCategory.php b/src/BookkeepingAccounts/BookkeepingAccount/ComplianceCategory.php deleted file mode 100644 index f14cf4b8..00000000 --- a/src/BookkeepingAccounts/BookkeepingAccount/ComplianceCategory.php +++ /dev/null @@ -1,15 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * The moment to query the balance at. If not set, returns the current balances. - */ - #[Optional] - public ?\DateTimeInterface $atTime; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?\DateTimeInterface $atTime = null): self - { - $self = new self; - - null !== $atTime && $self['atTime'] = $atTime; - - return $self; - } - - /** - * The moment to query the balance at. If not set, returns the current balances. - */ - public function withAtTime(\DateTimeInterface $atTime): self - { - $self = clone $this; - $self['atTime'] = $atTime; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingAccountCreateParams.php b/src/BookkeepingAccounts/BookkeepingAccountCreateParams.php deleted file mode 100644 index ec2eeb23..00000000 --- a/src/BookkeepingAccounts/BookkeepingAccountCreateParams.php +++ /dev/null @@ -1,147 +0,0 @@ -, - * entityID?: string|null, - * } - */ -final class BookkeepingAccountCreateParams implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - use SdkParams; - - /** - * The name you choose for the account. - */ - #[Required] - public string $name; - - /** - * The account, if `compliance_category` is `commingled_cash`. - */ - #[Optional('account_id')] - public ?string $accountID; - - /** - * The account compliance category. - * - * @var value-of|null $complianceCategory - */ - #[Optional('compliance_category', enum: ComplianceCategory::class)] - public ?string $complianceCategory; - - /** - * The entity, if `compliance_category` is `customer_balance`. - */ - #[Optional('entity_id')] - public ?string $entityID; - - /** - * `new BookkeepingAccountCreateParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingAccountCreateParams::with(name: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingAccountCreateParams)->withName(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param ComplianceCategory|value-of|null $complianceCategory - */ - public static function with( - string $name, - ?string $accountID = null, - ComplianceCategory|string|null $complianceCategory = null, - ?string $entityID = null, - ): self { - $self = new self; - - $self['name'] = $name; - - null !== $accountID && $self['accountID'] = $accountID; - null !== $complianceCategory && $self['complianceCategory'] = $complianceCategory; - null !== $entityID && $self['entityID'] = $entityID; - - return $self; - } - - /** - * The name you choose for the account. - */ - public function withName(string $name): self - { - $self = clone $this; - $self['name'] = $name; - - return $self; - } - - /** - * The account, if `compliance_category` is `commingled_cash`. - */ - public function withAccountID(string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * The account compliance category. - * - * @param ComplianceCategory|value-of $complianceCategory - */ - public function withComplianceCategory( - ComplianceCategory|string $complianceCategory - ): self { - $self = clone $this; - $self['complianceCategory'] = $complianceCategory; - - return $self; - } - - /** - * The entity, if `compliance_category` is `customer_balance`. - */ - public function withEntityID(string $entityID): self - { - $self = clone $this; - $self['entityID'] = $entityID; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingAccountCreateParams/ComplianceCategory.php b/src/BookkeepingAccounts/BookkeepingAccountCreateParams/ComplianceCategory.php deleted file mode 100644 index a089cdb2..00000000 --- a/src/BookkeepingAccounts/BookkeepingAccountCreateParams/ComplianceCategory.php +++ /dev/null @@ -1,15 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * Return the page of entries after this one. - */ - #[Optional] - public ?string $cursor; - - /** - * Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - #[Optional] - public ?string $idempotencyKey; - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - #[Optional] - public ?int $limit; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null - ): self { - $self = new self; - - null !== $cursor && $self['cursor'] = $cursor; - null !== $idempotencyKey && $self['idempotencyKey'] = $idempotencyKey; - null !== $limit && $self['limit'] = $limit; - - return $self; - } - - /** - * Return the page of entries after this one. - */ - public function withCursor(string $cursor): self - { - $self = clone $this; - $self['cursor'] = $cursor; - - return $self; - } - - /** - * Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - public function withIdempotencyKey(string $idempotencyKey): self - { - $self = clone $this; - $self['idempotencyKey'] = $idempotencyKey; - - return $self; - } - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - public function withLimit(int $limit): self - { - $self = clone $this; - $self['limit'] = $limit; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingAccountUpdateParams.php b/src/BookkeepingAccounts/BookkeepingAccountUpdateParams.php deleted file mode 100644 index c8a4dec6..00000000 --- a/src/BookkeepingAccounts/BookkeepingAccountUpdateParams.php +++ /dev/null @@ -1,74 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * The name you choose for the account. - */ - #[Required] - public string $name; - - /** - * `new BookkeepingAccountUpdateParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingAccountUpdateParams::with(name: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingAccountUpdateParams)->withName(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $name): self - { - $self = new self; - - $self['name'] = $name; - - return $self; - } - - /** - * The name you choose for the account. - */ - public function withName(string $name): self - { - $self = clone $this; - $self['name'] = $name; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingBalanceLookup.php b/src/BookkeepingAccounts/BookkeepingBalanceLookup.php deleted file mode 100644 index 3f137237..00000000 --- a/src/BookkeepingAccounts/BookkeepingBalanceLookup.php +++ /dev/null @@ -1,123 +0,0 @@ - - * } - */ -final class BookkeepingBalanceLookup implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - - /** - * The Bookkeeping Account's current balance, representing the sum of all Bookkeeping Entries on the Bookkeeping Account. - */ - #[Required] - public int $balance; - - /** - * The identifier for the account for which the balance was queried. - */ - #[Required('bookkeeping_account_id')] - public string $bookkeepingAccountID; - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_balance_lookup`. - * - * @var value-of $type - */ - #[Required(enum: Type::class)] - public string $type; - - /** - * `new BookkeepingBalanceLookup()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingBalanceLookup::with( - * balance: ..., bookkeepingAccountID: ..., type: ... - * ) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingBalanceLookup) - * ->withBalance(...) - * ->withBookkeepingAccountID(...) - * ->withType(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param Type|value-of $type - */ - public static function with( - int $balance, - string $bookkeepingAccountID, - Type|string $type - ): self { - $self = new self; - - $self['balance'] = $balance; - $self['bookkeepingAccountID'] = $bookkeepingAccountID; - $self['type'] = $type; - - return $self; - } - - /** - * The Bookkeeping Account's current balance, representing the sum of all Bookkeeping Entries on the Bookkeeping Account. - */ - public function withBalance(int $balance): self - { - $self = clone $this; - $self['balance'] = $balance; - - return $self; - } - - /** - * The identifier for the account for which the balance was queried. - */ - public function withBookkeepingAccountID(string $bookkeepingAccountID): self - { - $self = clone $this; - $self['bookkeepingAccountID'] = $bookkeepingAccountID; - - return $self; - } - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_balance_lookup`. - * - * @param Type|value-of $type - */ - public function withType(Type|string $type): self - { - $self = clone $this; - $self['type'] = $type; - - return $self; - } -} diff --git a/src/BookkeepingAccounts/BookkeepingBalanceLookup/Type.php b/src/BookkeepingAccounts/BookkeepingBalanceLookup/Type.php deleted file mode 100644 index b2b7d8b1..00000000 --- a/src/BookkeepingAccounts/BookkeepingBalanceLookup/Type.php +++ /dev/null @@ -1,13 +0,0 @@ -, - * } - */ -final class BookkeepingEntry implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - - /** - * The entry identifier. - */ - #[Required] - public string $id; - - /** - * The identifier for the Account the Entry belongs to. - */ - #[Required('account_id')] - public string $accountID; - - /** - * The Entry amount in the minor unit of its currency. For dollars, for example, this is cents. - */ - #[Required] - public int $amount; - - /** - * When the entry set was created. - */ - #[Required('created_at')] - public \DateTimeInterface $createdAt; - - /** - * The identifier for the Entry Set the Entry belongs to. - */ - #[Required('entry_set_id')] - public string $entrySetID; - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_entry`. - * - * @var value-of $type - */ - #[Required(enum: Type::class)] - public string $type; - - /** - * `new BookkeepingEntry()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingEntry::with( - * id: ..., - * accountID: ..., - * amount: ..., - * createdAt: ..., - * entrySetID: ..., - * type: ..., - * ) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingEntry) - * ->withID(...) - * ->withAccountID(...) - * ->withAmount(...) - * ->withCreatedAt(...) - * ->withEntrySetID(...) - * ->withType(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param Type|value-of $type - */ - public static function with( - string $id, - string $accountID, - int $amount, - \DateTimeInterface $createdAt, - string $entrySetID, - Type|string $type, - ): self { - $self = new self; - - $self['id'] = $id; - $self['accountID'] = $accountID; - $self['amount'] = $amount; - $self['createdAt'] = $createdAt; - $self['entrySetID'] = $entrySetID; - $self['type'] = $type; - - return $self; - } - - /** - * The entry identifier. - */ - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } - - /** - * The identifier for the Account the Entry belongs to. - */ - public function withAccountID(string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * The Entry amount in the minor unit of its currency. For dollars, for example, this is cents. - */ - public function withAmount(int $amount): self - { - $self = clone $this; - $self['amount'] = $amount; - - return $self; - } - - /** - * When the entry set was created. - */ - public function withCreatedAt(\DateTimeInterface $createdAt): self - { - $self = clone $this; - $self['createdAt'] = $createdAt; - - return $self; - } - - /** - * The identifier for the Entry Set the Entry belongs to. - */ - public function withEntrySetID(string $entrySetID): self - { - $self = clone $this; - $self['entrySetID'] = $entrySetID; - - return $self; - } - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_entry`. - * - * @param Type|value-of $type - */ - public function withType(Type|string $type): self - { - $self = clone $this; - $self['type'] = $type; - - return $self; - } -} diff --git a/src/BookkeepingEntries/BookkeepingEntry/Type.php b/src/BookkeepingEntries/BookkeepingEntry/Type.php deleted file mode 100644 index aa8a9d9f..00000000 --- a/src/BookkeepingEntries/BookkeepingEntry/Type.php +++ /dev/null @@ -1,13 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * The identifier for the Bookkeeping Account to filter by. - */ - #[Optional] - public ?string $accountID; - - /** - * Return the page of entries after this one. - */ - #[Optional] - public ?string $cursor; - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - #[Optional] - public ?int $limit; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - ?string $accountID = null, - ?string $cursor = null, - ?int $limit = null - ): self { - $self = new self; - - null !== $accountID && $self['accountID'] = $accountID; - null !== $cursor && $self['cursor'] = $cursor; - null !== $limit && $self['limit'] = $limit; - - return $self; - } - - /** - * The identifier for the Bookkeeping Account to filter by. - */ - public function withAccountID(string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * Return the page of entries after this one. - */ - public function withCursor(string $cursor): self - { - $self = clone $this; - $self['cursor'] = $cursor; - - return $self; - } - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - public function withLimit(int $limit): self - { - $self = clone $this; - $self['limit'] = $limit; - - return $self; - } -} diff --git a/src/BookkeepingEntrySets/BookkeepingEntrySet.php b/src/BookkeepingEntrySets/BookkeepingEntrySet.php deleted file mode 100644 index 00de7636..00000000 --- a/src/BookkeepingEntrySets/BookkeepingEntrySet.php +++ /dev/null @@ -1,223 +0,0 @@ -, - * idempotencyKey: string|null, - * transactionID: string|null, - * type: Type|value-of, - * } - */ -final class BookkeepingEntrySet implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - - /** - * The entry set identifier. - */ - #[Required] - public string $id; - - /** - * When the entry set was created. - */ - #[Required('created_at')] - public \DateTimeInterface $createdAt; - - /** - * The timestamp of the entry set. - */ - #[Required] - public \DateTimeInterface $date; - - /** - * The entries. - * - * @var list $entries - */ - #[Required(list: Entry::class)] - public array $entries; - - /** - * The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - #[Required('idempotency_key')] - public ?string $idempotencyKey; - - /** - * The transaction identifier, if any. - */ - #[Required('transaction_id')] - public ?string $transactionID; - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_entry_set`. - * - * @var value-of $type - */ - #[Required(enum: Type::class)] - public string $type; - - /** - * `new BookkeepingEntrySet()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingEntrySet::with( - * id: ..., - * createdAt: ..., - * date: ..., - * entries: ..., - * idempotencyKey: ..., - * transactionID: ..., - * type: ..., - * ) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingEntrySet) - * ->withID(...) - * ->withCreatedAt(...) - * ->withDate(...) - * ->withEntries(...) - * ->withIdempotencyKey(...) - * ->withTransactionID(...) - * ->withType(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param list $entries - * @param Type|value-of $type - */ - public static function with( - string $id, - \DateTimeInterface $createdAt, - \DateTimeInterface $date, - array $entries, - ?string $idempotencyKey, - ?string $transactionID, - Type|string $type, - ): self { - $self = new self; - - $self['id'] = $id; - $self['createdAt'] = $createdAt; - $self['date'] = $date; - $self['entries'] = $entries; - $self['idempotencyKey'] = $idempotencyKey; - $self['transactionID'] = $transactionID; - $self['type'] = $type; - - return $self; - } - - /** - * The entry set identifier. - */ - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } - - /** - * When the entry set was created. - */ - public function withCreatedAt(\DateTimeInterface $createdAt): self - { - $self = clone $this; - $self['createdAt'] = $createdAt; - - return $self; - } - - /** - * The timestamp of the entry set. - */ - public function withDate(\DateTimeInterface $date): self - { - $self = clone $this; - $self['date'] = $date; - - return $self; - } - - /** - * The entries. - * - * @param list $entries - */ - public function withEntries(array $entries): self - { - $self = clone $this; - $self['entries'] = $entries; - - return $self; - } - - /** - * The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - public function withIdempotencyKey(?string $idempotencyKey): self - { - $self = clone $this; - $self['idempotencyKey'] = $idempotencyKey; - - return $self; - } - - /** - * The transaction identifier, if any. - */ - public function withTransactionID(?string $transactionID): self - { - $self = clone $this; - $self['transactionID'] = $transactionID; - - return $self; - } - - /** - * A constant representing the object's type. For this resource it will always be `bookkeeping_entry_set`. - * - * @param Type|value-of $type - */ - public function withType(Type|string $type): self - { - $self = clone $this; - $self['type'] = $type; - - return $self; - } -} diff --git a/src/BookkeepingEntrySets/BookkeepingEntrySet/Entry.php b/src/BookkeepingEntrySets/BookkeepingEntrySet/Entry.php deleted file mode 100644 index bd5ba034..00000000 --- a/src/BookkeepingEntrySets/BookkeepingEntrySet/Entry.php +++ /dev/null @@ -1,107 +0,0 @@ - */ - use SdkModel; - - /** - * The entry identifier. - */ - #[Required] - public string $id; - - /** - * The bookkeeping account impacted by the entry. - */ - #[Required('account_id')] - public string $accountID; - - /** - * The amount of the entry in minor units. - */ - #[Required] - public int $amount; - - /** - * `new Entry()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * Entry::with(id: ..., accountID: ..., amount: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new Entry)->withID(...)->withAccountID(...)->withAmount(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - string $id, - string $accountID, - int $amount - ): self { - $self = new self; - - $self['id'] = $id; - $self['accountID'] = $accountID; - $self['amount'] = $amount; - - return $self; - } - - /** - * The entry identifier. - */ - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } - - /** - * The bookkeeping account impacted by the entry. - */ - public function withAccountID(string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * The amount of the entry in minor units. - */ - public function withAmount(int $amount): self - { - $self = clone $this; - $self['amount'] = $amount; - - return $self; - } -} diff --git a/src/BookkeepingEntrySets/BookkeepingEntrySet/Type.php b/src/BookkeepingEntrySets/BookkeepingEntrySet/Type.php deleted file mode 100644 index e275f636..00000000 --- a/src/BookkeepingEntrySets/BookkeepingEntrySet/Type.php +++ /dev/null @@ -1,13 +0,0 @@ -, - * date?: \DateTimeInterface|null, - * transactionID?: string|null, - * } - */ -final class BookkeepingEntrySetCreateParams implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - use SdkParams; - - /** - * The bookkeeping entries. - * - * @var list $entries - */ - #[Required(list: Entry::class)] - public array $entries; - - /** - * The date of the transaction. Optional if `transaction_id` is provided, in which case we use the `date` of that transaction. Required otherwise. - */ - #[Optional] - public ?\DateTimeInterface $date; - - /** - * The identifier of the Transaction related to this entry set, if any. - */ - #[Optional('transaction_id')] - public ?string $transactionID; - - /** - * `new BookkeepingEntrySetCreateParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * BookkeepingEntrySetCreateParams::with(entries: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new BookkeepingEntrySetCreateParams)->withEntries(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param list $entries - */ - public static function with( - array $entries, - ?\DateTimeInterface $date = null, - ?string $transactionID = null, - ): self { - $self = new self; - - $self['entries'] = $entries; - - null !== $date && $self['date'] = $date; - null !== $transactionID && $self['transactionID'] = $transactionID; - - return $self; - } - - /** - * The bookkeeping entries. - * - * @param list $entries - */ - public function withEntries(array $entries): self - { - $self = clone $this; - $self['entries'] = $entries; - - return $self; - } - - /** - * The date of the transaction. Optional if `transaction_id` is provided, in which case we use the `date` of that transaction. Required otherwise. - */ - public function withDate(\DateTimeInterface $date): self - { - $self = clone $this; - $self['date'] = $date; - - return $self; - } - - /** - * The identifier of the Transaction related to this entry set, if any. - */ - public function withTransactionID(string $transactionID): self - { - $self = clone $this; - $self['transactionID'] = $transactionID; - - return $self; - } -} diff --git a/src/BookkeepingEntrySets/BookkeepingEntrySetCreateParams/Entry.php b/src/BookkeepingEntrySets/BookkeepingEntrySetCreateParams/Entry.php deleted file mode 100644 index ca6c5155..00000000 --- a/src/BookkeepingEntrySets/BookkeepingEntrySetCreateParams/Entry.php +++ /dev/null @@ -1,86 +0,0 @@ - */ - use SdkModel; - - /** - * The identifier for the Bookkeeping Account impacted by this entry. - */ - #[Required('account_id')] - public string $accountID; - - /** - * The entry amount in the minor unit of the account currency. For dollars, for example, this is cents. Debit entries have positive amounts; credit entries have negative amounts. - */ - #[Required] - public int $amount; - - /** - * `new Entry()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * Entry::with(accountID: ..., amount: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new Entry)->withAccountID(...)->withAmount(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $accountID, int $amount): self - { - $self = new self; - - $self['accountID'] = $accountID; - $self['amount'] = $amount; - - return $self; - } - - /** - * The identifier for the Bookkeeping Account impacted by this entry. - */ - public function withAccountID(string $accountID): self - { - $self = clone $this; - $self['accountID'] = $accountID; - - return $self; - } - - /** - * The entry amount in the minor unit of the account currency. For dollars, for example, this is cents. Debit entries have positive amounts; credit entries have negative amounts. - */ - public function withAmount(int $amount): self - { - $self = clone $this; - $self['amount'] = $amount; - - return $self; - } -} diff --git a/src/BookkeepingEntrySets/BookkeepingEntrySetListParams.php b/src/BookkeepingEntrySets/BookkeepingEntrySetListParams.php deleted file mode 100644 index 3bc8420e..00000000 --- a/src/BookkeepingEntrySets/BookkeepingEntrySetListParams.php +++ /dev/null @@ -1,123 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - /** - * Return the page of entries after this one. - */ - #[Optional] - public ?string $cursor; - - /** - * Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - #[Optional] - public ?string $idempotencyKey; - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - #[Optional] - public ?int $limit; - - /** - * Filter to the Bookkeeping Entry Set that maps to this Transaction. - */ - #[Optional] - public ?string $transactionID; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null, - ?string $transactionID = null, - ): self { - $self = new self; - - null !== $cursor && $self['cursor'] = $cursor; - null !== $idempotencyKey && $self['idempotencyKey'] = $idempotencyKey; - null !== $limit && $self['limit'] = $limit; - null !== $transactionID && $self['transactionID'] = $transactionID; - - return $self; - } - - /** - * Return the page of entries after this one. - */ - public function withCursor(string $cursor): self - { - $self = clone $this; - $self['cursor'] = $cursor; - - return $self; - } - - /** - * Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - */ - public function withIdempotencyKey(string $idempotencyKey): self - { - $self = clone $this; - $self['idempotencyKey'] = $idempotencyKey; - - return $self; - } - - /** - * Limit the size of the list that is returned. The default (and maximum) is 100 objects. - */ - public function withLimit(int $limit): self - { - $self = clone $this; - $self['limit'] = $limit; - - return $self; - } - - /** - * Filter to the Bookkeeping Entry Set that maps to this Transaction. - */ - public function withTransactionID(string $transactionID): self - { - $self = clone $this; - $self['transactionID'] = $transactionID; - - return $self; - } -} diff --git a/src/Client.php b/src/Client.php index ebbdccd5..270240e9 100644 --- a/src/Client.php +++ b/src/Client.php @@ -15,9 +15,6 @@ use Increase\Services\ACHPrenotificationsService; use Increase\Services\ACHTransfersService; use Increase\Services\BeneficialOwnersService; -use Increase\Services\BookkeepingAccountsService; -use Increase\Services\BookkeepingEntriesService; -use Increase\Services\BookkeepingEntrySetsService; use Increase\Services\CardDisputesService; use Increase\Services\CardPaymentsService; use Increase\Services\CardPurchaseSupplementsService; @@ -303,21 +300,6 @@ class Client extends BaseClient */ public RealTimeDecisionsService $realTimeDecisions; - /** - * @api - */ - public BookkeepingAccountsService $bookkeepingAccounts; - - /** - * @api - */ - public BookkeepingEntrySetsService $bookkeepingEntrySets; - - /** - * @api - */ - public BookkeepingEntriesService $bookkeepingEntries; - /** * @api */ @@ -463,9 +445,6 @@ public function __construct( $this->events = new EventsService($this); $this->eventSubscriptions = new EventSubscriptionsService($this); $this->realTimeDecisions = new RealTimeDecisionsService($this); - $this->bookkeepingAccounts = new BookkeepingAccountsService($this); - $this->bookkeepingEntrySets = new BookkeepingEntrySetsService($this); - $this->bookkeepingEntries = new BookkeepingEntriesService($this); $this->groups = new GroupsService($this); $this->oauthApplications = new OAuthApplicationsService($this); $this->oauthConnections = new OAuthConnectionsService($this); diff --git a/src/ServiceContracts/BookkeepingAccountsContract.php b/src/ServiceContracts/BookkeepingAccountsContract.php deleted file mode 100644 index c708e18d..00000000 --- a/src/ServiceContracts/BookkeepingAccountsContract.php +++ /dev/null @@ -1,86 +0,0 @@ - $complianceCategory the account compliance category - * @param string $entityID the entity, if `compliance_category` is `customer_balance` - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function create( - string $name, - ?string $accountID = null, - ComplianceCategory|string|null $complianceCategory = null, - ?string $entityID = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingAccount; - - /** - * @api - * - * @param string $bookkeepingAccountID the bookkeeping account you would like to update - * @param string $name the name you choose for the account - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function update( - string $bookkeepingAccountID, - string $name, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingAccount; - - /** - * @api - * - * @param string $cursor return the page of entries after this one - * @param string $idempotencyKey Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - * @param int $limit Limit the size of the list that is returned. The default (and maximum) is 100 objects. - * @param RequestOpts|null $requestOptions - * - * @return Page - * - * @throws APIException - */ - public function list( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null, - RequestOptions|array|null $requestOptions = null, - ): Page; - - /** - * @api - * - * @param string $bookkeepingAccountID the identifier of the Bookkeeping Account to retrieve - * @param \DateTimeInterface $atTime The moment to query the balance at. If not set, returns the current balances. - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function balance( - string $bookkeepingAccountID, - ?\DateTimeInterface $atTime = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingBalanceLookup; -} diff --git a/src/ServiceContracts/BookkeepingAccountsRawContract.php b/src/ServiceContracts/BookkeepingAccountsRawContract.php deleted file mode 100644 index e760e360..00000000 --- a/src/ServiceContracts/BookkeepingAccountsRawContract.php +++ /dev/null @@ -1,86 +0,0 @@ -|BookkeepingAccountCreateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function create( - array|BookkeepingAccountCreateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param string $bookkeepingAccountID the bookkeeping account you would like to update - * @param array|BookkeepingAccountUpdateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function update( - string $bookkeepingAccountID, - array|BookkeepingAccountUpdateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param array|BookkeepingAccountListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingAccountListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param string $bookkeepingAccountID the identifier of the Bookkeeping Account to retrieve - * @param array|BookkeepingAccountBalanceParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function balance( - string $bookkeepingAccountID, - array|BookkeepingAccountBalanceParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; -} diff --git a/src/ServiceContracts/BookkeepingEntriesContract.php b/src/ServiceContracts/BookkeepingEntriesContract.php deleted file mode 100644 index 5a591390..00000000 --- a/src/ServiceContracts/BookkeepingEntriesContract.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @throws APIException - */ - public function list( - ?string $accountID = null, - ?string $cursor = null, - ?int $limit = null, - RequestOptions|array|null $requestOptions = null, - ): Page; -} diff --git a/src/ServiceContracts/BookkeepingEntriesRawContract.php b/src/ServiceContracts/BookkeepingEntriesRawContract.php deleted file mode 100644 index 3740f005..00000000 --- a/src/ServiceContracts/BookkeepingEntriesRawContract.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntryID, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param array|BookkeepingEntryListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingEntryListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; -} diff --git a/src/ServiceContracts/BookkeepingEntrySetsContract.php b/src/ServiceContracts/BookkeepingEntrySetsContract.php deleted file mode 100644 index 10418770..00000000 --- a/src/ServiceContracts/BookkeepingEntrySetsContract.php +++ /dev/null @@ -1,69 +0,0 @@ - $entries the bookkeeping entries - * @param \DateTimeInterface $date The date of the transaction. Optional if `transaction_id` is provided, in which case we use the `date` of that transaction. Required otherwise. - * @param string $transactionID the identifier of the Transaction related to this entry set, if any - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function create( - array $entries, - ?\DateTimeInterface $date = null, - ?string $transactionID = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingEntrySet; - - /** - * @api - * - * @param string $bookkeepingEntrySetID the identifier of the Bookkeeping Entry Set - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntrySetID, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingEntrySet; - - /** - * @api - * - * @param string $cursor return the page of entries after this one - * @param string $idempotencyKey Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - * @param int $limit Limit the size of the list that is returned. The default (and maximum) is 100 objects. - * @param string $transactionID filter to the Bookkeeping Entry Set that maps to this Transaction - * @param RequestOpts|null $requestOptions - * - * @return Page - * - * @throws APIException - */ - public function list( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null, - ?string $transactionID = null, - RequestOptions|array|null $requestOptions = null, - ): Page; -} diff --git a/src/ServiceContracts/BookkeepingEntrySetsRawContract.php b/src/ServiceContracts/BookkeepingEntrySetsRawContract.php deleted file mode 100644 index e4b22a94..00000000 --- a/src/ServiceContracts/BookkeepingEntrySetsRawContract.php +++ /dev/null @@ -1,64 +0,0 @@ -|BookkeepingEntrySetCreateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function create( - array|BookkeepingEntrySetCreateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param string $bookkeepingEntrySetID the identifier of the Bookkeeping Entry Set - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntrySetID, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param array|BookkeepingEntrySetListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingEntrySetListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; -} diff --git a/src/Services/BookkeepingAccountsRawService.php b/src/Services/BookkeepingAccountsRawService.php deleted file mode 100644 index 013ade72..00000000 --- a/src/Services/BookkeepingAccountsRawService.php +++ /dev/null @@ -1,173 +0,0 @@ -, - * entityID?: string, - * }|BookkeepingAccountCreateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function create( - array|BookkeepingAccountCreateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingAccountCreateParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: 'bookkeeping_accounts', - body: (object) $parsed, - options: $options, - convert: BookkeepingAccount::class, - ); - } - - /** - * @api - * - * Update a Bookkeeping Account - * - * @param string $bookkeepingAccountID the bookkeeping account you would like to update - * @param array{name: string}|BookkeepingAccountUpdateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function update( - string $bookkeepingAccountID, - array|BookkeepingAccountUpdateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingAccountUpdateParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'patch', - path: ['bookkeeping_accounts/%1$s', $bookkeepingAccountID], - body: (object) $parsed, - options: $options, - convert: BookkeepingAccount::class, - ); - } - - /** - * @api - * - * List Bookkeeping Accounts - * - * @param array{ - * cursor?: string, idempotencyKey?: string, limit?: int - * }|BookkeepingAccountListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingAccountListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingAccountListParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: 'bookkeeping_accounts', - query: Util::array_transform_keys( - $parsed, - ['idempotencyKey' => 'idempotency_key'] - ), - options: $options, - convert: BookkeepingAccount::class, - page: Page::class, - ); - } - - /** - * @api - * - * Retrieve a Bookkeeping Account Balance - * - * @param string $bookkeepingAccountID the identifier of the Bookkeeping Account to retrieve - * @param array{ - * atTime?: \DateTimeInterface - * }|BookkeepingAccountBalanceParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function balance( - string $bookkeepingAccountID, - array|BookkeepingAccountBalanceParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingAccountBalanceParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: ['bookkeeping_accounts/%1$s/balance', $bookkeepingAccountID], - query: Util::array_transform_keys($parsed, ['atTime' => 'at_time']), - options: $options, - convert: BookkeepingBalanceLookup::class, - ); - } -} diff --git a/src/Services/BookkeepingAccountsService.php b/src/Services/BookkeepingAccountsService.php deleted file mode 100644 index 84828162..00000000 --- a/src/Services/BookkeepingAccountsService.php +++ /dev/null @@ -1,151 +0,0 @@ -raw = new BookkeepingAccountsRawService($client); - } - - /** - * @api - * - * Create a Bookkeeping Account - * - * @param string $name the name you choose for the account - * @param string $accountID the account, if `compliance_category` is `commingled_cash` - * @param ComplianceCategory|value-of $complianceCategory the account compliance category - * @param string $entityID the entity, if `compliance_category` is `customer_balance` - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function create( - string $name, - ?string $accountID = null, - ComplianceCategory|string|null $complianceCategory = null, - ?string $entityID = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingAccount { - $params = Util::removeNulls( - [ - 'name' => $name, - 'accountID' => $accountID, - 'complianceCategory' => $complianceCategory, - 'entityID' => $entityID, - ], - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->create(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Update a Bookkeeping Account - * - * @param string $bookkeepingAccountID the bookkeeping account you would like to update - * @param string $name the name you choose for the account - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function update( - string $bookkeepingAccountID, - string $name, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingAccount { - $params = Util::removeNulls(['name' => $name]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->update($bookkeepingAccountID, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * List Bookkeeping Accounts - * - * @param string $cursor return the page of entries after this one - * @param string $idempotencyKey Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - * @param int $limit Limit the size of the list that is returned. The default (and maximum) is 100 objects. - * @param RequestOpts|null $requestOptions - * - * @return Page - * - * @throws APIException - */ - public function list( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null, - RequestOptions|array|null $requestOptions = null, - ): Page { - $params = Util::removeNulls( - [ - 'cursor' => $cursor, - 'idempotencyKey' => $idempotencyKey, - 'limit' => $limit, - ], - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->list(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Retrieve a Bookkeeping Account Balance - * - * @param string $bookkeepingAccountID the identifier of the Bookkeeping Account to retrieve - * @param \DateTimeInterface $atTime The moment to query the balance at. If not set, returns the current balances. - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function balance( - string $bookkeepingAccountID, - ?\DateTimeInterface $atTime = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingBalanceLookup { - $params = Util::removeNulls(['atTime' => $atTime]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->balance($bookkeepingAccountID, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } -} diff --git a/src/Services/BookkeepingEntriesRawService.php b/src/Services/BookkeepingEntriesRawService.php deleted file mode 100644 index 35ad2955..00000000 --- a/src/Services/BookkeepingEntriesRawService.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntryID, - RequestOptions|array|null $requestOptions = null - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: ['bookkeeping_entries/%1$s', $bookkeepingEntryID], - options: $requestOptions, - convert: BookkeepingEntry::class, - ); - } - - /** - * @api - * - * List Bookkeeping Entries - * - * @param array{ - * accountID?: string, cursor?: string, limit?: int - * }|BookkeepingEntryListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingEntryListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingEntryListParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: 'bookkeeping_entries', - query: Util::array_transform_keys($parsed, ['accountID' => 'account_id']), - options: $options, - convert: BookkeepingEntry::class, - page: Page::class, - ); - } -} diff --git a/src/Services/BookkeepingEntriesService.php b/src/Services/BookkeepingEntriesService.php deleted file mode 100644 index 58d25e9b..00000000 --- a/src/Services/BookkeepingEntriesService.php +++ /dev/null @@ -1,82 +0,0 @@ -raw = new BookkeepingEntriesRawService($client); - } - - /** - * @api - * - * Retrieve a Bookkeeping Entry - * - * @param string $bookkeepingEntryID the identifier of the Bookkeeping Entry - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntryID, - RequestOptions|array|null $requestOptions = null - ): BookkeepingEntry { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->retrieve($bookkeepingEntryID, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * List Bookkeeping Entries - * - * @param string $accountID the identifier for the Bookkeeping Account to filter by - * @param string $cursor return the page of entries after this one - * @param int $limit Limit the size of the list that is returned. The default (and maximum) is 100 objects. - * @param RequestOpts|null $requestOptions - * - * @return Page - * - * @throws APIException - */ - public function list( - ?string $accountID = null, - ?string $cursor = null, - ?int $limit = null, - RequestOptions|array|null $requestOptions = null, - ): Page { - $params = Util::removeNulls( - ['accountID' => $accountID, 'cursor' => $cursor, 'limit' => $limit] - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->list(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } -} diff --git a/src/Services/BookkeepingEntrySetsRawService.php b/src/Services/BookkeepingEntrySetsRawService.php deleted file mode 100644 index 1ac0b471..00000000 --- a/src/Services/BookkeepingEntrySetsRawService.php +++ /dev/null @@ -1,130 +0,0 @@ -, - * date?: \DateTimeInterface, - * transactionID?: string, - * }|BookkeepingEntrySetCreateParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function create( - array|BookkeepingEntrySetCreateParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingEntrySetCreateParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: 'bookkeeping_entry_sets', - body: (object) $parsed, - options: $options, - convert: BookkeepingEntrySet::class, - ); - } - - /** - * @api - * - * Retrieve a Bookkeeping Entry Set - * - * @param string $bookkeepingEntrySetID the identifier of the Bookkeeping Entry Set - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntrySetID, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: ['bookkeeping_entry_sets/%1$s', $bookkeepingEntrySetID], - options: $requestOptions, - convert: BookkeepingEntrySet::class, - ); - } - - /** - * @api - * - * List Bookkeeping Entry Sets - * - * @param array{ - * cursor?: string, idempotencyKey?: string, limit?: int, transactionID?: string - * }|BookkeepingEntrySetListParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse> - * - * @throws APIException - */ - public function list( - array|BookkeepingEntrySetListParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = BookkeepingEntrySetListParams::parseRequest( - $params, - $requestOptions, - ); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: 'bookkeeping_entry_sets', - query: Util::array_transform_keys( - $parsed, - [ - 'idempotencyKey' => 'idempotency_key', - 'transactionID' => 'transaction_id', - ], - ), - options: $options, - convert: BookkeepingEntrySet::class, - page: Page::class, - ); - } -} diff --git a/src/Services/BookkeepingEntrySetsService.php b/src/Services/BookkeepingEntrySetsService.php deleted file mode 100644 index 08940a22..00000000 --- a/src/Services/BookkeepingEntrySetsService.php +++ /dev/null @@ -1,123 +0,0 @@ -raw = new BookkeepingEntrySetsRawService($client); - } - - /** - * @api - * - * Create a Bookkeeping Entry Set - * - * @param list $entries the bookkeeping entries - * @param \DateTimeInterface $date The date of the transaction. Optional if `transaction_id` is provided, in which case we use the `date` of that transaction. Required otherwise. - * @param string $transactionID the identifier of the Transaction related to this entry set, if any - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function create( - array $entries, - ?\DateTimeInterface $date = null, - ?string $transactionID = null, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingEntrySet { - $params = Util::removeNulls( - [ - 'entries' => $entries, - 'date' => $date, - 'transactionID' => $transactionID, - ], - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->create(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Retrieve a Bookkeeping Entry Set - * - * @param string $bookkeepingEntrySetID the identifier of the Bookkeeping Entry Set - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function retrieve( - string $bookkeepingEntrySetID, - RequestOptions|array|null $requestOptions = null, - ): BookkeepingEntrySet { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->retrieve($bookkeepingEntrySetID, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * List Bookkeeping Entry Sets - * - * @param string $cursor return the page of entries after this one - * @param string $idempotencyKey Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). - * @param int $limit Limit the size of the list that is returned. The default (and maximum) is 100 objects. - * @param string $transactionID filter to the Bookkeeping Entry Set that maps to this Transaction - * @param RequestOpts|null $requestOptions - * - * @return Page - * - * @throws APIException - */ - public function list( - ?string $cursor = null, - ?string $idempotencyKey = null, - ?int $limit = null, - ?string $transactionID = null, - RequestOptions|array|null $requestOptions = null, - ): Page { - $params = Util::removeNulls( - [ - 'cursor' => $cursor, - 'idempotencyKey' => $idempotencyKey, - 'limit' => $limit, - 'transactionID' => $transactionID, - ], - ); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->list(params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } -} diff --git a/src/Version.php b/src/Version.php index 6fc3a781..d56d5780 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace Increase; // x-release-please-start-version -const VERSION = '0.120.0'; +const VERSION = '0.121.0'; // x-release-please-end diff --git a/tests/Services/BookkeepingAccountsTest.php b/tests/Services/BookkeepingAccountsTest.php deleted file mode 100644 index 16b1af73..00000000 --- a/tests/Services/BookkeepingAccountsTest.php +++ /dev/null @@ -1,103 +0,0 @@ -client = $client; - } - - #[Test] - public function testCreate(): void - { - $result = $this->client->bookkeepingAccounts->create(name: 'New Account!'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingAccount::class, $result); - } - - #[Test] - public function testCreateWithOptionalParams(): void - { - $result = $this->client->bookkeepingAccounts->create( - name: 'New Account!', - accountID: 'account_id', - complianceCategory: 'commingled_cash', - entityID: 'entity_id', - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingAccount::class, $result); - } - - #[Test] - public function testUpdate(): void - { - $result = $this->client->bookkeepingAccounts->update( - 'bookkeeping_account_e37p1f1iuocw5intf35v', - name: 'Deprecated Account' - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingAccount::class, $result); - } - - #[Test] - public function testUpdateWithOptionalParams(): void - { - $result = $this->client->bookkeepingAccounts->update( - 'bookkeeping_account_e37p1f1iuocw5intf35v', - name: 'Deprecated Account' - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingAccount::class, $result); - } - - #[Test] - public function testList(): void - { - $page = $this->client->bookkeepingAccounts->list(); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(Page::class, $page); - - if ($item = $page->getItems()[0] ?? null) { - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingAccount::class, $item); - } - } - - #[Test] - public function testBalance(): void - { - $result = $this->client->bookkeepingAccounts->balance( - 'bookkeeping_account_e37p1f1iuocw5intf35v' - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingBalanceLookup::class, $result); - } -} diff --git a/tests/Services/BookkeepingEntriesTest.php b/tests/Services/BookkeepingEntriesTest.php deleted file mode 100644 index 072cf743..00000000 --- a/tests/Services/BookkeepingEntriesTest.php +++ /dev/null @@ -1,55 +0,0 @@ -client = $client; - } - - #[Test] - public function testRetrieve(): void - { - $result = $this->client->bookkeepingEntries->retrieve( - 'bookkeeping_entry_ctjpajsj3ks2blx10375' - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntry::class, $result); - } - - #[Test] - public function testList(): void - { - $page = $this->client->bookkeepingEntries->list(); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(Page::class, $page); - - if ($item = $page->getItems()[0] ?? null) { - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntry::class, $item); - } - } -} diff --git a/tests/Services/BookkeepingEntrySetsTest.php b/tests/Services/BookkeepingEntrySetsTest.php deleted file mode 100644 index a603671c..00000000 --- a/tests/Services/BookkeepingEntrySetsTest.php +++ /dev/null @@ -1,97 +0,0 @@ -client = $client; - } - - #[Test] - public function testCreate(): void - { - $result = $this->client->bookkeepingEntrySets->create( - entries: [ - [ - 'accountID' => 'bookkeeping_account_9husfpw68pzmve9dvvc7', - 'amount' => 100, - ], - [ - 'accountID' => 'bookkeeping_account_t2obldz1rcu15zr54umg', - 'amount' => -100, - ], - ], - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntrySet::class, $result); - } - - #[Test] - public function testCreateWithOptionalParams(): void - { - $result = $this->client->bookkeepingEntrySets->create( - entries: [ - [ - 'accountID' => 'bookkeeping_account_9husfpw68pzmve9dvvc7', - 'amount' => 100, - ], - [ - 'accountID' => 'bookkeeping_account_t2obldz1rcu15zr54umg', - 'amount' => -100, - ], - ], - date: new \DateTimeImmutable('2020-01-31T23:59:59Z'), - transactionID: 'transaction_uyrp7fld2ium70oa7oi', - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntrySet::class, $result); - } - - #[Test] - public function testRetrieve(): void - { - $result = $this->client->bookkeepingEntrySets->retrieve( - 'bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf' - ); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntrySet::class, $result); - } - - #[Test] - public function testList(): void - { - $page = $this->client->bookkeepingEntrySets->list(); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(Page::class, $page); - - if ($item = $page->getItems()[0] ?? null) { - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertInstanceOf(BookkeepingEntrySet::class, $item); - } - } -}