"""Information API for version 1 of the Timesketch API."""

from flask import jsonify
from flask_restful import Resource
from flask_login import login_required

from timesketch import version
from timesketch.api.v1 import resources
from timesketch.lib.definitions import HTTP_STATUS_CODE_OK


class VersionResource(resources.ResourceMixin, Resource):
    """Resource to get Timesketch API version information."""

    @login_required
    def get(self):
        """Handles GET request to the resource.

        Returns:
            List of usernames
        """
        schema = {
            'meta': {
                'version': version.get_version()
            },
            'objects': []
        }
        response = jsonify(schema)
        response.status_code = HTTP_STATUS_CODE_OK
        return response

"""Information API for version 1 of the Timesketch API."""

from flask import jsonify
from flask_restful import Resource
from flask_login import login_required

from timesketch import version
from timesketch.api.v1 import resources
from timesketch.lib.definitions import HTTP_STATUS_CODE_OK


class VersionResource(resources.ResourceMixin, Resource):
    """Resource to get Timesketch API version information."""

    @login_required
    def get(self):
        """Handles GET request to the resource.

        Returns:
            JSON object including version info
        """
        schema = {
            'meta': {
                'version': version.get_version()
            },
            'objects': []
        }
        response = jsonify(schema)
        response.status_code = HTTP_STATUS_CODE_OK
        return response

Fix method docstring (copy paste error)
Fix method docstring (copy paste error)

Guess there was a copy paste error in this PR: https://github.com/google/timesketch/commit/64157452b7b8285ea928e4949434d46592791d47

As the method does not return user info.
  """Information API for version 1 of the Timesketch API."""
  
  from flask import jsonify
  from flask_restful import Resource
  from flask_login import login_required
  
  from timesketch import version
  from timesketch.api.v1 import resources
  from timesketch.lib.definitions import HTTP_STATUS_CODE_OK
  
  
  class VersionResource(resources.ResourceMixin, Resource):
      """Resource to get Timesketch API version information."""
  
      @login_required
      def get(self):
          """Handles GET request to the resource.
  
          Returns:
-             List of usernames
+             JSON object including version info
          """
          schema = {
              'meta': {
                  'version': version.get_version()
              },
              'objects': []
          }
          response = jsonify(schema)
          response.status_code = HTTP_STATUS_CODE_OK
          return response
  
Fix method docstring (copy paste error)
## Code Before:
"""Information API for version 1 of the Timesketch API."""

from flask import jsonify
from flask_restful import Resource
from flask_login import login_required

from timesketch import version
from timesketch.api.v1 import resources
from timesketch.lib.definitions import HTTP_STATUS_CODE_OK


class VersionResource(resources.ResourceMixin, Resource):
    """Resource to get Timesketch API version information."""

    @login_required
    def get(self):
        """Handles GET request to the resource.

        Returns:
            List of usernames
        """
        schema = {
            'meta': {
                'version': version.get_version()
            },
            'objects': []
        }
        response = jsonify(schema)
        response.status_code = HTTP_STATUS_CODE_OK
        return response

## Instruction:
Fix method docstring (copy paste error)
## Code After:
"""Information API for version 1 of the Timesketch API."""

from flask import jsonify
from flask_restful import Resource
from flask_login import login_required

from timesketch import version
from timesketch.api.v1 import resources
from timesketch.lib.definitions import HTTP_STATUS_CODE_OK


class VersionResource(resources.ResourceMixin, Resource):
    """Resource to get Timesketch API version information."""

    @login_required
    def get(self):
        """Handles GET request to the resource.

        Returns:
            JSON object including version info
        """
        schema = {
            'meta': {
                'version': version.get_version()
            },
            'objects': []
        }
        response = jsonify(schema)
        response.status_code = HTTP_STATUS_CODE_OK
        return response
