fix(formating)
This commit is contained in:
@@ -18,6 +18,7 @@ use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define the request to get the SBP bank list.">
|
||||
@@ -46,6 +47,14 @@ class GetBankListRequest extends Request implements HasBody
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetBankListResponseData` DTO provides a type-safe and structured object for the list of SBP banks.">
|
||||
public function createDtoFromResponse(Response $response): GetBankListResponseData
|
||||
{
|
||||
return GetBankListResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="body_builder" intent="Construct the JSON body for the request.">
|
||||
// <BELIEF_STATE "The `command` field specifies the operation to the SBP API. Optional fields are conditionally added to the body.">
|
||||
protected function defaultBody(): array
|
||||
@@ -54,18 +63,14 @@ class GetBankListRequest extends Request implements HasBody
|
||||
'command' => 'GetBankList',
|
||||
];
|
||||
|
||||
if ($this->messageID !== null) $body['messageID'] = $this->messageID;
|
||||
if ($this->BankMemberIdFilter !== null) $body['BankMemberIdFilter'] = $this->BankMemberIdFilter;
|
||||
if ($this->messageID !== null) {
|
||||
$body['messageID'] = $this->messageID;
|
||||
}
|
||||
if ($this->BankMemberIdFilter !== null) {
|
||||
$body['BankMemberIdFilter'] = $this->BankMemberIdFilter;
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetBankListResponseData` DTO provides a type-safe and structured object for the list of SBP banks.">
|
||||
public function createDtoFromResponse(Response $response): GetBankListResponseData
|
||||
{
|
||||
return GetBankListResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user