Skip to content

Commit 792ea6b

Browse files
Add project
1 parent 0f755fa commit 792ea6b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Factory.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ final class Factory
2828
*/
2929
private ?string $organization = null;
3030

31+
/**
32+
* The project for the requests.
33+
*/
34+
private ?string $project = null;
35+
3136
/**
3237
* The HTTP client for the requests.
3338
*/
@@ -74,6 +79,16 @@ public function withOrganization(?string $organization): self
7479
return $this;
7580
}
7681

82+
/**
83+
* Sets the project for the requests.
84+
*/
85+
public function withProject(?string $project): self
86+
{
87+
$this->project = project;
88+
89+
return $this;
90+
}
91+
7792
/**
7893
* Sets the HTTP client for the requests.
7994
* If no client is provided the factory will try to find one using PSR-18 HTTP Client Discovery.
@@ -141,6 +156,10 @@ public function make(): Client
141156
$headers = $headers->withOrganization($this->organization);
142157
}
143158

159+
if ($this->project !== null) {
160+
$headers = $headers->withProject($this->project);
161+
}
162+
144163
foreach ($this->headers as $name => $value) {
145164
$headers = $headers->withCustomHeader($name, $value);
146165
}

0 commit comments

Comments
 (0)