Skip to content

pydantic_gitlab_webhooks.events

Generic models

The AnyEvent model represents any event body which may be present in a GitHub webhook.

Event-specific models

Specific types of event each have their own Pydantic model.

PushEvent

before

before: Optional[str] = None

after

after: Optional[str] = None

ref

ref: Optional[str] = None

ref_protected

ref_protected: bool

checkout_sha

checkout_sha: str

user_id

user_id: int

user_name

user_name: Optional[str] = None

user_username

user_username: Optional[str] = None

user_email

user_email: Optional[str] = None

user_avatar

user_avatar: Optional[AnyHttpUrl] = None

project_id

project_id: int

project

project: Project

commits

commits: list[Commit]

total_commits_count

total_commits_count: int

object_kind

object_kind: Literal['push']

event_name

event_name: Literal['push']

TagPushEvent

before

before: Optional[str] = None

after

after: Optional[str] = None

ref

ref: Optional[str] = None

ref_protected

ref_protected: bool

checkout_sha

checkout_sha: str

user_id

user_id: int

user_name

user_name: Optional[str] = None

user_username

user_username: Optional[str] = None

user_email

user_email: Optional[str] = None

user_avatar

user_avatar: Optional[AnyHttpUrl] = None

project_id

project_id: int

project

project: Project

commits

commits: list[Commit]

total_commits_count

total_commits_count: int

object_kind

object_kind: Literal['tag_push']

event_name

event_name: Literal['tag_push']

IssueEvent

object_kind

object_kind: Literal['issue'] | Literal['work_item']

event_type

event_type: str

user

user: User

project

project: Project

object_attributes

object_attributes: Issue

assignees

assignees: Optional[list[User]] = None

assignee

assignee: Optional[User] = None

labels

labels: Optional[list[Label]] = None

changes

changes: Optional[Changes] = None

CommitNoteEvent

object_kind

object_kind: Literal['note']

event_type

event_type: Literal['note'] | Literal['confidential_note']

user

user: User

project_id

project_id: int

project

project: Project

object_attributes

object_attributes: Note

commit

commit: Commit

IssueNoteEvent

object_kind

object_kind: Literal['note']

event_type

event_type: Literal['note'] | Literal['confidential_note']

user

user: User

project_id

project_id: int

project

project: Project

object_attributes

object_attributes: Note

issue

issue: Issue

MergeRequestNoteEvent

object_kind

object_kind: Literal['note']

event_type

event_type: Literal['note'] | Literal['confidential_note']

user

user: User

project_id

project_id: int

project

project: Project

object_attributes

object_attributes: Note

merge_request

merge_request: MergeRequest

SnippetNoteEvent

object_kind

object_kind: Literal['note']

event_type

event_type: Literal['note'] | Literal['confidential_note']

user

user: User

project_id

project_id: int

project

project: Project

object_attributes

object_attributes: Note

snippet

snippet: Snippet

MergeRequestEvent

object_kind

object_kind: Literal['merge_request']

event_type

event_type: Literal['merge_request']

user

user: User

project

project: Project

object_attributes

object_attributes: MergeRequest

labels

labels: Optional[list[Label]] = None

assignees

assignees: Optional[list[User]] = None

reviewers

reviewers: Optional[list[User]] = None

changes

changes: Optional[Changes] = None

WikiPageEvent

object_kind

object_kind: Literal['wiki_page']

user

user: User

project

project: Project

wiki

wiki: Wiki

object_attributes

object_attributes: WikiPage

PipelineEvent

object_kind

object_kind: Literal['pipeline']

object_attributes

object_attributes: Pipeline

merge_request

merge_request: MergeRequest

user

user: User

project

project: Project

commit

commit: Commit

source_pipeline

source_pipeline: Optional[SourcePipeline]

builds

builds: list[Build]

JobEvent

object_kind

object_kind: Literal['build']

ref

ref: Optional[str] = None

tag

tag: bool

before_sha

before_sha: Optional[str] = None

