# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


import base64
import json
import logging
import os
from ._backendbase import _BackendBase
from .exceptions import BugzillaError
from ._util import listify
                params=authparams)
        return self._handle_response(response.text)

    def _get(self, *args, **kwargs):
        return self._op("GET", *args, **kwargs)
    def _put(self, *args, **kwargs):
        return self._op("PUT", *args, **kwargs)
    def _post(self, *args, **kwargs):
        return self._op("POST", *args, **kwargs)


    #######################
    # API implementations #
    #######################

    def get_xmlrpc_proxy(self):
        raise BugzillaError("You are using the bugzilla REST API, "
                "so raw XMLRPC access is not provided.")
    def is_rest(self):
        return True

    def bugzilla_version(self):
        return self._get("/version")

    def bug_create(self, paramdict):
        return self._post("/bug", paramdict)
    def bug_fields(self, paramdict):
        return self._get("/field/bug", paramdict)
    def bug_get(self, bug_ids, aliases, paramdict):
        data = paramdict.copy()

# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


# Path: bugzilla/_backendrest.py
import base64
import json
import logging
import os
from ._backendbase import _BackendBase
from .exceptions import BugzillaError
from ._util import listify

                params=authparams)
        return self._handle_response(response.text)

    def _get(self, *args, **kwargs):
        return self._op("GET", *args, **kwargs)
    def _put(self, *args, **kwargs):
        return self._op("PUT", *args, **kwargs)
    def _post(self, *args, **kwargs):
        return self._op("POST", *args, **kwargs)


    #######################
    # API implementations #
    #######################

    def get_xmlrpc_proxy(self):
        raise BugzillaError("You are using the bugzilla REST API, "
                "so raw XMLRPC access is not provided.")
    def is_rest(self):
        return True

    def bugzilla_version(self):
        return self._get("/version")

    def bug_create(self, paramdict):
        return self._post("/bug", paramdict)
    def bug_fields(self, paramdict):
        return self._get("/field/bug", paramdict)
    def bug_get(self, bug_ids, aliases, paramdict):
        data = paramdict.copy()

        data["id"] = listify(bug_ids)