def _BuildOobLink(self, param, mode):
    """Builds out-of-band URL.

    Gitkit API GetOobCode() is called and the returning code is combined
    with Gitkit widget URL to building the out-of-band url.

    Args:
      param: dict of request.
      mode: string, Gitkit widget mode to handle the oob action after user
          clicks the oob url in the email.

    Raises:
      GitkitClientError: if oob code is not returned.

    Returns:
      A string of oob url.
    """
    code = self.rpc_helper.GetOobCode(param)
    if code:
      parsed = list(parse.urlparse(self.widget_url))

      query = dict(parse.parse_qsl(parsed[4]))
      query.update({'mode': mode, 'oobCode': code})

      try:
        parsed[4] = parse.urlencode(query)
      except AttributeError:
        parsed[4] = urllib.urlencode(query)

      return code, parse.urlunparse(parsed)
    raise errors.GitkitClientError('invalid request')
Builds out-of-band URL.

    Gitkit API GetOobCode() is called and the returning code is combined
    with Gitkit widget URL to building the out-of-band url.

    Args:
      param: dict of request.
      mode: string, Gitkit widget mode to handle the oob action after user
          clicks the oob url in the email.

    Raises:
      GitkitClientError: if oob code is not returned.

    Returns:
      A string of oob url.