Skip to content

Commit

Permalink
Merge pull request #41 from jolicode/feature/openapi-update
Browse files Browse the repository at this point in the history
updated the openapi specification
  • Loading branch information
xavierlacot authored Nov 12, 2022
2 parents e5cf68e + fef6847 commit 86539e6
Show file tree
Hide file tree
Showing 60 changed files with 2,000 additions and 412 deletions.
675 changes: 485 additions & 190 deletions Resources/harvest-openapi.yaml

Large diffs are not rendered by default.

187 changes: 119 additions & 68 deletions generated/Client.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions generated/Endpoint/ClientsExpensesReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ClientsExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEnd
*
* @var string $from only report on expenses with a spent_date on or after the given date
* @var string $to only report on expenses with a spent_date on or before the given date
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 1000. (Default: 1000)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ClientsTimeReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ClientsTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoin
*
* @var string $from only report on time entries with a spent_date on or after the given date
* @var string $to only report on time entries with a spent_date on or before the given date
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 1000. (Default: 1000)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ExpenseCategoriesReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ExpenseCategoriesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseE
*
* @var string $from only report on expenses with a spent_date on or after the given date
* @var string $to only report on expenses with a spent_date on or before the given date
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 1000. (Default: 1000)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListActiveProjectAssignments.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListActiveProjectAssignments extends \JoliCode\Harvest\Api\Runtime\Client\
* @param array $queryParameters {
*
* @var string $updated_since only return project assignments that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(string $userId, array $queryParameters = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser extends \Joli
*
* @param array $queryParameters {
*
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
86 changes: 86 additions & 0 deletions generated/Endpoint/ListAssignedTeammatesForSpecificUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

/*
* This file is part of JoliCode's Harvest PHP API project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace JoliCode\Harvest\Api\Endpoint;

class ListAssignedTeammatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint
{
use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait;
protected $userId;

/**
* Returns a list of assigned teammates for the user identified by USER_ID. The USER_ID must belong to a user that is a Manager, if not, a 422 Unprocessable Entity status code will be returned.
*
* @param array $queryParameters {
*
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(string $userId, array $queryParameters = [])
{
$this->userId = $userId;
$this->queryParameters = $queryParameters;
}

public function getMethod(): string
{
return 'GET';
}

public function getUri(): string
{
return str_replace(['{userId}'], [$this->userId], '/users/{userId}/teammates');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
return [[], null];
}

public function getExtraHeaders(): array
{
return ['Accept' => ['application/json']];
}

public function getAuthenticationScopes(): array
{
return ['BearerAuth', 'AccountAuth'];
}

protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(['page', 'per_page']);
$optionsResolver->setRequired([]);
$optionsResolver->setDefaults([]);
$optionsResolver->setAllowedTypes('page', ['int']);
$optionsResolver->setAllowedTypes('per_page', ['int']);

return $optionsResolver;
}

/**
* {@inheritdoc}
*
* @return \JoliCode\Harvest\Api\Model\Teammates|\JoliCode\Harvest\Api\Model\Error|null
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Teammates', 'json');
}
if (false !== mb_strpos($contentType, 'application/json')) {
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json');
}
}
}
4 changes: 2 additions & 2 deletions generated/Endpoint/ListBillableRatesForSpecificUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ListBillableRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Cli
*
* @param array $queryParameters {
*
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(string $userId, array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListClients.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListClients extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint impl
*
* @var bool $is_active pass true to only return active clients and false to return inactive clients
* @var string $updated_since only return clients that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListContacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListContacts extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp
*
* @var int $client_id only return contacts belonging to the client with the given ID
* @var string $updated_since only return contacts that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListCostRatesForSpecificUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ListCostRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Client\
*
* @param array $queryParameters {
*
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(string $userId, array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListEstimateItemCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ListEstimateItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\Ba
* @param array $queryParameters {
*
* @var string $updated_since only return estimate item categories that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListEstimates.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class ListEstimates extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint im
* @var string $from only return estimates with an issue_date on or after the given date
* @var string $to only return estimates with an issue_date on or before the given date
* @var string $state Only return estimates with a state matching the value provided. Options: draft, sent, accepted, or declined.
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListExpenseCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListExpenseCategories extends \JoliCode\Harvest\Api\Runtime\Client\BaseEnd
*
* @var bool $is_active pass true to only return active expense categories and false to return inactive expense categories
* @var string $updated_since only return expense categories that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListExpenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ListExpenses extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp
* @var string $updated_since only return expenses that have been updated since the given date and time
* @var string $from only return expenses with a spent_date on or after the given date
* @var string $to only return expenses with a spent_date on or before the given date
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListInvoiceItemCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ListInvoiceItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\Bas
* @param array $queryParameters {
*
* @var string $updated_since only return invoice item categories that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListInvoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class ListInvoices extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp
* @var string $from only return invoices with an issue_date on or after the given date
* @var string $to only return invoices with an issue_date on or before the given date
* @var string $state Only return invoices with a state matching the value provided. Options: draft, open, paid, or closed.
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(array $queryParameters = [])
Expand Down
4 changes: 2 additions & 2 deletions generated/Endpoint/ListMessagesForEstimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListMessagesForEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseE
* @param array $queryParameters {
*
* @var string $updated_since only return estimate messages that have been updated since the given date and time
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 100. (Default: 100)
* @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
* @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100)
* }
*/
public function __construct(string $estimateId, array $queryParameters = [])
Expand Down
Loading

0 comments on commit 86539e6

Please sign in to comment.