@@ 272-285 (lines=14) @@ | ||
269 | * |
|
270 | * @since 1.0 |
|
271 | */ |
|
272 | public function setThreadSubscription($id, $subscribed, $ignored) |
|
273 | { |
|
274 | // Build the request path. |
|
275 | $path = '/notifications/threads/' . $id . '/subscription'; |
|
276 | ||
277 | $data = array( |
|
278 | 'subscribed' => $subscribed, |
|
279 | 'ignored' => $ignored |
|
280 | ); |
|
281 | ||
282 | return $this->processResponse( |
|
283 | $this->client->put($this->fetchUrl($path), json_encode($data)) |
|
284 | ); |
|
285 | } |
|
286 | ||
287 | /** |
|
288 | * Delete a Thread Subscription. |
@@ 79-93 (lines=15) @@ | ||
76 | * @since 1.0 |
|
77 | * @throws \DomainException |
|
78 | */ |
|
79 | public function edit($commentId, $body) |
|
80 | { |
|
81 | // Build the request path. |
|
82 | $path = '/gists/comments/' . (int) $commentId; |
|
83 | ||
84 | // Build the request data. |
|
85 | $data = json_encode( |
|
86 | array( |
|
87 | 'body' => $body |
|
88 | ) |
|
89 | ); |
|
90 | ||
91 | // Send the request. |
|
92 | return $this->processResponse($this->client->patch($this->fetchUrl($path), $data)); |
|
93 | } |
|
94 | ||
95 | /** |
|
96 | * Get a single comment. |
@@ 104-116 (lines=13) @@ | ||
101 | * @since 1.4.0 |
|
102 | * @throws \DomainException |
|
103 | */ |
|
104 | public function add($owner, $repo, $number, array $assignees) |
|
105 | { |
|
106 | // Build the request path. |
|
107 | $path = "/repos/$owner/$repo/issues/$number/assignees"; |
|
108 | ||
109 | $data = json_encode( |
|
110 | array( |
|
111 | 'assignees' => $assignees, |
|
112 | ) |
|
113 | ); |
|
114 | ||
115 | return $this->processResponse($this->client->post($this->fetchUrl($path), $data), 201); |
|
116 | } |
|
117 | ||
118 | /** |
|
119 | * Remove assignees from an Issue |
|
@@ 133-145 (lines=13) @@ | ||
130 | * @since 1.4.0 |
|
131 | * @throws \DomainException |
|
132 | */ |
|
133 | public function remove($owner, $repo, $number, array $assignees) |
|
134 | { |
|
135 | // Build the request path. |
|
136 | $path = "/repos/$owner/$repo/issues/$number/assignees"; |
|
137 | ||
138 | $data = json_encode( |
|
139 | array( |
|
140 | 'assignees' => $assignees, |
|
141 | ) |
|
142 | ); |
|
143 | ||
144 | return $this->processResponse($this->client->delete($this->fetchUrl($path), array(), null, $data)); |
|
145 | } |
|
146 | } |
|
147 |
@@ 93-107 (lines=15) @@ | ||
90 | * |
|
91 | * @since 1.0 |
|
92 | */ |
|
93 | public function create($title, $key) |
|
94 | { |
|
95 | // Build the request path. |
|
96 | $path = '/users/keys'; |
|
97 | ||
98 | $data = array( |
|
99 | 'title' => $title, |
|
100 | 'key' => $key |
|
101 | ); |
|
102 | ||
103 | return $this->processResponse( |
|
104 | $this->client->post($this->fetchUrl($path), json_encode($data)), |
|
105 | 201 |
|
106 | ); |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * Update a public key. |
|
@@ 120-133 (lines=14) @@ | ||
117 | * |
|
118 | * @since 1.0 |
|
119 | */ |
|
120 | public function edit($id, $title, $key) |
|
121 | { |
|
122 | // Build the request path. |
|
123 | $path = '/users/keys/' . $id; |
|
124 | ||
125 | $data = array( |
|
126 | 'title' => $title, |
|
127 | 'key' => $key |
|
128 | ); |
|
129 | ||
130 | return $this->processResponse( |
|
131 | $this->client->patch($this->fetchUrl($path), json_encode($data)) |
|
132 | ); |
|
133 | } |
|
134 | ||
135 | /** |
|
136 | * Delete a public key. |