@@ -69,6 +69,49 @@ function issue(auth::Authorization, owner::String, repo, num; headers = Dict(),
69
69
end
70
70
71
71
72
+ function issues (owner:: String , repo; auth = AnonymousAuth (), options... )
73
+ issues (auth, owner, repo; options... )
74
+ end
75
+
76
+ function issues (owner:: Owner , repo; auth = AnonymousAuth (), options... )
77
+ issues (auth, owner. login, repo; options... )
78
+ end
79
+
80
+ function issues (auth:: Authorization , owner:: String , repo; milestone = nothing ,
81
+ state = nothing ,
82
+ assignee = nothing ,
83
+ creator = nothing ,
84
+ mentioned = nothing ,
85
+ labels = nothing ,
86
+ sort = nothing ,
87
+ direction = nothing ,
88
+ since = nothing ,
89
+ headers = Dict (),
90
+ data = Dict (),
91
+ options... )
92
+ authenticate_headers (headers, auth)
93
+
94
+ milestone != nothing && (data[" milestone" ] = milestone)
95
+ state != nothing && (data[" state" ] = state)
96
+ assignee != nothing && (data[" assignee" ] = assignee)
97
+ creator != nothing && (data[" creator" ] = creator)
98
+ mentioned != nothing && (data[" mentioned" ] = mentioned)
99
+ labels != nothing && (data[" labels" ] = labels)
100
+ sort != nothing && (data[" sort" ] = sort)
101
+ direction != nothing && (data[" direction" ] = direction)
102
+ since != nothing && (data[" since" ] = since)
103
+
104
+ r = get (URI (API_ENDPOINT; path = " /repos/$owner /$repo /issues" );
105
+ headers = headers,
106
+ query = data,
107
+ options... )
108
+
109
+ handle_error (r)
110
+
111
+ map! (i -> Issue (i), JSON. parse (r. data))
112
+ end
113
+
114
+
72
115
function create_issue (owner:: String , repo, title; auth = AnonymousAuth (), options... )
73
116
create_issue (auth, owner, repo, title; options... )
74
117
end
@@ -82,10 +125,10 @@ function create_issue(auth::Authorization, owner::String, repo, title; body = no
82
125
milestone = nothing ,
83
126
labels = nothing ,
84
127
headers = Dict (),
128
+ data = Dict (),
85
129
options... )
86
130
authenticate_headers (headers, auth)
87
131
88
- data = Dict ()
89
132
data[" title" ] = title
90
133
body != nothing && (data[" body" ] = body)
91
134
assignee != nothing && (data[" assignee" ] = assignee)
@@ -118,10 +161,10 @@ function edit_issue(auth::Authorization, owner::String, repo, num; title = nothi
118
161
milestone = nothing ,
119
162
labels = nothing ,
120
163
headers = Dict (),
164
+ data = Dict (),
121
165
options... )
122
166
authenticate_headers (headers, auth)
123
167
124
- data = Dict ()
125
168
title != nothing && (data[" title" ] = title)
126
169
body != nothing && (data[" body" ] = body)
127
170
assignee != nothing && (data[" assignee" ] = assignee)
0 commit comments