| @@ 149-156 (lines=8) @@ | ||
| 146 | * @param string $action The publish action |
|
| 147 | * @return \Fungku\HubSpot\Http\Response |
|
| 148 | */ |
|
| 149 | public function publishAction($id, $action) |
|
| 150 | { |
|
| 151 | $endpoint = "/content/api/v2/blog-posts/{$id}/publish-action"; |
|
| 152 | ||
| 153 | $options['json'] = ['action' => $action]; |
|
| 154 | ||
| 155 | return $this->request('post', $endpoint, $options); |
|
| 156 | } |
|
| 157 | ||
| 158 | /** |
|
| 159 | * Copies the contents of the auto-save buffer into the live blog post. |
|
| @@ 44-51 (lines=8) @@ | ||
| 41 | * @param array $params The blog post fields to update. |
|
| 42 | * @return \Fungku\HubSpot\Http\Response |
|
| 43 | */ |
|
| 44 | public function update($id, $params = []) |
|
| 45 | { |
|
| 46 | $endpoint = "/content/api/v2/blog-posts/{$id}"; |
|
| 47 | ||
| 48 | $options['json'] = $params; |
|
| 49 | ||
| 50 | return $this->request('put', $endpoint, $options); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Delete a blog post. |
|
| @@ 88-95 (lines=8) @@ | ||
| 85 | * @param array $params Allowed parameters. |
|
| 86 | * @return \Fungku\HubSpot\Http\Response |
|
| 87 | */ |
|
| 88 | public function updateAutoSaveBuffer($id, $params = []) |
|
| 89 | { |
|
| 90 | $endpoint = "/content/api/v2/blog-posts/{$id}/buffer"; |
|
| 91 | ||
| 92 | $options['json'] = $params; |
|
| 93 | ||
| 94 | return $this->request('put', $endpoint, $options); |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * Gets the current contents of the auto-save buffer. |
|
| @@ 144-151 (lines=8) @@ | ||
| 141 | * @param string $action The publish action |
|
| 142 | * @return \Fungku\HubSpot\Http\Response |
|
| 143 | */ |
|
| 144 | public function publishAction($page_id, $action) |
|
| 145 | { |
|
| 146 | $endpoint = "/content/api/v2/pages/{$page_id}/publish-action"; |
|
| 147 | ||
| 148 | $options['json'] = ['action' => $action]; |
|
| 149 | ||
| 150 | return $this->request('post', $endpoint, $options); |
|
| 151 | } |
|
| 152 | ||
| 153 | /** |
|
| 154 | * Copies the contents of the auto-save buffer into the live page. |
|
| @@ 212-219 (lines=8) @@ | ||
| 209 | * @param int $version_id The version ID |
|
| 210 | * @return \Fungku\HubSpot\Http\Response |
|
| 211 | */ |
|
| 212 | public function restoreVersion($page_id, $version_id) |
|
| 213 | { |
|
| 214 | $endpoint = "/content/api/v2/pages/{$page_id}/versions/restore"; |
|
| 215 | ||
| 216 | $options['json'] = compact('version_id'); |
|
| 217 | ||
| 218 | return $this->request('post', $endpoint, $options); |
|
| 219 | } |
|
| 220 | } |
|
| 221 | ||
| @@ 62-70 (lines=9) @@ | ||
| 59 | * @param array $params Optional Parameters. |
|
| 60 | * @return \Fungku\HubSpot\Http\Response |
|
| 61 | */ |
|
| 62 | public function create($name, $params = []) |
|
| 63 | { |
|
| 64 | $endpoint = '/blogs/v3/topics'; |
|
| 65 | ||
| 66 | $params['name'] = $name; |
|
| 67 | ||
| 68 | $options['json'] = $params; |
|
| 69 | ||
| 70 | return $this->request('post', $endpoint, $options); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| @@ 80-86 (lines=7) @@ | ||
| 77 | * @param array $params The blog topic fields to update. |
|
| 78 | * @return \Fungku\HubSpot\Http\Response |
|
| 79 | */ |
|
| 80 | public function update($id, $params = []) |
|
| 81 | { |
|
| 82 | $endpoint = "/blogs/v3/topics/{$id}"; |
|
| 83 | ||
| 84 | $options['json'] = $params; |
|
| 85 | ||
| 86 | return $this->request('put', $endpoint, $options); |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|