@@ -35,6 +35,7 @@ class DraftPaymentApiObject extends BunqModel
3535 const FIELD_PREVIOUS_UPDATED_TIMESTAMP = 'previous_updated_timestamp ' ;
3636 const FIELD_NUMBER_OF_REQUIRED_ACCEPTS = 'number_of_required_accepts ' ;
3737 const FIELD_SCHEDULE = 'schedule ' ;
38+ const FIELD_PAYMENT_BATCH_EXECUTION_TYPE = 'payment_batch_execution_type ' ;
3839
3940 /**
4041 * Object type.
@@ -111,6 +112,13 @@ class DraftPaymentApiObject extends BunqModel
111112 */
112113 protected $ schedule ;
113114
115+ /**
116+ * The execution type that will be used when converting this draft payment to a payment batch.
117+ *
118+ * @var string|null
119+ */
120+ protected $ paymentBatchExecutionType ;
121+
114122 /**
115123 * The status of the DraftPayment.
116124 *
@@ -147,6 +155,13 @@ class DraftPaymentApiObject extends BunqModel
147155 */
148156 protected $ scheduleFieldForRequest ;
149157
158+ /**
159+ * The execution type that will be used when converting this draft payment to a payment batch.
160+ *
161+ * @var string|null
162+ */
163+ protected $ paymentBatchExecutionTypeFieldForRequest ;
164+
150165 /**
151166 * @param DraftPaymentEntryObject[] $entries The list of entries in the DraftPayment. Each entry will result in a payment
152167 * when the DraftPayment is accepted.
@@ -156,14 +171,17 @@ class DraftPaymentApiObject extends BunqModel
156171 * @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
157172 * needs to be provided to prevent race conditions.
158173 * @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
174+ * @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
175+ * a payment batch.
159176 */
160- public function __construct (array $ entries , int $ numberOfRequiredAccepts , string $ status = null , string $ previousUpdatedTimestamp = null , ScheduleApiObject $ schedule = null )
177+ public function __construct (array $ entries , int $ numberOfRequiredAccepts , string $ status = null , string $ previousUpdatedTimestamp = null , ScheduleApiObject $ schedule = null , string $ paymentBatchExecutionType = null )
161178 {
162179 $ this ->statusFieldForRequest = $ status ;
163180 $ this ->entriesFieldForRequest = $ entries ;
164181 $ this ->previousUpdatedTimestampFieldForRequest = $ previousUpdatedTimestamp ;
165182 $ this ->numberOfRequiredAcceptsFieldForRequest = $ numberOfRequiredAccepts ;
166183 $ this ->scheduleFieldForRequest = $ schedule ;
184+ $ this ->paymentBatchExecutionTypeFieldForRequest = $ paymentBatchExecutionType ;
167185 }
168186
169187 /**
@@ -178,11 +196,13 @@ public function __construct(array $entries, int $numberOfRequiredAccepts, stri
178196 * @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
179197 * needs to be provided to prevent race conditions.
180198 * @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
199+ * @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
200+ * a payment batch.
181201 * @param string[] $customHeaders
182202 *
183203 * @return BunqResponseInt
184204 */
185- public static function create (array $ entries , int $ numberOfRequiredAccepts , int $ monetaryAccountId = null , string $ status = null , string $ previousUpdatedTimestamp = null , ScheduleApiObject $ schedule = null , array $ customHeaders = []): BunqResponseInt
205+ 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
186206 {
187207 $ apiClient = new ApiClient (static ::getApiContext ());
188208 $ responseRaw = $ apiClient ->post (
@@ -194,7 +214,8 @@ public static function create(array $entries, int $numberOfRequiredAccepts, in
194214self ::FIELD_ENTRIES => $ entries ,
195215self ::FIELD_PREVIOUS_UPDATED_TIMESTAMP => $ previousUpdatedTimestamp ,
196216self ::FIELD_NUMBER_OF_REQUIRED_ACCEPTS => $ numberOfRequiredAccepts ,
197- self ::FIELD_SCHEDULE => $ schedule ],
217+ self ::FIELD_SCHEDULE => $ schedule ,
218+ self ::FIELD_PAYMENT_BATCH_EXECUTION_TYPE => $ paymentBatchExecutionType ],
198219 $ customHeaders
199220 );
200221
@@ -212,11 +233,13 @@ public static function create(array $entries, int $numberOfRequiredAccepts, in
212233 * @param string|null $previousUpdatedTimestamp The last updated_timestamp that you received for this DraftPayment. This
213234 * needs to be provided to prevent race conditions.
214235 * @param ScheduleApiObject|null $schedule The schedule details when creating or updating a scheduled payment.
236+ * @param string|null $paymentBatchExecutionType The execution type that will be used when converting this draft payment to
237+ * a payment batch.
215238 * @param string[] $customHeaders
216239 *
217240 * @return BunqResponseInt
218241 */
219- public static function update (int $ draftPaymentId , int $ monetaryAccountId = null , string $ status = null , string $ previousUpdatedTimestamp = null , ScheduleApiObject $ schedule = null , array $ customHeaders = []): BunqResponseInt
242+ public static function update (int $ draftPaymentId , int $ monetaryAccountId = null , string $ status = null , string $ previousUpdatedTimestamp = null , ScheduleApiObject $ schedule = null , string $ paymentBatchExecutionType = null , array $ customHeaders = []): BunqResponseInt
220243 {
221244 $ apiClient = new ApiClient (static ::getApiContext ());
222245 $ responseRaw = $ apiClient ->put (
@@ -226,7 +249,8 @@ public static function update(int $draftPaymentId, int $monetaryAccountId = null
226249 ),
227250 [self ::FIELD_STATUS => $ status ,
228251self ::FIELD_PREVIOUS_UPDATED_TIMESTAMP => $ previousUpdatedTimestamp ,
229- self ::FIELD_SCHEDULE => $ schedule ],
252+ self ::FIELD_SCHEDULE => $ schedule ,
253+ self ::FIELD_PAYMENT_BATCH_EXECUTION_TYPE => $ paymentBatchExecutionType ],
230254 $ customHeaders
231255 );
232256
@@ -490,6 +514,26 @@ public function setSchedule($schedule)
490514 $ this ->schedule = $ schedule ;
491515 }
492516
517+ /**
518+ * The execution type that will be used when converting this draft payment to a payment batch.
519+ *
520+ * @return string
521+ */
522+ public function getPaymentBatchExecutionType ()
523+ {
524+ return $ this ->paymentBatchExecutionType ;
525+ }
526+
527+ /**
528+ * @deprecated User should not be able to set values via setters, use constructor.
529+ *
530+ * @param string $paymentBatchExecutionType
531+ */
532+ public function setPaymentBatchExecutionType ($ paymentBatchExecutionType )
533+ {
534+ $ this ->paymentBatchExecutionType = $ paymentBatchExecutionType ;
535+ }
536+
493537 /**
494538 * @return bool
495539 */
@@ -535,6 +579,10 @@ public function isAllFieldNull()
535579 return false ;
536580 }
537581
582+ if (!is_null ($ this ->paymentBatchExecutionType )) {
583+ return false ;
584+ }
585+
538586 return true ;
539587 }
540588}
0 commit comments