Skip to content

Commit

Permalink
Merge pull request #756 from recurly/v3-v2021-02-25-1681256205
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (External Accounts)
  • Loading branch information
amandamfielding authored Apr 12, 2023
2 parents 1a19fe8 + ce29c03 commit ace8918
Showing 4 changed files with 557 additions and 0 deletions.
80 changes: 80 additions & 0 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
@@ -536,6 +536,86 @@ public function listAccountCreditPayments(string $account_id, array $options = [
return new \Recurly\Pager($this, $path, $options);
}

/**
* List external accounts for an account
*
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Pager A list of external accounts on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_account
*/
public function listAccountExternalAccount(string $account_id, array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
return new \Recurly\Pager($this, $path, $options);
}

/**
* Create an external account
*
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A representation of the created external_account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_account_external_account
*/
public function createAccountExternalAccount(string $account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
return $this->makeRequest('POST', $path, $body, $options);
}

/**
* Get an external account for an account
*
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A external account on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_account_external_account
*/
public function getAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('GET', $path, [], $options);
}

/**
* Update an external account
*
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A representation of the updated external_account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/update_account_external_account
*/
public function updateAccountExternalAccount(string $account_id, string $external_account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('PUT', $path, $body, $options);
}

/**
* Delete an external account for an account
*
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount Successful Delete
* @link https://developers.recurly.com/api/v2021-02-25#operation/delete_account_external_account
*/
public function deleteAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('DELETE', $path, [], $options);
}

/**
* List the external invoices on an account
*
25 changes: 25 additions & 0 deletions lib/recurly/resources/account.php
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ class Account extends RecurlyResource
private $_dunning_campaign_id;
private $_email;
private $_exemption_certificate;
private $_external_accounts;
private $_first_name;
private $_has_active_subscription;
private $_has_canceled_subscription;
@@ -48,6 +49,7 @@ class Account extends RecurlyResource

protected static $array_hints = [
'setCustomFields' => '\Recurly\Resources\CustomField',
'setExternalAccounts' => '\Recurly\Resources\ExternalAccount',
'setShippingAddresses' => '\Recurly\Resources\ShippingAddress',
];

@@ -328,6 +330,29 @@ public function setExemptionCertificate(string $exemption_certificate): void
$this->_exemption_certificate = $exemption_certificate;
}

/**
* Getter method for the external_accounts attribute.
* The external accounts belonging to this account
*
* @return array
*/
public function getExternalAccounts(): array
{
return $this->_external_accounts ?? [] ;
}

/**
* Setter method for the external_accounts attribute.
*
* @param array $external_accounts
*
* @return void
*/
public function setExternalAccounts(array $external_accounts): void
{
$this->_external_accounts = $external_accounts;
}

/**
* Getter method for the first_name attribute.
*
163 changes: 163 additions & 0 deletions lib/recurly/resources/external_account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<?php
/**
* This file is automatically created by Recurly's OpenAPI generation process
* and thus any edits you make by hand will be lost. If you wish to make a
* change to this file, please create a Github issue explaining the changes you
* need and we will usher them to the appropriate places.
*/
namespace Recurly\Resources;

use Recurly\RecurlyResource;

// phpcs:disable
class ExternalAccount extends RecurlyResource
{
private $_created_at;
private $_external_account_code;
private $_external_connection_type;
private $_id;
private $_object;
private $_updated_at;

protected static $array_hints = [
];


/**
* Getter method for the created_at attribute.
* Created at
*
* @return ?string
*/
public function getCreatedAt(): ?string
{
return $this->_created_at;
}

/**
* Setter method for the created_at attribute.
*
* @param string $created_at
*
* @return void
*/
public function setCreatedAt(string $created_at): void
{
$this->_created_at = $created_at;
}

/**
* Getter method for the external_account_code attribute.
* Represents the account code for the external account.
*
* @return ?string
*/
public function getExternalAccountCode(): ?string
{
return $this->_external_account_code;
}

/**
* Setter method for the external_account_code attribute.
*
* @param string $external_account_code
*
* @return void
*/
public function setExternalAccountCode(string $external_account_code): void
{
$this->_external_account_code = $external_account_code;
}

/**
* Getter method for the external_connection_type attribute.
* Represents the connection type. `AppleAppStore` or `GooglePlayStore`
*
* @return ?string
*/
public function getExternalConnectionType(): ?string
{
return $this->_external_connection_type;
}

/**
* Setter method for the external_connection_type attribute.
*
* @param string $external_connection_type
*
* @return void
*/
public function setExternalConnectionType(string $external_connection_type): void
{
$this->_external_connection_type = $external_connection_type;
}

/**
* Getter method for the id attribute.
* UUID of the external_account .
*
* @return ?string
*/
public function getId(): ?string
{
return $this->_id;
}

/**
* Setter method for the id attribute.
*
* @param string $id
*
* @return void
*/
public function setId(string $id): void
{
$this->_id = $id;
}

/**
* Getter method for the object attribute.
*
*
* @return ?string
*/
public function getObject(): ?string
{
return $this->_object;
}

/**
* Setter method for the object attribute.
*
* @param string $object
*
* @return void
*/
public function setObject(string $object): void
{
$this->_object = $object;
}

/**
* Getter method for the updated_at attribute.
* Last updated at
*
* @return ?string
*/
public function getUpdatedAt(): ?string
{
return $this->_updated_at;
}

/**
* Setter method for the updated_at attribute.
*
* @param string $updated_at
*
* @return void
*/
public function setUpdatedAt(string $updated_at): void
{
$this->_updated_at = $updated_at;
}
}
Loading

0 comments on commit ace8918

Please sign in to comment.