{"action":"created","comment":{"url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/comments/179953765","pull_request_review_id":110293202,"id":179953765,"diff_hunk":"@@ -0,0 +1,268 @@\n+<?php\n+\n+/*\n+ * Copyright (C) 2013 Mailgun\n+ *\n+ * This software may be modified and distributed under the terms\n+ * of the MIT license. See the LICENSE file for details.\n+ */\n+\n+namespace Mailgun\\Api;\n+\n+use Mailgun\\Assert;\n+use Mailgun\\Model\\MailingList\\PagesResponse;\n+use Mailgun\\Model\\MailingList\\CreateResponse;\n+use Mailgun\\Model\\MailingList\\ShowResponse;\n+use Mailgun\\Model\\MailingList\\UpdateResponse;\n+use Mailgun\\Model\\MailingList\\DeleteResponse;\n+use Mailgun\\Model\\MailingList\\MembersResponse;\n+use Mailgun\\Model\\MailingList\\CreateMemberResponse;\n+use Mailgun\\Model\\MailingList\\ShowMemberResponse;\n+use Mailgun\\Model\\MailingList\\UpdateMemberResponse;\n+use Mailgun\\Model\\MailingList\\DeleteMemberResponse;\n+use Psr\\Http\\Message\\ResponseInterface;\n+\n+/**\n+ * @author Michael Münch <helmchen@sounds-like.me>\n+ */\n+class MailingList extends HttpApi\n+{\n+    /**\n+     * Returns a paginated list of mailing lists on the domain.\n+     *\n+     * @param int $limit Maximum number of records to return (optional: 100 by default)\n+     *\n+     * @return PagesResponse|array|ResponseInterface\n+     *\n+     * @throws \\Exception\n+     */\n+    public function pages($limit = 100)\n+    {\n+        Assert::integer($limit);\n+\n+        $params = compact('limit');\n+\n+        $response = $this->httpGet('/v3/lists/pages', $params);\n+\n+        return $this->hydrateResponse($response, PagesResponse::class);\n+    }\n+\n+    /**\n+     * Creates a new mailing list on the current domain.\n+     *\n+     * @param string $address      Address for the new mailing list\n+     * @param string $name         Name for the new mailing list (optional)\n+     * @param string $description  Description for the new mailing list (optional)\n+     * @param string $access_level List access level, one of: readonly (default), members, everyone\n+     *\n+     * @return CreateResponse|array|ResponseInterface\n+     *\n+     * @throws \\Exception\n+     */\n+    public function create($address, $name = null, $description = null, $access_level = 'readonly')\n+    {\n+        Assert::stringNotEmpty($address);\n+        Assert::oneOf($access_level, ['readonly', 'members', 'everyone']);\n+\n+        $params = compact('address', 'name', 'description', 'access_level');\n+\n+        $response = $this->httpPost('/v3/lists', $params);\n+\n+        return $this->hydrateResponse($response, CreateResponse::class);\n+    }\n+\n+    /**\n+     * Returns a single mailing list.\n+     *\n+     * @param string $address Address of the mailing list\n+     *\n+     * @return ShowResponse|array|ResponseInterface\n+     *\n+     * @throws \\Exception\n+     */\n+    public function show($address)\n+    {\n+        Assert::stringNotEmpty($address);\n+\n+        $response = $this->httpGet(sprintf('/v3/lists/%s', $address));\n+\n+        return $this->hydrateResponse($response, ShowResponse::class);\n+    }\n+\n+    /**\n+     * Updates a mailing list.\n+     *\n+     * @param string $address    Address of the mailing list\n+     * @param array  $parameters Array of field => value pairs to update\n+     *\n+     * @return UpdateResponse|array|ResponseInterface\n+     *\n+     * @throws \\Exception\n+     */\n+    public function update($address, $parameters = [])\n+    {\n+        Assert::stringNotEmpty($address);\n+        Assert::isArray($parameters);\n+\n+        foreach ($parameters as $field => $value) {","path":"src/Mailgun/Api/MailingList.php","position":116,"original_position":107,"commit_id":"2d576930f2375a3b712bbb103ffc2c718a66de5e","original_commit_id":"5dfc16cd975fa932f292325492e5ff549daabd42","user":{"login":"Etmolf","id":4807403,"avatar_url":"https://avatars3.githubusercontent.com/u/4807403?v=4","gravatar_id":"","url":"https://api.github.com/users/Etmolf","html_url":"https://github.com/Etmolf","followers_url":"https://api.github.com/users/Etmolf/followers","following_url":"https://api.github.com/users/Etmolf/following{/other_user}","gists_url":"https://api.github.com/users/Etmolf/gists{/gist_id}","starred_url":"https://api.github.com/users/Etmolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Etmolf/subscriptions","organizations_url":"https://api.github.com/users/Etmolf/orgs","repos_url":"https://api.github.com/users/Etmolf/repos","events_url":"https://api.github.com/users/Etmolf/events{/privacy}","received_events_url":"https://api.github.com/users/Etmolf/received_events","type":"User","site_admin":false},"body":"that sounds good to me - I will think about what exception you take the best, in doubt probably InvalidArgument?","created_at":"2018-04-08T16:51:41Z","updated_at":"2018-04-08T16:51:41Z","html_url":"https://github.com/mailgun/mailgun-php/pull/457#discussion_r179953765","pull_request_url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/comments/179953765"},"html":{"href":"https://github.com/mailgun/mailgun-php/pull/457#discussion_r179953765"},"pull_request":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457"}},"in_reply_to_id":179912840},"pull_request":{"url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457","id":180073419,"html_url":"https://github.com/mailgun/mailgun-php/pull/457","diff_url":"https://github.com/mailgun/mailgun-php/pull/457.diff","patch_url":"https://github.com/mailgun/mailgun-php/pull/457.patch","issue_url":"https://api.github.com/repos/mailgun/mailgun-php/issues/457","number":457,"state":"open","locked":false,"title":"Add Mailing Lists support","user":{"login":"Etmolf","id":4807403,"avatar_url":"https://avatars3.githubusercontent.com/u/4807403?v=4","gravatar_id":"","url":"https://api.github.com/users/Etmolf","html_url":"https://github.com/Etmolf","followers_url":"https://api.github.com/users/Etmolf/followers","following_url":"https://api.github.com/users/Etmolf/following{/other_user}","gists_url":"https://api.github.com/users/Etmolf/gists{/gist_id}","starred_url":"https://api.github.com/users/Etmolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Etmolf/subscriptions","organizations_url":"https://api.github.com/users/Etmolf/orgs","repos_url":"https://api.github.com/users/Etmolf/repos","events_url":"https://api.github.com/users/Etmolf/events{/privacy}","received_events_url":"https://api.github.com/users/Etmolf/received_events","type":"User","site_admin":false},"body":"Added most of the functionality for the mailing lists api\r\n\r\nIssue: #456 \r\n\r\nI could use some help with the tests...\r\n\r\nThis is my first contribution to github ever\r\nSo please do not be angry if something does not fit, i am open for advice","created_at":"2018-04-06T23:15:39Z","updated_at":"2018-04-08T16:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65fa05daf60656a0fd4f7e2f38bd781276c2cf11","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457/commits","review_comments_url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457/comments","review_comment_url":"https://api.github.com/repos/mailgun/mailgun-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mailgun/mailgun-php/issues/457/comments","statuses_url":"https://api.github.com/repos/mailgun/mailgun-php/statuses/2d576930f2375a3b712bbb103ffc2c718a66de5e","head":{"label":"Etmolf:master","ref":"master","sha":"2d576930f2375a3b712bbb103ffc2c718a66de5e","user":{"login":"Etmolf","id":4807403,"avatar_url":"https://avatars3.githubusercontent.com/u/4807403?v=4","gravatar_id":"","url":"https://api.github.com/users/Etmolf","html_url":"https://github.com/Etmolf","followers_url":"https://api.github.com/users/Etmolf/followers","following_url":"https://api.github.com/users/Etmolf/following{/other_user}","gists_url":"https://api.github.com/users/Etmolf/gists{/gist_id}","starred_url":"https://api.github.com/users/Etmolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Etmolf/subscriptions","organizations_url":"https://api.github.com/users/Etmolf/orgs","repos_url":"https://api.github.com/users/Etmolf/repos","events_url":"https://api.github.com/users/Etmolf/events{/privacy}","received_events_url":"https://api.github.com/users/Etmolf/received_events","type":"User","site_admin":false},"repo":{"id":128477969,"name":"mailgun-php","full_name":"Etmolf/mailgun-php","owner":{"login":"Etmolf","id":4807403,"avatar_url":"https://avatars3.githubusercontent.com/u/4807403?v=4","gravatar_id":"","url":"https://api.github.com/users/Etmolf","html_url":"https://github.com/Etmolf","followers_url":"https://api.github.com/users/Etmolf/followers","following_url":"https://api.github.com/users/Etmolf/following{/other_user}","gists_url":"https://api.github.com/users/Etmolf/gists{/gist_id}","starred_url":"https://api.github.com/users/Etmolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Etmolf/subscriptions","organizations_url":"https://api.github.com/users/Etmolf/orgs","repos_url":"https://api.github.com/users/Etmolf/repos","events_url":"https://api.github.com/users/Etmolf/events{/privacy}","received_events_url":"https://api.github.com/users/Etmolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Etmolf/mailgun-php","description":"Mailgun's Official SDK for PHP","fork":true,"url":"https://api.github.com/repos/Etmolf/mailgun-php","forks_url":"https://api.github.com/repos/Etmolf/mailgun-php/forks","keys_url":"https://api.github.com/repos/Etmolf/mailgun-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Etmolf/mailgun-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Etmolf/mailgun-php/teams","hooks_url":"https://api.github.com/repos/Etmolf/mailgun-php/hooks","issue_events_url":"https://api.github.com/repos/Etmolf/mailgun-php/issues/events{/number}","events_url":"https://api.github.com/repos/Etmolf/mailgun-php/events","assignees_url":"https://api.github.com/repos/Etmolf/mailgun-php/assignees{/user}","branches_url":"https://api.github.com/repos/Etmolf/mailgun-php/branches{/branch}","tags_url":"https://api.github.com/repos/Etmolf/mailgun-php/tags","blobs_url":"https://api.github.com/repos/Etmolf/mailgun-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Etmolf/mailgun-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Etmolf/mailgun-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/Etmolf/mailgun-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Etmolf/mailgun-php/statuses/{sha}","languages_url":"https://api.github.com/repos/Etmolf/mailgun-php/languages","stargazers_url":"https://api.github.com/repos/Etmolf/mailgun-php/stargazers","contributors_url":"https://api.github.com/repos/Etmolf/mailgun-php/contributors","subscribers_url":"https://api.github.com/repos/Etmolf/mailgun-php/subscribers","subscription_url":"https://api.github.com/repos/Etmolf/mailgun-php/subscription","commits_url":"https://api.github.com/repos/Etmolf/mailgun-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/Etmolf/mailgun-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/Etmolf/mailgun-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/Etmolf/mailgun-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/Etmolf/mailgun-php/contents/{+path}","compare_url":"https://api.github.com/repos/Etmolf/mailgun-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Etmolf/mailgun-php/merges","archive_url":"https://api.github.com/repos/Etmolf/mailgun-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Etmolf/mailgun-php/downloads","issues_url":"https://api.github.com/repos/Etmolf/mailgun-php/issues{/number}","pulls_url":"https://api.github.com/repos/Etmolf/mailgun-php/pulls{/number}","milestones_url":"https://api.github.com/repos/Etmolf/mailgun-php/milestones{/number}","notifications_url":"https://api.github.com/repos/Etmolf/mailgun-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Etmolf/mailgun-php/labels{/name}","releases_url":"https://api.github.com/repos/Etmolf/mailgun-php/releases{/id}","deployments_url":"https://api.github.com/repos/Etmolf/mailgun-php/deployments","created_at":"2018-04-06T22:53:55Z","updated_at":"2018-04-07T18:53:15Z","pushed_at":"2018-04-07T23:59:04Z","git_url":"git://github.com/Etmolf/mailgun-php.git","ssh_url":"git@github.com:Etmolf/mailgun-php.git","clone_url":"https://github.com/Etmolf/mailgun-php.git","svn_url":"https://github.com/Etmolf/mailgun-php","homepage":"http://www.mailgun.com","size":2628,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mailgun:master","ref":"master","sha":"ef3dc6b8bf78b1f760da16b6860c4072c798d286","user":{"login":"mailgun","id":447686,"avatar_url":"https://avatars3.githubusercontent.com/u/447686?v=4","gravatar_id":"","url":"https://api.github.com/users/mailgun","html_url":"https://github.com/mailgun","followers_url":"https://api.github.com/users/mailgun/followers","following_url":"https://api.github.com/users/mailgun/following{/other_user}","gists_url":"https://api.github.com/users/mailgun/gists{/gist_id}","starred_url":"https://api.github.com/users/mailgun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailgun/subscriptions","organizations_url":"https://api.github.com/users/mailgun/orgs","repos_url":"https://api.github.com/users/mailgun/repos","events_url":"https://api.github.com/users/mailgun/events{/privacy}","received_events_url":"https://api.github.com/users/mailgun/received_events","type":"Organization","site_admin":false},"repo":{"id":11654443,"name":"mailgun-php","full_name":"mailgun/mailgun-php","owner":{"login":"mailgun","id":447686,"avatar_url":"https://avatars3.githubusercontent.com/u/447686?v=4","gravatar_id":"","url":"https://api.github.com/users/mailgun","html_url":"https://github.com/mailgun","followers_url":"https://api.github.com/users/mailgun/followers","following_url":"https://api.github.com/users/mailgun/following{/other_user}","gists_url":"https://api.github.com/users/mailgun/gists{/gist_id}","starred_url":"https://api.github.com/users/mailgun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailgun/subscriptions","organizations_url":"https://api.github.com/users/mailgun/orgs","repos_url":"https://api.github.com/users/mailgun/repos","events_url":"https://api.github.com/users/mailgun/events{/privacy}","received_events_url":"https://api.github.com/users/mailgun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mailgun/mailgun-php","description":"Mailgun's Official SDK for PHP","fork":false,"url":"https://api.github.com/repos/mailgun/mailgun-php","forks_url":"https://api.github.com/repos/mailgun/mailgun-php/forks","keys_url":"https://api.github.com/repos/mailgun/mailgun-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mailgun/mailgun-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mailgun/mailgun-php/teams","hooks_url":"https://api.github.com/repos/mailgun/mailgun-php/hooks","issue_events_url":"https://api.github.com/repos/mailgun/mailgun-php/issues/events{/number}","events_url":"https://api.github.com/repos/mailgun/mailgun-php/events","assignees_url":"https://api.github.com/repos/mailgun/mailgun-php/assignees{/user}","branches_url":"https://api.github.com/repos/mailgun/mailgun-php/branches{/branch}","tags_url":"https://api.github.com/repos/mailgun/mailgun-php/tags","blobs_url":"https://api.github.com/repos/mailgun/mailgun-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mailgun/mailgun-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mailgun/mailgun-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/mailgun/mailgun-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mailgun/mailgun-php/statuses/{sha}","languages_url":"https://api.github.com/repos/mailgun/mailgun-php/languages","stargazers_url":"https://api.github.com/repos/mailgun/mailgun-php/stargazers","contributors_url":"https://api.github.com/repos/mailgun/mailgun-php/contributors","subscribers_url":"https://api.github.com/repos/mailgun/mailgun-php/subscribers","subscription_url":"https://api.github.com/repos/mailgun/mailgun-php/subscription","commits_url":"https://api.github.com/repos/mailgun/mailgun-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/mailgun/mailgun-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/mailgun/mailgun-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/mailgun/mailgun-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/mailgun/mailgun-php/contents/{+path}","compare_url":"https://api.github.com/repos/mailgun/mailgun-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mailgun/mailgun-php/merges","archive_url":"https://api.github.com/repos/mailgun/mailgun-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mailgun/mailgun-php/downloads","issues_url":"https://api.github.com/repos/mailgun/mailgun-php/issues{/number}","pulls_url":"https://api.github.com/repos/mailgun/mailgun-php/pulls{/number}","milestones_url":"https://api.github.com/repos/mailgun/mailgun-php/milestones{/number}","notifications_url":"https://api.github.com/repos/mailgun/mailgun-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mailgun/mailgun-php/labels{/name}","releases_url":"https://api.github.com/repos/mailgun/mailgun-php/releases{/id}","deployments_url":"https://api.github.com/repos/mailgun/mailgun-php/deployments","created_at":"2013-07-25T07:20:47Z","updated_at":"2018-04-08T10:40:17Z","pushed_at":"2018-04-08T11:42:25Z","git_url":"git://github.com/mailgun/mailgun-php.git","ssh_url":"git@github.com:mailgun/mailgun-php.git","clone_url":"https://github.com/mailgun/mailgun-php.git","svn_url":"https://github.com/mailgun/mailgun-php","homepage":"http://www.mailgun.com","size":2623,"stargazers_count":694,"watchers_count":694,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":200,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":200,"open_issues":59,"watchers":694,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457"},"html":{"href":"https://github.com/mailgun/mailgun-php/pull/457"},"issue":{"href":"https://api.github.com/repos/mailgun/mailgun-php/issues/457"},"comments":{"href":"https://api.github.com/repos/mailgun/mailgun-php/issues/457/comments"},"review_comments":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457/comments"},"review_comment":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mailgun/mailgun-php/pulls/457/commits"},"statuses":{"href":"https://api.github.com/repos/mailgun/mailgun-php/statuses/2d576930f2375a3b712bbb103ffc2c718a66de5e"}},"author_association":"NONE"}}
{"actor":{"display_login":"Etmolf"}}