Skip to content

Commit

Permalink
updated the sdk from the specification
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Feb 21, 2020
1 parent 8973e90 commit 5610a2a
Showing 39 changed files with 3,781 additions and 6 deletions.
548 changes: 548 additions & 0 deletions Resources/harvest-openapi.yaml

Large diffs are not rendered by default.

89 changes: 88 additions & 1 deletion generated/Client.php
Original file line number Diff line number Diff line change
@@ -791,6 +791,7 @@ public function updateTask(string $taskId, \JoliCode\Harvest\Api\Model\TasksTask
* @var int $user_id Only return time entries belonging to the user with the given ID.
* @var int $client_id Only return time entries belonging to the client with the given ID.
* @var int $project_id Only return time entries belonging to the project with the given ID.
* @var int $task_id Only return time entries belonging to the task with the given ID.
* @var bool $is_billed Pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced.
* @var bool $is_running Pass true to only return running time entries and false to return non-running time entries.
* @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format.
@@ -1385,7 +1386,7 @@ public function createUser(\JoliCode\Harvest\Api\Model\UsersPostBody $payload, s
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
* @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function retrieveTheCurrentlyAuthenticatedUser(string $fetch = self::FETCH_OBJECT)
{
@@ -1428,6 +1429,92 @@ public function updateUser(string $userId, \JoliCode\Harvest\Api\Model\UsersUser
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateUser($userId, $payload), $fetch);
}
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeClientsGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function clientsReport(\JoliCode\Harvest\Api\Model\ReportsTimeClientsGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\ClientsReport($payload), $fetch);
}
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeProjectsGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function projectsReport(\JoliCode\Harvest\Api\Model\ReportsTimeProjectsGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\ProjectsReport($payload), $fetch);
}
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsExpensesCategoriesGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function expenseCategoriesReport(\JoliCode\Harvest\Api\Model\ReportsExpensesCategoriesGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\ExpenseCategoriesReport($payload), $fetch);
}
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeTeamGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function teamReport(\JoliCode\Harvest\Api\Model\ReportsTimeTeamGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\TeamReport($payload), $fetch);
}
/**
* The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.
Note: Each request requires both the from and to parameters to be supplied in the URL’s query string. The timeframe supplied cannot exceed 1 year (365 days).
*
* @param \JoliCode\Harvest\Api\Model\ReportsUninvoicedGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function uninvoicedReport(\JoliCode\Harvest\Api\Model\ReportsUninvoicedGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\UninvoicedReport($payload), $fetch);
}
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeTasksGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function tasksReport(\JoliCode\Harvest\Api\Model\ReportsTimeTasksGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\TasksReport($payload), $fetch);
}
/**
* The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.
*
* @param \JoliCode\Harvest\Api\Model\ReportsProjectBudgetGetBody $payload json payload
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface
*/
public function projectBudgetReport(\JoliCode\Harvest\Api\Model\ReportsProjectBudgetGetBody $payload, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \JoliCode\Harvest\Api\Endpoint\ProjectBudgetReport($payload), $fetch);
}
public static function create($httpClient = null, \Jane\OpenApiRuntime\Client\Authentication $authentication = null)
{
if (null === $httpClient) {
42 changes: 42 additions & 0 deletions generated/Endpoint/ClientsReport.php
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');
}
}
42 changes: 42 additions & 0 deletions generated/Endpoint/ExpenseCategoriesReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace JoliCode\Harvest\Api\Endpoint;

class ExpenseCategoriesReport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
{
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsExpensesCategoriesGetBody $payload json payload
*/
public function __construct(\JoliCode\Harvest\Api\Model\ReportsExpensesCategoriesGetBody $payload)
{
$this->body = $payload;
}
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
public function getMethod() : string
{
return 'GET';
}
public function getUri() : string
{
return '/reports/expenses/categories';
}
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');
}
}
4 changes: 3 additions & 1 deletion generated/Endpoint/ListTimeEntries.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ class ListTimeEntries extends \Jane\OpenApiRuntime\Client\BaseEndpoint implement
* @var int $user_id Only return time entries belonging to the user with the given ID.
* @var int $client_id Only return time entries belonging to the client with the given ID.
* @var int $project_id Only return time entries belonging to the project with the given ID.
* @var int $task_id Only return time entries belonging to the task with the given ID.
* @var bool $is_billed Pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced.
* @var bool $is_running Pass true to only return running time entries and false to return non-running time entries.
* @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format.
@@ -42,12 +43,13 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(array('user_id', 'client_id', 'project_id', 'is_billed', 'is_running', 'updated_since', 'from', 'to', 'page', 'per_page'));
$optionsResolver->setDefined(array('user_id', 'client_id', 'project_id', 'task_id', 'is_billed', 'is_running', 'updated_since', 'from', 'to', 'page', 'per_page'));
$optionsResolver->setRequired(array());
$optionsResolver->setDefaults(array());
$optionsResolver->setAllowedTypes('user_id', array('int'));
$optionsResolver->setAllowedTypes('client_id', array('int'));
$optionsResolver->setAllowedTypes('project_id', array('int'));
$optionsResolver->setAllowedTypes('task_id', array('int'));
$optionsResolver->setAllowedTypes('is_billed', array('bool'));
$optionsResolver->setAllowedTypes('is_running', array('bool'));
$optionsResolver->setAllowedTypes('updated_since', array('string'));
42 changes: 42 additions & 0 deletions generated/Endpoint/ProjectBudgetReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace JoliCode\Harvest\Api\Endpoint;

class ProjectBudgetReport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
{
/**
* The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.
*
* @param \JoliCode\Harvest\Api\Model\ReportsProjectBudgetGetBody $payload json payload
*/
public function __construct(\JoliCode\Harvest\Api\Model\ReportsProjectBudgetGetBody $payload)
{
$this->body = $payload;
}
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
public function getMethod() : string
{
return 'GET';
}
public function getUri() : string
{
return '/reports/project_budget';
}
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');
}
}
42 changes: 42 additions & 0 deletions generated/Endpoint/ProjectsReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace JoliCode\Harvest\Api\Endpoint;

class ProjectsReport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
{
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeProjectsGetBody $payload json payload
*/
public function __construct(\JoliCode\Harvest\Api\Model\ReportsTimeProjectsGetBody $payload)
{
$this->body = $payload;
}
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
public function getMethod() : string
{
return 'GET';
}
public function getUri() : string
{
return '/reports/time/projects';
}
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');
}
}
4 changes: 2 additions & 2 deletions generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php
Original file line number Diff line number Diff line change
@@ -21,12 +21,12 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
* {@inheritdoc}
*
*
* @return null|\JoliCode\Harvest\Api\Model\Error
* @return null|\JoliCode\Harvest\Api\Model\User|\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\\User', 'json');
}
return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json');
}
42 changes: 42 additions & 0 deletions generated/Endpoint/TasksReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace JoliCode\Harvest\Api\Endpoint;

class TasksReport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
{
/**
*
*
* @param \JoliCode\Harvest\Api\Model\ReportsTimeTasksGetBody $payload json payload
*/
public function __construct(\JoliCode\Harvest\Api\Model\ReportsTimeTasksGetBody $payload)
{
$this->body = $payload;
}
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
public function getMethod() : string
{
return 'GET';
}
public function getUri() : string
{
return '/reports/time/tasks';
}
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');
}
}
Loading

0 comments on commit 5610a2a

Please sign in to comment.