-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from jolicode/feature/jane-5
Feature/jane 5
- Loading branch information
Showing
397 changed files
with
16,749 additions
and
12,832 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace JoliCode\Harvest\Api\Authentication; | ||
|
||
class AccountAuthAuthentication implements \Jane\OpenApiRuntime\Client\Authentication | ||
{ | ||
private $apiKey; | ||
public function __construct(string $apiKey) | ||
{ | ||
$this->{'apiKey'} = $apiKey; | ||
} | ||
public function getPlugin() : \Http\Client\Common\Plugin | ||
{ | ||
return new \Http\Client\Common\Plugin\AuthenticationPlugin(new class($this->{'apiKey'}) implements \Http\Message\Authentication | ||
{ | ||
private $apiKey; | ||
public function __construct(string $apiKey) | ||
{ | ||
$this->{'apiKey'} = $apiKey; | ||
} | ||
public function authenticate(\Psr\Http\Message\RequestInterface $request) | ||
{ | ||
return $request->withHeader('Harvest-Account-Id', $this->{'apiKey'}); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace JoliCode\Harvest\Api\Authentication; | ||
|
||
class BearerAuthAuthentication implements \Jane\OpenApiRuntime\Client\Authentication | ||
{ | ||
private $apiKey; | ||
public function __construct(string $apiKey) | ||
{ | ||
$this->{'apiKey'} = $apiKey; | ||
} | ||
public function getPlugin() : \Http\Client\Common\Plugin | ||
{ | ||
return new \Http\Client\Common\Plugin\AuthenticationPlugin(new class($this->{'apiKey'}) implements \Http\Message\Authentication | ||
{ | ||
private $apiKey; | ||
public function __construct(string $apiKey) | ||
{ | ||
$this->{'apiKey'} = $apiKey; | ||
} | ||
public function authenticate(\Psr\Http\Message\RequestInterface $request) | ||
{ | ||
return $request->withHeader('Authorization', $this->{'apiKey'}); | ||
} | ||
}); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace JoliCode\Harvest\Api\Endpoint; | ||
|
||
class ClientsReport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint | ||
{ | ||
/** | ||
* | ||
* | ||
* @param \JoliCode\Harvest\Api\Model\ReportsTimeClientsGetBody $payload json payload | ||
*/ | ||
public function __construct(\JoliCode\Harvest\Api\Model\ReportsTimeClientsGetBody $payload) | ||
{ | ||
$this->body = $payload; | ||
} | ||
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait; | ||
public function getMethod() : string | ||
{ | ||
return 'GET'; | ||
} | ||
public function getUri() : string | ||
{ | ||
return '/reports/time/clients'; | ||
} | ||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array | ||
{ | ||
return $this->getSerializedBody($serializer); | ||
} | ||
/** | ||
* {@inheritdoc} | ||
* | ||
* | ||
* @return null|\JoliCode\Harvest\Api\Model\Error | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType) | ||
{ | ||
if (200 === $status) { | ||
return null; | ||
} | ||
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file has been auto generated by Jane, | ||
* | ||
* Do no edit it directly. | ||
*/ | ||
|
||
namespace JoliCode\Harvest\Api\Endpoint; | ||
|
||
class CreateBillableRate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint | ||
{ | ||
protected $userId; | ||
|
||
/** | ||
* Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. | ||
* Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. | ||
Creating a billable rate with no start_date will replace a user’s existing rate(s). | ||
Creating a billable rate with a start_date that is before a user’s existing rate(s) will replace those billable rates with the new one. | ||
* | ||
* @param string $userId | ||
* @param \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $payload json payload | ||
*/ | ||
* | ||
* @param string $userId | ||
* @param \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $payload json payload | ||
*/ | ||
public function __construct(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $payload) | ||
{ | ||
$this->userId = $userId; | ||
$this->body = $payload; | ||
} | ||
|
||
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait; | ||
|
||
public function getMethod(): string | ||
public function getMethod() : string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
public function getUri() : string | ||
{ | ||
return str_replace(['{userId}'], [$this->userId], '/users/{userId}/billable_rates'); | ||
return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/billable_rates'); | ||
} | ||
|
||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array | ||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array | ||
{ | ||
return $this->getSerializedBody($serializer); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* | ||
* @return \JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|null | ||
* @return null|\JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType) | ||
{ | ||
if (201 === $status) { | ||
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json'); | ||
} | ||
|
||
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file has been auto generated by Jane, | ||
* | ||
* Do no edit it directly. | ||
*/ | ||
|
||
namespace JoliCode\Harvest\Api\Endpoint; | ||
|
||
class CreateCostRate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint | ||
{ | ||
protected $userId; | ||
|
||
/** | ||
* Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. | ||
* Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. | ||
Creating a cost rate with no start_date will replace a user’s existing rate(s). | ||
Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one. | ||
* | ||
* @param string $userId | ||
* @param \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $payload json payload | ||
*/ | ||
* | ||
* @param string $userId | ||
* @param \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $payload json payload | ||
*/ | ||
public function __construct(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $payload) | ||
{ | ||
$this->userId = $userId; | ||
$this->body = $payload; | ||
} | ||
|
||
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait; | ||
|
||
public function getMethod(): string | ||
public function getMethod() : string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
public function getUri() : string | ||
{ | ||
return str_replace(['{userId}'], [$this->userId], '/users/{userId}/cost_rates'); | ||
return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/cost_rates'); | ||
} | ||
|
||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array | ||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array | ||
{ | ||
return $this->getSerializedBody($serializer); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* | ||
* @return \JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|null | ||
* @return null|\JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType) | ||
{ | ||
if (201 === $status) { | ||
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json'); | ||
} | ||
|
||
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); | ||
} | ||
} | ||
} |
Oops, something went wrong.