# Path: firebase_admin/_http_client.py
#     _ANY_METHOD = {'allowed_methods': None}
#     _ANY_METHOD = {'method_whitelist': None}
# DEFAULT_RETRY_CONFIG = retry.Retry(
#     connect=1, read=1, status=4, status_forcelist=[500, 503],
#     raise_on_status=False, backoff_factor=0.5, **_ANY_METHOD)
# DEFAULT_TIMEOUT_SECONDS = 120
# class HttpClient:
# class JsonHttpClient(HttpClient):
#     def __init__(
#             self, credential=None, session=None, base_url='', headers=None,
#             retries=DEFAULT_RETRY_CONFIG, timeout=DEFAULT_TIMEOUT_SECONDS):
#     def session(self):
#     def base_url(self):
#     def timeout(self):
#     def parse_body(self, resp):
#     def request(self, method, url, **kwargs):
#     def headers(self, method, url, **kwargs):
#     def body_and_response(self, method, url, **kwargs):
#     def body(self, method, url, **kwargs):
#     def headers_and_body(self, method, url, **kwargs):
#     def close(self):
#     def __init__(self, **kwargs):
#     def parse_body(self, resp):
# 
# Path: firebase_admin/_utils.py
# _ERROR_CODE_TO_EXCEPTION_TYPE = {
#     exceptions.INVALID_ARGUMENT: exceptions.InvalidArgumentError,
#     exceptions.FAILED_PRECONDITION: exceptions.FailedPreconditionError,
#     exceptions.OUT_OF_RANGE: exceptions.OutOfRangeError,
#     exceptions.UNAUTHENTICATED: exceptions.UnauthenticatedError,
#     exceptions.PERMISSION_DENIED: exceptions.PermissionDeniedError,
#     exceptions.NOT_FOUND: exceptions.NotFoundError,
#     exceptions.ABORTED: exceptions.AbortedError,
#     exceptions.ALREADY_EXISTS: exceptions.AlreadyExistsError,
#     exceptions.CONFLICT: exceptions.ConflictError,
#     exceptions.RESOURCE_EXHAUSTED: exceptions.ResourceExhaustedError,
#     exceptions.CANCELLED: exceptions.CancelledError,
#     exceptions.DATA_LOSS: exceptions.DataLossError,
#     exceptions.UNKNOWN: exceptions.UnknownError,
#     exceptions.INTERNAL: exceptions.InternalError,
#     exceptions.UNAVAILABLE: exceptions.UnavailableError,
#     exceptions.DEADLINE_EXCEEDED: exceptions.DeadlineExceededError,
# }
# _HTTP_STATUS_TO_ERROR_CODE = {
#     400: exceptions.INVALID_ARGUMENT,
#     401: exceptions.UNAUTHENTICATED,
#     403: exceptions.PERMISSION_DENIED,
#     404: exceptions.NOT_FOUND,
#     409: exceptions.CONFLICT,
#     412: exceptions.FAILED_PRECONDITION,
#     429: exceptions.RESOURCE_EXHAUSTED,
#     500: exceptions.INTERNAL,
#     503: exceptions.UNAVAILABLE,
# }
# _RPC_CODE_TO_ERROR_CODE = {
#     1: exceptions.CANCELLED,
#     2: exceptions.UNKNOWN,
#     3: exceptions.INVALID_ARGUMENT,
#     4: exceptions.DEADLINE_EXCEEDED,
#     5: exceptions.NOT_FOUND,
#     6: exceptions.ALREADY_EXISTS,
#     7: exceptions.PERMISSION_DENIED,
#     8: exceptions.RESOURCE_EXHAUSTED,
#     9: exceptions.FAILED_PRECONDITION,
#     10: exceptions.ABORTED,
#     11: exceptions.OUT_OF_RANGE,
#     13: exceptions.INTERNAL,
#     14: exceptions.UNAVAILABLE,
#     15: exceptions.DATA_LOSS,
#     16: exceptions.UNAUTHENTICATED,
# }
# def _get_initialized_app(app):
# def get_app_service(app, name, initializer):
# def handle_platform_error_from_requests(error, handle_func=None):
# def handle_operation_error(error):
# def _handle_func_requests(error, message, error_dict):
# def handle_requests_error(error, message=None, code=None):
# def _http_status_to_error_code(status):
# def _rpc_code_to_error_code(rpc_code):
# def _error_code_to_exception_type(code):
# def _parse_platform_error(content, status_code):
#     def __init__(self):
#     def refresh(self, request):
# class EmulatorAdminCredentials(google.auth.credentials.Credentials):


