Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Latest Changes for v2021-02-25 (Dunning Campaigns feature) #632

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2802,4 +2802,54 @@ public function getExportFiles(string $export_date, array $options = []): \Recur
return $this->makeRequest('GET', $path, [], $options);
}

/**
* Show the dunning campaigns for a site
*
* @param array $options Associative array of optional parameters
*
* Supported optional query string parameters:
*
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
*
* @return \Recurly\Pager A list of the the dunning_campaigns on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaigns
*/
public function listDunningCampaigns(array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/dunning_campaigns", []);
return new \Recurly\Pager($this, $path, $options);
}

/**
* Show the settings for a dunning campaign
*
* @param string $dunning_campaign_id Dunning Campaign ID, e.g. `e28zov4fw0v2`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\DunningCampaign Settings for a dunning campaign.
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_dunning_campaign
*/
public function getDunningCampaign(string $dunning_campaign_id, array $options = []): \Recurly\Resources\DunningCampaign
{
$path = $this->interpolatePath("/dunning_campaigns/{dunning_campaign_id}", ['dunning_campaign_id' => $dunning_campaign_id]);
return $this->makeRequest('GET', $path, [], $options);
}

/**
* Assign a dunning campaign to multiple plans
*
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\DunningCampaignsBulkUpdateResponse A list of updated plans.
* @link https://developers.recurly.com/api/v2021-02-25#operation/put_dunning_campaign_bulk_update
*/
public function putDunningCampaignBulkUpdate(array $body, array $options = []): \Recurly\Resources\DunningCampaignsBulkUpdateResponse
{
$path = $this->interpolatePath("/dunning_campaigns/{dunning_campaign_id}/bulk_update", []);
return $this->makeRequest('PUT', $path, $body, $options);
}

}
24 changes: 24 additions & 0 deletions lib/recurly/resources/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Account extends RecurlyResource
private $_created_at;
private $_custom_fields;
private $_deleted_at;
private $_dunning_campaign_id;
private $_email;
private $_exemption_certificate;
private $_first_name;
Expand Down Expand Up @@ -256,6 +257,29 @@ public function setDeletedAt(string $deleted_at): void
$this->_deleted_at = $deleted_at;
}

/**
* Getter method for the dunning_campaign_id attribute.
* Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
*
* @return ?string
*/
public function getDunningCampaignId(): ?string
{
return $this->_dunning_campaign_id;
}

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

/**
* Getter method for the email attribute.
* The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
Expand Down
24 changes: 24 additions & 0 deletions lib/recurly/resources/account_mini.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AccountMini extends RecurlyResource
private $_bill_to;
private $_code;
private $_company;
private $_dunning_campaign_id;
private $_email;
private $_first_name;
private $_id;
Expand Down Expand Up @@ -95,6 +96,29 @@ public function setCompany(string $company): void
$this->_company = $company;
}

/**
* Getter method for the dunning_campaign_id attribute.
* Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
*
* @return ?string
*/
public function getDunningCampaignId(): ?string
{
return $this->_dunning_campaign_id;
}

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

/**
* Getter method for the email attribute.
* The email address used for communicating with this customer.
Expand Down
260 changes: 260 additions & 0 deletions lib/recurly/resources/dunning_campaign.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
<?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 DunningCampaign extends RecurlyResource
{
private $_code;
private $_created_at;
private $_default_campaign;
private $_deleted_at;
private $_description;
private $_dunning_cycles;
private $_id;
private $_name;
private $_object;
private $_updated_at;

protected static $array_hints = [
'setDunningCycles' => '\Recurly\Resources\DunningCycle',
];


/**
* Getter method for the code attribute.
* Campaign code.
*
* @return ?string
*/
public function getCode(): ?string
{
return $this->_code;
}

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

/**
* Getter method for the created_at attribute.
* When the current campaign was created in Recurly.
*
* @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 default_campaign attribute.
* Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign.
*
* @return ?bool
*/
public function getDefaultCampaign(): ?bool
{
return $this->_default_campaign;
}

/**
* Setter method for the default_campaign attribute.
*
* @param bool $default_campaign
*
* @return void
*/
public function setDefaultCampaign(bool $default_campaign): void
{
$this->_default_campaign = $default_campaign;
}

/**
* Getter method for the deleted_at attribute.
* When the current campaign was deleted in Recurly.
*
* @return ?string
*/
public function getDeletedAt(): ?string
{
return $this->_deleted_at;
}

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

/**
* Getter method for the description attribute.
* Campaign description.
*
* @return ?string
*/
public function getDescription(): ?string
{
return $this->_description;
}

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

/**
* Getter method for the dunning_cycles attribute.
* Dunning Cycle settings.
*
* @return array
*/
public function getDunningCycles(): array
{
return $this->_dunning_cycles ?? [] ;
}

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

/**
* Getter method for the id attribute.
*
*
* @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 name attribute.
* Campaign name.
*
* @return ?string
*/
public function getName(): ?string
{
return $this->_name;
}

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

/**
* Getter method for the object attribute.
* Object type
*
* @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.
* When the current campaign was updated in Recurly.
*
* @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