Skip to content

Commit e4daeaa

Browse files
Add invitations endpoint (#200)
1 parent 6271289 commit e4daeaa

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/Manifest.toml
2+
/.vscode

src/GitHub.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,14 @@ export
360360
create_release,
361361
releases
362362

363-
end # module GitHub
363+
#################
364+
# Organizations #
365+
#################
366+
367+
include("orgs/orgs.jl")
368+
369+
export
370+
invitations,
371+
Invite
372+
373+
end # module GitHub

src/orgs/orgs.jl

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
##############
2+
# Organization Type #
3+
##############
4+
5+
@ghdef mutable struct Invite
6+
# id::Union{Int, Nothing}
7+
# login::Union{String, Nothing}
8+
# node_id::Union{String, Nothing}
9+
# email::Union{String, Nothing}
10+
# role::Union{String, Nothing}
11+
# created_at::Union{String, Nothing}
12+
# inviter::Union{Any, Nothing}
13+
# team_count::Union{Int, Nothing}
14+
invitation_teams_url::Union{String, Nothing}
15+
end
16+
17+
@api_default function invitations(api::GitHubAPI, org::String, params=Dict{String,Any}(); options...)
18+
results, page_data = gh_post_json(api, "/orgs/$(org)/invitations"; params=params, options...)
19+
return map(Invite, results), page_data
20+
end

0 commit comments

Comments
 (0)