import requests
from firebase_admin import _http_client
from firebase_admin import _utils
        400: 'Malformed instance ID argument.',
        401: 'Request not authorized.',
        403: 'Project does not match instance ID or the client does not have '
             'sufficient privileges.',
        404: 'Failed to find the instance ID.',
        409: 'Already deleted.',
        429: 'Request throttled out by the backend server.',
        500: 'Internal server error.',
        503: 'Backend servers are over capacity. Try again later.'
    }

    def __init__(self, app):
        project_id = app.project_id
        if not project_id:
            raise ValueError(
                'Project ID is required to access Instance ID service. Either set the projectId '
                'option, or use service account credentials. Alternatively, set the '
                'GOOGLE_CLOUD_PROJECT environment variable.')
        self._project_id = project_id
        self._client = _http_client.JsonHttpClient(
            credential=app.credential.get_credential(), base_url=_IID_SERVICE_URL)

    def delete_instance_id(self, instance_id):
        if not isinstance(instance_id, str) or not instance_id:
            raise ValueError('Instance ID must be a non-empty string.')
        path = 'project/{0}/instanceId/{1}'.format(self._project_id, instance_id)
        try:
            self._client.request('delete', path)
        except requests.exceptions.RequestException as error:
            msg = self._extract_message(instance_id, error)

