API call:  test for the existence of the metric via a GET request

        See
        https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get

        :type client: :class:`~google.cloud.logging.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current metric.

        :rtype: bool
        :returns: Boolean indicating existence of the metric.

def exists(self, client=None):
        """API call:  test for the existence of the metric via a GET request

        See
        https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get

        :type client: :class:`~google.cloud.logging.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current metric.

        :rtype: bool
        :returns: Boolean indicating existence of the metric.
        """
        client = self._require_client(client)

        try:
            client.metrics_api.metric_get(self.project, self.name)
        except NotFound:
            return False
        else:
            return True