Exemple #1
0
def make_metrics_api(client):
    """Create an instance of the Metrics API adapter.

    Args:
        client (~logging_v2.client.Client): The client
            that holds configuration details.

    Returns:
        _MetricsAPI: A metrics API instance with the proper credentials.
    """
    generated = MetricsServiceV2Client(
        credentials=client._credentials,
        client_info=client._client_info,
        client_options=client._client_options,
    )
    return _MetricsAPI(generated, client)
 def test_ctor(self):
     gapic_client = MetricsServiceV2Client()
     api = _gapic._MetricsAPI(gapic_client, mock.sentinel.client)
     assert api._gapic_api is gapic_client
     assert api._client is mock.sentinel.client
 def make_metrics_api():
     gapic_client = MetricsServiceV2Client()
     handwritten_client = mock.Mock()
     api = _gapic._MetricsAPI(gapic_client, handwritten_client)
     return api