# Path: firebase_admin/_http_client.py
#     _ANY_METHOD = {'allowed_methods': None}
#     _ANY_METHOD = {'method_whitelist': None}
# DEFAULT_RETRY_CONFIG = retry.Retry(
#     connect=1, read=1, status=4, status_forcelist=[500, 503],
#     raise_on_status=False, backoff_factor=0.5, **_ANY_METHOD)
# DEFAULT_TIMEOUT_SECONDS = 120
# class HttpClient:
# class JsonHttpClient(HttpClient):
#     def __init__(
#             self, credential=None, session=None, base_url='', headers=None,
#             retries=DEFAULT_RETRY_CONFIG, timeout=DEFAULT_TIMEOUT_SECONDS):
#     def session(self):
#     def base_url(self):
#     def timeout(self):
#     def parse_body(self, resp):
#     def request(self, method, url, **kwargs):
#     def headers(self, method, url, **kwargs):
#     def body_and_response(self, method, url, **kwargs):
#     def body(self, method, url, **kwargs):
#     def headers_and_body(self, method, url, **kwargs):
#     def close(self):
#     def __init__(self, **kwargs):
#     def parse_body(self, resp):
# 
# Path: firebase_admin/_utils.py
# _ERROR_CODE_TO_EXCEPTION_TYPE = {
#     exceptions.INVALID_ARGUMENT: exceptions.InvalidArgumentError,
#     exceptions.FAILED_PRECONDITION: exceptions.FailedPreconditionError,
#     exceptions.OUT_OF_RANGE: exceptions.OutOfRangeError,
#     exceptions.UNAUTHENTICATED: exceptions.UnauthenticatedError,
#     exceptions.PERMISSION_DENIED: exceptions.PermissionDeniedError,
#     exceptions.NOT_FOUND: exceptions.NotFoundError,
#     exceptions.ABORTED: exceptions.AbortedError,
#     exceptions.ALREADY_EXISTS: exceptions.AlreadyExistsError,
#     exceptions.CONFLICT: exceptions.ConflictError,
#     exceptions.RESOURCE_EXHAUSTED: exceptions.ResourceExhaustedError,
#     exceptions.CANCELLED: exceptions.CancelledError,
#     exceptions.DATA_LOSS: exceptions.DataLossError,
#     exceptions.UNKNOWN: exceptions.UnknownError,
#     exceptions.INTERNAL: exceptions.InternalError,
#     exceptions.UNAVAILABLE: exceptions.UnavailableError,
#     exceptions.DEADLINE_EXCEEDED: exceptions.DeadlineExceededError,
# }
# _HTTP_STATUS_TO_ERROR_CODE = {
#     400: exceptions.INVALID_ARGUMENT,
#     401: exceptions.UNAUTHENTICATED,
#     403: exceptions.PERMISSION_DENIED,
#     404: exceptions.NOT_FOUND,
#     409: exceptions.CONFLICT,
#     412: exceptions.FAILED_PRECONDITION,
#     429: exceptions.RESOURCE_EXHAUSTED,
#     500: exceptions.INTERNAL,
#     503: exceptions.UNAVAILABLE,
# }
# _RPC_CODE_TO_ERROR_CODE = {
#     1: exceptions.CANCELLED,
#     2: exceptions.UNKNOWN,
#     3: exceptions.INVALID_ARGUMENT,
#     4: exceptions.DEADLINE_EXCEEDED,
#     5: exceptions.NOT_FOUND,
#     6: exceptions.ALREADY_EXISTS,
#     7: exceptions.PERMISSION_DENIED,
#     8: exceptions.RESOURCE_EXHAUSTED,
#     9: exceptions.FAILED_PRECONDITION,
#     10: exceptions.ABORTED,
#     11: exceptions.OUT_OF_RANGE,
#     13: exceptions.INTERNAL,
#     14: exceptions.UNAVAILABLE,
#     15: exceptions.DATA_LOSS,
#     16: exceptions.UNAUTHENTICATED,
# }
# def _get_initialized_app(app):
# def get_app_service(app, name, initializer):
# def handle_platform_error_from_requests(error, handle_func=None):
# def handle_operation_error(error):
# def _handle_func_requests(error, message, error_dict):
# def handle_requests_error(error, message=None, code=None):
# def _http_status_to_error_code(status):
# def _rpc_code_to_error_code(rpc_code):
# def _error_code_to_exception_type(code):
# def _parse_platform_error(content, status_code):
#     def __init__(self):
#     def refresh(self, request):
# class EmulatorAdminCredentials(google.auth.credentials.Credentials):


# Path: firebase_admin/instance_id.py
import requests
from firebase_admin import _http_client
from firebase_admin import _utils

        400: 'Malformed instance ID argument.',
        401: 'Request not authorized.',
        403: 'Project does not match instance ID or the client does not have '
             'sufficient privileges.',
        404: 'Failed to find the instance ID.',
        409: 'Already deleted.',
        429: 'Request throttled out by the backend server.',
        500: 'Internal server error.',
        503: 'Backend servers are over capacity. Try again later.'
    }

    def __init__(self, app):
        project_id = app.project_id
        if not project_id:
            raise ValueError(
                'Project ID is required to access Instance ID service. Either set the projectId '
                'option, or use service account credentials. Alternatively, set the '
                'GOOGLE_CLOUD_PROJECT environment variable.')
        self._project_id = project_id
        self._client = _http_client.JsonHttpClient(
            credential=app.credential.get_credential(), base_url=_IID_SERVICE_URL)

    def delete_instance_id(self, instance_id):
        if not isinstance(instance_id, str) or not instance_id:
            raise ValueError('Instance ID must be a non-empty string.')
        path = 'project/{0}/instanceId/{1}'.format(self._project_id, instance_id)
        try:
            self._client.request('delete', path)
        except requests.exceptions.RequestException as error:
            msg = self._extract_message(instance_id, error)

            raise _utils.handle_requests_error(error, msg)