Skip to content

Commit

Permalink
Add project ID in toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMicky-FR committed Jul 24, 2023
1 parent f37fe6b commit 387c3da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public static function getTransportData()
return [
[
new ScalewayApiTransport('PROJECT_ID', 'TOKEN'),
'scaleway+api://api.scaleway.com',
'scaleway+api://api.scaleway.com@PROJECT_ID',
],
[
new ScalewayApiTransport('PROJECT_ID', 'TOKEN', 'fr-par'),
'scaleway+api://api.scaleway.com@fr-par',
'scaleway+api://api.scaleway.com@PROJECT_ID?region=fr-par',
],
[
(new ScalewayApiTransport('PROJECT_ID', 'TOKEN'))->setHost('example.com'),
'scaleway+api://example.com',
'scaleway+api://example.com@PROJECT_ID',
],
[
(new ScalewayApiTransport('PROJECT_ID', 'TOKEN'))->setHost('example.com')->setPort(99),
'scaleway+api://example.com:99',
'scaleway+api://example.com:99@PROJECT_ID',
],
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function __construct(string $projectId, string $token, string $region = n

public function __toString(): string
{
$region = $this->region ? '@'.$this->region : '';
$region = $this->region ? '?region='.$this->region : '';

return sprintf('scaleway+api://%s%s', $this->getEndpoint(), $region);
return sprintf('scaleway+api://%s@%s%s', $this->getEndpoint(), $this->projectId, $region);
}

protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface
Expand Down

0 comments on commit 387c3da

Please sign in to comment.