# Path: google/cloud/error_reporting/client.py
# class HTTPContext(object):
#     """HTTPContext defines an object that captures the parameter for the
#     httpRequest part of Error Reporting API
# 
#     :type method: str
#     :param method: The type of HTTP request, such as GET, POST, etc.
# 
#     :type url: str
#     :param url: The URL of the request
# 
#     :type user_agent: str
#     :param user_agent: The user agent information that is provided with the
#                        request.
# 
#     :type referrer: str
#     :param referrer: The referrer information that is provided with the
#                      request.
# 
#     :type response_status_code: int
#     :param response_status_code: The HTTP response status code for the request.
# 
#     :type remote_ip: str
#     :param remote_ip: The IP address from which the request originated. This
#                       can be IPv4, IPv6, or a token which is derived from
#                       the IP address, depending on the data that has been
#                       provided in the error report.
#     """
# 
#     def __init__(
#         self,
#         method=None,
#         url=None,
#         user_agent=None,
#         referrer=None,
#         response_status_code=None,
#         remote_ip=None,
#     ):
#         self.method = method
#         self.url = url
#         # intentionally camel case for mapping to JSON API expects
#         # pylint: disable=invalid-name
#         self.userAgent = user_agent
#         self.referrer = referrer
#         self.responseStatusCode = response_status_code
#         self.remoteIp = remote_ip


from google.cloud.error_reporting.client import HTTPContext
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Utility functions for Error Reporting."""



def build_flask_context(request):
    """Builds an HTTP context object from a Flask (Werkzeug) request object.

     This helper method extracts the relevant HTTP context from a Flask request
     object into an object ready to be sent to Error Reporting.

    .. code-block:: python

        >>> @app.errorhandler(HTTPException)
        ... def handle_error(exc):
        ...     client.report_exception(
        ...         http_context=build_flask_context(request))
        ...     # rest of error response code here

    :type request: :class:`werkzeug.wrappers.request`
    :param request: The Flask request object to convert.

    :rtype: :class:`~google.cloud.error_reporting.client.HTTPContext`
    :returns: An HTTPContext object ready to be sent to the Error Reporting
              API.
    """

# Path: google/cloud/error_reporting/client.py
# class HTTPContext(object):
#     """HTTPContext defines an object that captures the parameter for the
#     httpRequest part of Error Reporting API
# 
#     :type method: str
#     :param method: The type of HTTP request, such as GET, POST, etc.
# 
#     :type url: str
#     :param url: The URL of the request
# 
#     :type user_agent: str
#     :param user_agent: The user agent information that is provided with the
#                        request.
# 
#     :type referrer: str
#     :param referrer: The referrer information that is provided with the
#                      request.
# 
#     :type response_status_code: int
#     :param response_status_code: The HTTP response status code for the request.
# 
#     :type remote_ip: str
#     :param remote_ip: The IP address from which the request originated. This
#                       can be IPv4, IPv6, or a token which is derived from
#                       the IP address, depending on the data that has been
#                       provided in the error report.
#     """
# 
#     def __init__(
#         self,
#         method=None,
#         url=None,
#         user_agent=None,
#         referrer=None,
#         response_status_code=None,
#         remote_ip=None,
#     ):
#         self.method = method
#         self.url = url
#         # intentionally camel case for mapping to JSON API expects
#         # pylint: disable=invalid-name
#         self.userAgent = user_agent
#         self.referrer = referrer
#         self.responseStatusCode = response_status_code
#         self.remoteIp = remote_ip


# Path: google/cloud/error_reporting/util.py
from google.cloud.error_reporting.client import HTTPContext

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Utility functions for Error Reporting."""



def build_flask_context(request):
    """Builds an HTTP context object from a Flask (Werkzeug) request object.

     This helper method extracts the relevant HTTP context from a Flask request
     object into an object ready to be sent to Error Reporting.

    .. code-block:: python

        >>> @app.errorhandler(HTTPException)
        ... def handle_error(exc):
        ...     client.report_exception(
        ...         http_context=build_flask_context(request))
        ...     # rest of error response code here

    :type request: :class:`werkzeug.wrappers.request`
    :param request: The Flask request object to convert.

    :rtype: :class:`~google.cloud.error_reporting.client.HTTPContext`
    :returns: An HTTPContext object ready to be sent to the Error Reporting
              API.
    """

    return HTTPContext(