
URLS = {
}


class Documentation(object):
    """ This class provide documentation-related methods
    Documentation related REST endpoints:
    https://gerrit-review.googlesource.com/Documentation/rest-api-documentation.html
    """

    def __init__(self, gerrit):
        self.gerrit = gerrit
        self.gerrit.URLS.update(URLS)


URLS = {
    'SEARCH': 'Documentation/?q=%(keyword)s',
}


class Documentation(object):
    """ This class provide documentation-related methods
    Documentation related REST endpoints:
    https://gerrit-review.googlesource.com/Documentation/rest-api-documentation.html
    """

    def __init__(self, gerrit):
        self.gerrit = gerrit
        self.gerrit.URLS.update(URLS)

    def search(self, keyword):
        url = self.gerrit.url('SEARCH', keyword=keyword)
        r = Request(method='GET', url=url, auth=self.gerrit.auth)
        return self.gerrit.dispatch(r)

Add methods for Documentation Endpoints
Add methods for Documentation Endpoints

Signed-off-by: Huang Yaming <ce2ec9fa26f071590d1a68b9e7447b51f2c76084@gmail.com>

  
  URLS = {
+     'SEARCH': 'Documentation/?q=%(keyword)s',
  }
  
  
  class Documentation(object):
      """ This class provide documentation-related methods
      Documentation related REST endpoints:
      https://gerrit-review.googlesource.com/Documentation/rest-api-documentation.html
      """
  
      def __init__(self, gerrit):
          self.gerrit = gerrit
          self.gerrit.URLS.update(URLS)
  
+     def search(self, keyword):
+         url = self.gerrit.url('SEARCH', keyword=keyword)
+         r = Request(method='GET', url=url, auth=self.gerrit.auth)
+         return self.gerrit.dispatch(r)
+ 
Add methods for Documentation Endpoints
## Code Before:

URLS = {
}


class Documentation(object):
    """ This class provide documentation-related methods
    Documentation related REST endpoints:
    https://gerrit-review.googlesource.com/Documentation/rest-api-documentation.html
    """

    def __init__(self, gerrit):
        self.gerrit = gerrit
        self.gerrit.URLS.update(URLS)

## Instruction:
Add methods for Documentation Endpoints
## Code After:

URLS = {
    'SEARCH': 'Documentation/?q=%(keyword)s',
}


class Documentation(object):
    """ This class provide documentation-related methods
    Documentation related REST endpoints:
    https://gerrit-review.googlesource.com/Documentation/rest-api-documentation.html
    """

    def __init__(self, gerrit):
        self.gerrit = gerrit
        self.gerrit.URLS.update(URLS)

    def search(self, keyword):
        url = self.gerrit.url('SEARCH', keyword=keyword)
        r = Request(method='GET', url=url, auth=self.gerrit.auth)
        return self.gerrit.dispatch(r)