sha

sha: str

build_id

build_id: int

build_name

build_name: str

build_stage

build_stage: str

build_status

build_status: str

build_created_at

build_created_at: Optional[Datetime] = None

build_started_at

build_started_at: Optional[Datetime] = None

build_finished_at

build_finished_at: Optional[Datetime] = None

build_duration

build_duration: Optional[float] = None

build_queued_duration

build_queued_duration: Optional[float] = None

build_allow_failure

build_allow_failure: bool

build_failure_reason

build_failure_reason: Optional[str] = None

retries_count

retries_count: int

pipeline_id

pipeline_id: int

project_id

project_id: int

project_name

project_name: str

user

user: User

commit

commit: Commit

project

project: Project

runner

runner: Runner

environment

environment: Optional[Environment] = None

source_pipeline

source_pipeline: SourcePipeline

DeploymentEvent

object_kind

object_kind: Literal['deployment']

status

status: str

status_changed_at

status_changed_at: Optional[Datetime] = None

deployment_id

deployment_id: int

deployable_id

deployable_id: int

deployable_url

deployable_url: AnyHttpUrl

environment

environment: Optional[str] = None

environment_tier

environment_tier: Optional[str] = None

environment_slug

environment_slug: Optional[str] = None

environment_external_url

environment_external_url: Optional[str] = None

project

project: Project

short_sha

short_sha: str

user

user: User

user_url

user_url: AnyHttpUrl

commit_url

commit_url: AnyHttpUrl

commit_title

commit_title: str

GroupMemberEvent

created_at

created_at: Datetime

updated_at

updated_at: Datetime

group_name

group_name: str

group_path

group_path: str

group_id

group_id: int

user_username

user_username: str

user_name

user_name: str

user_email

user_email: str

user_id

user_id: int

group_access

group_access: str

expires_at

expires_at: Datetime

event_name

event_name: (
    Literal["user_update_for_group"]
    | Literal["user_add_to_group"]
    | Literal["user_remove_from_group"]
    | Literal["user_access_request_to_group"]
    | Literal["user_access_request_denied_for_group"]
)

ProjectEvent

event_name

event_name: (
    Literal["project_create"] | Literal["project_destroy"]
)

created_at

created_at: Datetime

updated_at

updated_at: Datetime

name

name: str

path

path: str

path_with_namespace

path_with_namespace: str

project_id

project_id: int

project_namespace_id

project_namespace_id: int

owners

project_visibility

project_visibility: str

SubgroupEvent

created_at

created_at: Datetime

updated_at

updated_at: Datetime

event_name

event_name: (
    Literal["subgroup_create"] | Literal["subgroup_destroy"]
)

name

name: str

path

path: str

full_path

full_path: str

group_id

group_id: int

parent_group_id

parent_group_id: int

parent_name

parent_name: str

parent_path

parent_path: str

parent_full_path

parent_full_path: str

FeatureFlagEvent

object_kind

object_kind: Literal['feature_flag']

project

project: Project

user

user: User

user_url

user_url: AnyHttpUrl

object_attributes

object_attributes: FeatureFlag

ReleaseEvent

object_kind

object_kind: Literal['release']

id

id: int

created_at

created_at: Datetime

description

description: str

name

name: str

released_at

released_at: Datetime

tag

tag: str

project

project: Project

url

action

action: str

assets

assets: Assets

commit

commit: Commit

EmojiEvent

object_kind

object_kind: Literal['emoji']

event_type

event_type: str

user

user: User

project_id

project_id: int

project

project: Project

object_attributes

object_attributes: EmojiAward

note

note: Note

issue

issue: Issue

ProjectAccessTokenEvent

object_kind

object_kind: Literal['access_token']

object_attributes

object_attributes: AccessToken

event_name

event_name: str

project

project: Project

GroupAccessTokenEvent

object_kind

object_kind: Literal['access_token']

object_attributes

object_attributes: AccessToken

event_name

event_name: str

group

group: Group