Factory:  construct a metric given its API representation

        :type resource: dict
        :param resource: metric resource representation returned from the API

        :type client: :class:`google.cloud.logging.client.Client`
        :param client: Client which holds credentials and project
                       configuration for the metric.

        :rtype: :class:`google.cloud.logging.metric.Metric`
        :returns: Metric parsed from ``resource``.

def from_api_repr(cls, resource, client):
        """Factory:  construct a metric given its API representation

        :type resource: dict
        :param resource: metric resource representation returned from the API

        :type client: :class:`google.cloud.logging.client.Client`
        :param client: Client which holds credentials and project
                       configuration for the metric.

        :rtype: :class:`google.cloud.logging.metric.Metric`
        :returns: Metric parsed from ``resource``.
        """
        metric_name = resource["name"]
        filter_ = resource["filter"]
        description = resource.get("description", "")
        return cls(metric_name, filter_, client=client, description=description)