Skip to content

[11.8] Add resource events API endpoints #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/Api/ResourceIterationEvents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Gitlab API library.
*
* (c) Matt Humphrey <matth@windsor-telecom.co.uk>
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gitlab\Api;

class ResourceIterationEvents extends AbstractApi
{
/**
* @param int|string $project_id
* @param int $issue_iid
*
* @return mixed
*/
public function all($project_id, int $issue_iid)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_iteration_events';

return $this->get($this->getProjectPath($project_id, $path));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $resource_iteration_event_id
*
* @return mixed
*/
public function show($project_id, int $issue_iid, int $resource_iteration_event_id)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_iteration_events/';
$path .= self::encodePath($resource_iteration_event_id);

return $this->get($this->getProjectPath($project_id, $path));
}
}
46 changes: 46 additions & 0 deletions src/Api/ResourceLabelEvents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Gitlab API library.
*
* (c) Matt Humphrey <matth@windsor-telecom.co.uk>
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gitlab\Api;

class ResourceLabelEvents extends AbstractApi
{
/**
* @param int|string $project_id
* @param int $issue_iid
*
* @return mixed
*/
public function all($project_id, int $issue_iid)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_label_events';

return $this->get($this->getProjectPath($project_id, $path));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $resource_label_event_id
*
* @return mixed
*/
public function show($project_id, int $issue_iid, int $resource_label_event_id)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_label_events/';
$path .= self::encodePath($resource_label_event_id);

return $this->get($this->getProjectPath($project_id, $path));
}
}
46 changes: 46 additions & 0 deletions src/Api/ResourceMilestoneEvents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Gitlab API library.
*
* (c) Matt Humphrey <matth@windsor-telecom.co.uk>
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gitlab\Api;

class ResourceMilestoneEvents extends AbstractApi
{
/**
* @param int|string $project_id
* @param int $issue_iid
*
* @return mixed
*/
public function all($project_id, int $issue_iid)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_milestone_events';

return $this->get($this->getProjectPath($project_id, $path));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $resource_milestone_event_id
*
* @return mixed
*/
public function show($project_id, int $issue_iid, int $resource_milestone_event_id)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_milestone_events/';
$path .= self::encodePath($resource_milestone_event_id);

return $this->get($this->getProjectPath($project_id, $path));
}
}
46 changes: 46 additions & 0 deletions src/Api/ResourceStateEvents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Gitlab API library.
*
* (c) Matt Humphrey <matth@windsor-telecom.co.uk>
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gitlab\Api;

class ResourceStateEvents extends AbstractApi
{
/**
* @param int|string $project_id
* @param int $issue_iid
*
* @return mixed
*/
public function all($project_id, int $issue_iid)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_state_events';

return $this->get($this->getProjectPath($project_id, $path));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $resource_label_event_id
*
* @return mixed
*/
public function show($project_id, int $issue_iid, int $resource_label_event_id)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_state_events/';
$path .= self::encodePath($resource_label_event_id);

return $this->get($this->getProjectPath($project_id, $path));
}
}
46 changes: 46 additions & 0 deletions src/Api/ResourceWeightEvents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Gitlab API library.
*
* (c) Matt Humphrey <matth@windsor-telecom.co.uk>
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gitlab\Api;

class ResourceWeightEvents extends AbstractApi
{
/**
* @param int|string $project_id
* @param int $issue_iid
*
* @return mixed
*/
public function all($project_id, int $issue_iid)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_weight_events';

return $this->get($this->getProjectPath($project_id, $path));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $resource_label_event_id
*
* @return mixed
*/
public function show($project_id, int $issue_iid, int $resource_label_event_id)
{
$path = 'issues/'.self::encodePath($issue_iid).'/resource_weight_events/';
$path .= self::encodePath($resource_label_event_id);

return $this->get($this->getProjectPath($project_id, $path));
}
}
45 changes: 45 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
use Gitlab\Api\Projects;
use Gitlab\Api\Repositories;
use Gitlab\Api\RepositoryFiles;
use Gitlab\Api\ResourceIterationEvents;
use Gitlab\Api\ResourceLabelEvents;
use Gitlab\Api\ResourceMilestoneEvents;
use Gitlab\Api\ResourceStateEvents;
use Gitlab\Api\ResourceWeightEvents;
use Gitlab\Api\Schedules;
use Gitlab\Api\Snippets;
use Gitlab\Api\SystemHooks;
Expand Down Expand Up @@ -218,6 +223,46 @@ public function issues(): Issues
return new Issues($this);
}

/**
* @return ResourceIterationEvents
*/
public function resourceIterationEvents(): ResourceIterationEvents
{
return new ResourceIterationEvents($this);
}

/**
* @return ResourceLabelEvents
*/
public function resourceLabelEvents(): ResourceLabelEvents
{
return new ResourceLabelEvents($this);
}

/**
* @return ResourceMilestoneEvents
*/
public function resourceMilestoneEvents(): ResourceMilestoneEvents
{
return new ResourceMilestoneEvents($this);
}

/**
* @return ResourceStateEvents
*/
public function resourceStateEvents(): ResourceStateEvents
{
return new ResourceStateEvents($this);
}

/**
* @return ResourceWeightEvents
*/
public function resourceWeightEvents(): ResourceWeightEvents
{
return new ResourceWeightEvents($this);
}

/**
* @return IssuesStatistics
*/
Expand Down
Loading