Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseNoteAttachmentPaymentSuspended extends BunqResponse
{
/**
* @return NoteAttachmentPaymentSuspendedApiObject
*/
public function getValue(): NoteAttachmentPaymentSuspendedApiObject
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseNoteAttachmentPaymentSuspendedApiObjectList extends BunqResponse
{
/**
* @return NoteAttachmentPaymentSuspendedApiObject[]ApiObject
*/
public function getValue(): array
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseNoteTextPaymentSuspended extends BunqResponse
{
/**
* @return NoteTextPaymentSuspendedApiObject
*/
public function getValue(): NoteTextPaymentSuspendedApiObject
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseNoteTextPaymentSuspendedApiObjectList extends BunqResponse
{
/**
* @return NoteTextPaymentSuspendedApiObject[]ApiObject
*/
public function getValue(): array
{
return parent::getValue();
}
}
17 changes: 17 additions & 0 deletions src/Model/Generated/Endpoint/BunqResponsePaymentBatchEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponsePaymentBatchEntry extends BunqResponse
{
/**
* @return PaymentBatchEntryApiObject
*/
public function getValue(): PaymentBatchEntryApiObject
{
return parent::getValue();
}
}
17 changes: 17 additions & 0 deletions src/Model/Generated/Endpoint/BunqResponsePaymentDelayed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponsePaymentDelayed extends BunqResponse
{
/**
* @return PaymentDelayedApiObject
*/
public function getValue(): PaymentDelayedApiObject
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponsePaymentDelayedApiObjectList extends BunqResponse
{
/**
* @return PaymentDelayedApiObject[]ApiObject
*/
public function getValue(): array
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseRegistryImportSplitwiseCsv extends BunqResponse
{
/**
* @return RegistryImportSplitwiseCsvApiObject
*/
public function getValue(): RegistryImportSplitwiseCsvApiObject
{
return parent::getValue();
}
}
58 changes: 53 additions & 5 deletions src/Model/Generated/Endpoint/DraftPaymentApiObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DraftPaymentApiObject extends BunqModel
const FIELD_PREVIOUS_UPDATED_TIMESTAMP = 'previous_updated_timestamp';
const FIELD_NUMBER_OF_REQUIRED_ACCEPTS = 'number_of_required_accepts';
const FIELD_SCHEDULE = 'schedule';
const FIELD_PAYMENT_BATCH_EXECUTION_TYPE = 'payment_batch_execution_type';

/**
* Object type.
Expand Down Expand Up @@ -111,6 +112,13 @@ class DraftPaymentApiObject extends BunqModel
*/
protected $schedule;

/**
* The execution type that will be used when converting this draft payment to a payment batch.
*
* @var string|null
*/
protected $paymentBatchExecutionType;

/**
* The status of the DraftPayment.
*
Expand Down Expand Up @@ -147,6 +155,13 @@ class DraftPaymentApiObject extends BunqModel
*/
protected $scheduleFieldForRequest;

/**
* The execution type that will be used when converting this draft payment to a payment batch.
*
* @var string|null
*/
protected $paymentBatchExecutionTypeFieldForRequest;

/**
* @param DraftPaymentEntryObject[] $entries The list of entries in the DraftPayment. Each entry will result in a payment
* when the DraftPayment is accepted.
Expand All @@ -156,14 +171,17 @@ class DraftPaymentApiObject extends BunqModel
* @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
* needs to be provided to prevent race conditions.
* @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
* @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
* a payment batch.
*/
public function __construct(array $entries, int $numberOfRequiredAccepts, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null)
public function __construct(array $entries, int $numberOfRequiredAccepts, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null, string $paymentBatchExecutionType = null)
{
$this->statusFieldForRequest = $status;
$this->entriesFieldForRequest = $entries;
$this->previousUpdatedTimestampFieldForRequest = $previousUpdatedTimestamp;
$this->numberOfRequiredAcceptsFieldForRequest = $numberOfRequiredAccepts;
$this->scheduleFieldForRequest = $schedule;
$this->paymentBatchExecutionTypeFieldForRequest = $paymentBatchExecutionType;
}

/**
Expand All @@ -178,11 +196,13 @@ public function __construct(array $entries, int $numberOfRequiredAccepts, stri
* @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
* needs to be provided to prevent race conditions.
* @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
* @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
* a payment batch.
* @param string[] $customHeaders
*
* @return BunqResponseInt
*/
public static function create(array $entries, int $numberOfRequiredAccepts, int $monetaryAccountId = null, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null, array $customHeaders = []): BunqResponseInt
public static function create(array $entries, int $numberOfRequiredAccepts, int $monetaryAccountId = null, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null, string $paymentBatchExecutionType = null, array $customHeaders = []): BunqResponseInt
{
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->post(
Expand All @@ -194,7 +214,8 @@ public static function create(array $entries, int $numberOfRequiredAccepts, in
self::FIELD_ENTRIES => $entries,
self::FIELD_PREVIOUS_UPDATED_TIMESTAMP => $previousUpdatedTimestamp,
self::FIELD_NUMBER_OF_REQUIRED_ACCEPTS => $numberOfRequiredAccepts,
self::FIELD_SCHEDULE => $schedule],
self::FIELD_SCHEDULE => $schedule,
self::FIELD_PAYMENT_BATCH_EXECUTION_TYPE => $paymentBatchExecutionType],
$customHeaders
);

Expand All @@ -212,11 +233,13 @@ public static function create(array $entries, int $numberOfRequiredAccepts, in
* @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
* needs to be provided to prevent race conditions.
* @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
* @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
* a payment batch.
* @param string[] $customHeaders
*
* @return BunqResponseInt
*/
public static function update(int $draftPaymentId, int $monetaryAccountId = null, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null, array $customHeaders = []): BunqResponseInt
public static function update(int $draftPaymentId, int $monetaryAccountId = null, string $status = null, string $previousUpdatedTimestamp = null, ScheduleApiObject $schedule = null, string $paymentBatchExecutionType = null, array $customHeaders = []): BunqResponseInt
{
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->put(
Expand All @@ -226,7 +249,8 @@ public static function update(int $draftPaymentId, int $monetaryAccountId = null
),
[self::FIELD_STATUS => $status,
self::FIELD_PREVIOUS_UPDATED_TIMESTAMP => $previousUpdatedTimestamp,
self::FIELD_SCHEDULE => $schedule],
self::FIELD_SCHEDULE => $schedule,
self::FIELD_PAYMENT_BATCH_EXECUTION_TYPE => $paymentBatchExecutionType],
$customHeaders
);

Expand Down Expand Up @@ -490,6 +514,26 @@ public function setSchedule($schedule)
$this->schedule = $schedule;
}

/**
* The execution type that will be used when converting this draft payment to a payment batch.
*
* @return string
*/
public function getPaymentBatchExecutionType()
{
return $this->paymentBatchExecutionType;
}

/**
* @deprecated User should not be able to set values via setters, use constructor.
*
* @param string $paymentBatchExecutionType
*/
public function setPaymentBatchExecutionType($paymentBatchExecutionType)
{
$this->paymentBatchExecutionType = $paymentBatchExecutionType;
}

/**
* @return bool
*/
Expand Down Expand Up @@ -535,6 +579,10 @@ public function isAllFieldNull()
return false;
}

if (!is_null($this->paymentBatchExecutionType)) {
return false;
}

return true;
}
}
40 changes: 20 additions & 20 deletions src/Model/Generated/Endpoint/InvoiceApiObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class InvoiceApiObject extends BunqModel
/**
* Endpoint constants.
*/
const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/invoice';
const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/invoice/%s';
const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/invoice';

/**
* Field constants.
Expand Down Expand Up @@ -196,53 +196,53 @@ public function __construct(string $status, string $description, string $exte
}

/**
* This method is called "listing" because "list" is a restricted PHP word and cannot be used as constants, class names,
* function or method names.
*
* @param int $invoiceId
* @param int|null $monetaryAccountId
* @param string[] $params
* @param string[] $customHeaders
*
* @return BunqResponseInvoiceApiObjectList
* @return BunqResponseInvoice
*/
public static function listing(int $monetaryAccountId = null, array $params = [], array $customHeaders = []): BunqResponseInvoiceApiObjectList
public static function get(int $invoiceId, int $monetaryAccountId = null, array $customHeaders = []): BunqResponseInvoice
{
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->get(
vsprintf(
self::ENDPOINT_URL_LISTING,
[static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
self::ENDPOINT_URL_READ,
[static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId), $invoiceId]
),
$params,
[],
$customHeaders
);

return BunqResponseInvoiceApiObjectList::castFromBunqResponse(
static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET)
return BunqResponseInvoice::castFromBunqResponse(
static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
);
}

/**
* @param int $invoiceId
* This method is called "listing" because "list" is a restricted PHP word and cannot be used as constants, class names,
* function or method names.
*
* @param int|null $monetaryAccountId
* @param string[] $params
* @param string[] $customHeaders
*
* @return BunqResponseInvoice
* @return BunqResponseInvoiceApiObjectList
*/
public static function get(int $invoiceId, int $monetaryAccountId = null, array $customHeaders = []): BunqResponseInvoice
public static function listing(int $monetaryAccountId = null, array $params = [], array $customHeaders = []): BunqResponseInvoiceApiObjectList
{
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->get(
vsprintf(
self::ENDPOINT_URL_READ,
[static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId), $invoiceId]
self::ENDPOINT_URL_LISTING,
[static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
),
[],
$params,
$customHeaders
);

return BunqResponseInvoice::castFromBunqResponse(
static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
return BunqResponseInvoiceApiObjectList::castFromBunqResponse(
static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET)
);
}

Expand Down
Loading
Loading