Create a milestone for a repository.

@link https://developer.github.com/v3/issues/milestones/#create-a-milestone

@param string $username
@param string $repository
@param array  $params

@throws \Github\Exception\MissingArgumentException

@return array
492247
public function create($username, $repository, array $params)
    {
        if (!isset($params['title'])) {
            throw new MissingArgumentException('title');
        }
        if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) {
            $params['state'] = 'open';
        }

        return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', $params);
    }
56992
public function permission($username, $repository, $collaborator)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator).'/permission');
    }
261836
public function labels($username, $repository, $id)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.rawurlencode($id).'/labels');
    }
733361
public function topics($username, $repository)
    {
        //This api is in preview mode, so set the correct accept-header
        $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json';

        return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/topics');
    }
77428
public function replace($username, $repository, $issue, array $params)
    {
        return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels', $params);
    }
1335881
public function show(string $milestone, array $params = [])
    {
        $path = $this->buildMilestonesPath($milestone);

        return $this->get($path, $params);
    }
783273
public function update($username, $repository, $label, $newName, $color)
    {
        $params = [
            'name'  => $newName,
            'color' => $color,
        ];

        return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params);
    }
280097
public function unlock($username, $repository, $id)
    {
        return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($id).'/lock');
    }
208545
public function createWriterWithProjectAsync($writerId, $pid, $username, $password, $params = [])
    {
        $params['writerId'] = $writerId;
        $params['pid'] = $pid;
        $params['username'] = $username;
        $params['password'] = $password;

        return $this->getCommand('CreateWriterWithProject', $params)->execute();
    }
1136709
public function check($username, $repository, $assignee)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees/'.rawurlencode($assignee));
    }
265118
public function setUsername(string $username): void
	{
		if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
			throw new InvalidArgumentException('Username contains invalid characters');
		}

		/* @var $repository UsersRepository */
		$repository = $this->getRepository();
		$user = $repository->getByUsername($username);
		if ($user !== null && $user !== $this) {
			throw new UniqueConstraintViolationException("Username '$username' exists");
		}
		$this->username = $username;
	}
896860
def update(user_name, repo_name, milestone_id, params={})
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      _validate_presence_of milestone_id

      normalize! params
      filter! VALID_MILESTONE_INPUTS, params
      assert_required_keys(%w[ name ], params)

      put_request("/1.0/repositories/#{user}/#{repo.downcase}/issues/milestones/#{milestone_id}", params)
    end
547023
public function milestones(array $parameters = [])
    {
        $data = $this->client->milestones()->all($this->id, $parameters);

        $milestones = array();
        foreach ($data as $milestone) {
            $milestones[] = Milestone::fromArray($this->getClient(), $this, $milestone);
        }

        return $milestones;
    }
227421
public function create(Step $step, User $user = null, $status = null, $authorized = false, $checkDuplicate = true)
    {
        // Check if progression already exists, if so return retrieved progression
        if ($checkDuplicate && $user instanceof User) {
            /** @var UserProgression $progression */
            $progression = $this->om->getRepository('InnovaPathBundle:UserProgression')->findOneBy([
                'step' => $step,
                'user' => $user,
            ]);

            if (!empty($progression)) {
                return $progression;
            }
        }

        $progression = new UserProgression();

        $progression->setStep($step);

        if (empty($status)) {
            $status = UserProgression::getDefaultStatus();
        }

        $progression->setStatus($status);
        $progression->setAuthorized($authorized);

        if ($user instanceof User) {
            $progression->setUser($user);
            $this->om->persist($progression);
            $this->om->flush();
        }

        return $progression;
    }
756161
def get_milestone(self, number):
        
        assert isinstance(number, (int, long)), number
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/milestones/" + str(number)
        )
        return github.Milestone.Milestone(self._requester, headers, data, completed=True)
1326543
public function show($username, $repository, $label)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label));
    }
678698
public function all($username, $repository, $issue)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/timeline');
    }