From b95502dbb1c3de1200277748c579513c62ac96bc Mon Sep 17 00:00:00 2001 From: Logan Kilpatrick <23kilpatrick23@gmail.com> Date: Sun, 30 Oct 2022 13:15:46 -0500 Subject: [PATCH] Add invitations endpoint --- .gitignore | 1 + src/GitHub.jl | 12 +++++++++++- src/orgs/orgs.jl | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/orgs/orgs.jl diff --git a/.gitignore b/.gitignore index b067edd..a19d79c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Manifest.toml +/.vscode \ No newline at end of file diff --git a/src/GitHub.jl b/src/GitHub.jl index bcc33c3..cda2cb3 100644 --- a/src/GitHub.jl +++ b/src/GitHub.jl @@ -360,4 +360,14 @@ export create_release, releases -end # module GitHub +################# +# Organizations # +################# + +include("orgs/orgs.jl") + +export + invitations, + Invite + +end # module GitHub \ No newline at end of file diff --git a/src/orgs/orgs.jl b/src/orgs/orgs.jl new file mode 100644 index 0000000..89ec0da --- /dev/null +++ b/src/orgs/orgs.jl @@ -0,0 +1,20 @@ +############## +# Organization Type # +############## + +@ghdef mutable struct Invite + # id::Union{Int, Nothing} + # login::Union{String, Nothing} + # node_id::Union{String, Nothing} + # email::Union{String, Nothing} + # role::Union{String, Nothing} + # created_at::Union{String, Nothing} + # inviter::Union{Any, Nothing} + # team_count::Union{Int, Nothing} + invitation_teams_url::Union{String, Nothing} +end + +@api_default function invitations(api::GitHubAPI, org::String, params=Dict{String,Any}(); options...) + results, page_data = gh_post_json(api, "/orgs/$(org)/invitations"; params=params, options...) + return map(Invite, results), page_data +end \ No newline at end of file