diff --git a/src/Api/Groups.php b/src/Api/Groups.php index 5a97e0cf..89fbdd20 100644 --- a/src/Api/Groups.php +++ b/src/Api/Groups.php @@ -309,7 +309,8 @@ public function removeMember($group_id, int $user_id) * @var bool $with_merge_requests_enabled Limit by projects with merge requests feature enabled (default is false) * @var bool $with_shared Include projects shared to this group (default is true) * @var bool $include_subgroups Include projects in subgroups of this group (default is false) - * @var bool $with_custom_attributes Include custom attributes in response (admins only). + * @var bool $with_custom_attributes Include custom attributes in response (admins only) + * @var \DateTimeInterface $last_activity_after Limit by projects with last_activity after specified time * } * * @return mixed @@ -320,6 +321,9 @@ public function projects($id, array $parameters = []) $booleanNormalizer = function (Options $resolver, $value): string { return $value ? 'true' : 'false'; }; + $datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string { + return $value->format('c'); + }; $resolver->setDefined('archived') ->setAllowedTypes('archived', 'bool') @@ -367,6 +371,10 @@ public function projects($id, array $parameters = []) ->setAllowedTypes('with_custom_attributes', 'bool') ->setNormalizer('with_custom_attributes', $booleanNormalizer) ; + $resolver->setDefined('last_activity_after') + ->setAllowedTypes('last_activity_after', \DateTimeInterface::class) + ->setNormalizer('last_activity_after', $datetimeNormalizer) + ; return $this->get('groups/'.self::encodePath($id).'/projects', $resolver->resolve($parameters)); } diff --git a/src/Api/Projects.php b/src/Api/Projects.php index 3f5d1962..53751275 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -348,11 +348,11 @@ public function enableRunner(int $project_id, int $runner_id) * @var string $name the name of the user who triggered pipelines * @var string $username the username of the user who triggered pipelines * @var string $order_by order pipelines by id, status, ref, updated_at, or user_id (default: id) - * @var string $order sort pipelines in asc or desc order (default: desc) + * @var string $sort sort pipelines in asc or desc order (default: desc) * @var string $source the source of the pipeline + * @var \DateTimeInterface $updated_after Return pipelines updated on or after the given date and time + * @var \DateTimeInterface $updated_before Return pipelines updated on or before the given date and time. * } - * - * @return mixed */ public function pipelines($project_id, array $parameters = []) { @@ -361,7 +361,7 @@ public function pipelines($project_id, array $parameters = []) return $value ? 'true' : 'false'; }; $datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string { - return $value->format('Y-m-d'); + return $value->format('c'); }; $resolver->setDefined('scope')