Skip to content

Commit

Permalink
Add "official" webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed May 29, 2021
1 parent 2333e9a commit a2d23ed
Show file tree
Hide file tree
Showing 262 changed files with 12,184 additions and 200 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion etc/clients/webhooks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
spec: https://raw.githubusercontent.com/php-api-clients/github/openapi-based-client-proof-of-concept/etc/webhooks.yaml
spec: https://raw.githubusercontent.com/octokit/webhooks/openapi/payload-schemas/openapi-schema.yml
namespace: ApiClients\Client\Github\OpenAPI\WebHooks
destination: src/OpenAPI/WebHooks
61 changes: 61 additions & 0 deletions src/OpenAPI/WebHooks/Schema/AlertInstance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class AlertInstance
{
public const SCHEMA_TITLE = 'Alert Instance';
public const SCHEMA_DESCRIPTION = '';
/**
* The full Git reference, formatted as `refs/heads/<branch name>`.
*/
private ?string $ref = null;
/**
* Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
*/
private ?string $analysis_key = null;
/**
* Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.
*/
private ?string $environment = null;
/**
* State of a code scanning alert.
*/
private ?string $state = null;
private ?string $commit_sha = null;
private array $message = array();
private array $location = array();
private array $classifications = array();
public function ref() : ?string
{
return $this->ref;
}
public function analysis_key() : ?string
{
return $this->analysis_key;
}
public function environment() : ?string
{
return $this->environment;
}
public function state() : ?string
{
return $this->state;
}
public function commit_sha() : ?string
{
return $this->commit_sha;
}
public function message() : array
{
return $this->message;
}
public function location() : array
{
return $this->location;
}
public function classifications() : array
{
return $this->classifications;
}
}
84 changes: 84 additions & 0 deletions src/OpenAPI/WebHooks/Schema/App.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class App
{
public const SCHEMA_TITLE = 'App';
public const SCHEMA_DESCRIPTION = 'GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.';
/**
* Unique identifier of the GitHub app
*/
private ?int $id = null;
/**
* The slug name of the GitHub app
*/
private ?string $slug = null;
private ?string $node_id = null;
private array $owner = array();
/**
* The name of the GitHub app
*/
private ?string $name = null;
private $description;
private ?string $external_url = null;
private ?string $html_url = null;
private ?string $created_at = null;
private ?string $updated_at = null;
/**
* The set of permissions for the GitHub app
*/
private array $permissions = array();
/**
* The list of events for the GitHub app
*/
private array $events = array();
public function id() : ?int
{
return $this->id;
}
public function slug() : ?string
{
return $this->slug;
}
public function node_id() : ?string
{
return $this->node_id;
}
public function owner() : array
{
return $this->owner;
}
public function name() : ?string
{
return $this->name;
}
public function description()
{
return $this->description;
}
public function external_url() : ?string
{
return $this->external_url;
}
public function html_url() : ?string
{
return $this->html_url;
}
public function created_at() : ?string
{
return $this->created_at;
}
public function updated_at() : ?string
{
return $this->updated_at;
}
public function permissions() : array
{
return $this->permissions;
}
public function events() : array
{
return $this->events;
}
}
9 changes: 9 additions & 0 deletions src/OpenAPI/WebHooks/Schema/AuthorAssociation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class AuthorAssociation
{
public const SCHEMA_TITLE = 'AuthorAssociation';
public const SCHEMA_DESCRIPTION = 'How the author is associated with the repository.';
}
64 changes: 64 additions & 0 deletions src/OpenAPI/WebHooks/Schema/CheckRunDeployment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class CheckRunDeployment
{
public const SCHEMA_TITLE = 'Check Run Deployment';
public const SCHEMA_DESCRIPTION = 'A deployment to a repository environment. This will only be populated if the check run was created by a GitHub Actions workflow job that references an environment.';
private ?string $url = null;
private ?int $id = null;
private ?string $node_id = null;
private ?string $task = null;
private ?string $original_environment = null;
private ?string $environment = null;
private $description;
private ?string $created_at = null;
private ?string $updated_at = null;
private ?string $statuses_url = null;
private ?string $repository_url = null;
public function url() : ?string
{
return $this->url;
}
public function id() : ?int
{
return $this->id;
}
public function node_id() : ?string
{
return $this->node_id;
}
public function task() : ?string
{
return $this->task;
}
public function original_environment() : ?string
{
return $this->original_environment;
}
public function environment() : ?string
{
return $this->environment;
}
public function description()
{
return $this->description;
}
public function created_at() : ?string
{
return $this->created_at;
}
public function updated_at() : ?string
{
return $this->updated_at;
}
public function statuses_url() : ?string
{
return $this->statuses_url;
}
public function repository_url() : ?string
{
return $this->repository_url;
}
}
9 changes: 9 additions & 0 deletions src/OpenAPI/WebHooks/Schema/CheckRunEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class CheckRunEvent
{
public const SCHEMA_TITLE = 'check_run_event';
public const SCHEMA_DESCRIPTION = '';
}
34 changes: 34 additions & 0 deletions src/OpenAPI/WebHooks/Schema/CheckRunPullRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class CheckRunPullRequest
{
public const SCHEMA_TITLE = 'Check Run Pull Request';
public const SCHEMA_DESCRIPTION = '';
private ?string $url = null;
private ?int $id = null;
private ?int $number = null;
private array $head = array();
private array $base = array();
public function url() : ?string
{
return $this->url;
}
public function id() : ?int
{
return $this->id;
}
public function number() : ?int
{
return $this->number;
}
public function head() : array
{
return $this->head;
}
public function base() : array
{
return $this->base;
}
}
56 changes: 56 additions & 0 deletions src/OpenAPI/WebHooks/Schema/CheckRun_Completed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

namespace ApiClients\Client\Github\OpenAPI\WebHooks\Schema;

final class CheckRun_Completed
{
public const SCHEMA_TITLE = 'check_run completed event';
public const SCHEMA_DESCRIPTION = '';
private ?string $action = null;
/**
* The [check_run](https://docs.github.com/en/rest/reference/checks#get-a-check-run).
*/
private array $check_run = array();
/**
* The action requested by the user.
*/
private $requested_action;
/**
* A git repository
*/
private array $repository = array();
private array $sender = array();
/**
* Installation
*/
private array $installation = array();
private array $organization = array();
public function action() : ?string
{
return $this->action;
}
public function check_run() : array
{
return $this->check_run;
}
public function requested_action()
{
return $this->requested_action;
}
public function repository() : array
{
return $this->repository;
}
public function sender() : array
{
return $this->sender;
}
public function installation() : array
{
return $this->installation;
}
public function organization() : array
{
return $this->organization;
}
}
Loading

0 comments on commit a2d23ed

Please sign in to comment.