-
Notifications
You must be signed in to change notification settings - Fork 1
/
github_issues_milestones.body.sql
137 lines (100 loc) · 3 KB
/
github_issues_milestones.body.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
create or replace package body github_issues_milestones
as
function list_milestones (
git_account varchar2
, repos_name varchar2
, state varchar2 default 'open'
, sort varchar2 default 'due_date'
, direction varchar2 default 'asc'
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/milestones', 'GET');
github.github_call_request.call_json.put('state', state);
github.github_call_request.call_json.put('sort', sort);
github.github_call_request.call_json.put('direction', direction);
github.talk(
github_account => git_account
);
return github.github_response_result;
end list_milestones;
function get_milestone (
git_account varchar2
, repos_name varchar2
, milestone_id number
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/milestones/' || milestone_id, 'GET');
github.talk(
github_account => git_account
);
return github.github_response_result;
end get_milestone;
procedure create_milestone (
git_account varchar2
, repos_name varchar2
, title varchar2
, state varchar2 default 'open'
, description varchar2 default null
, due_on varchar2 default null
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/milestones', 'POST');
github.github_call_request.call_json.put('title', title);
github.github_call_request.call_json.put('state', state);
if description is not null then
github.github_call_request.call_json.put('description', description);
end if;
if due_on is not null then
github.github_call_request.call_json.put('due_on', due_on);
end if;
github.talk(
github_account => git_account
);
end create_milestone;
procedure update_milestone (
git_account varchar2
, repos_name varchar2
, milestone_id number
, title varchar2 default null
, state varchar2 default 'open'
, description varchar2 default null
, due_on varchar2 default null
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/milestones/' || milestone_id, 'PATCH');
if title is not null then
github.github_call_request.call_json.put('title', title);
end if;
if state is not null then
github.github_call_request.call_json.put('state', state);
end if;
if description is not null then
github.github_call_request.call_json.put('description', description);
end if;
if due_on is not null then
github.github_call_request.call_json.put('due_on', due_on);
end if;
github.talk(
github_account => git_account
);
end update_milestone;
procedure delete_milestone (
git_account varchar2
, repos_name varchar2
, milestone_id number
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/milestones/' || milestone_id, 'DELETE');
github.talk(
github_account => git_account
);
end delete_milestone;
end github_issues_milestones;
/