import base64


def consume_event_notification(event, unused_context):
    """
    consume_event_notification demonstrates how to consume and process a
    Pub/Sub notification from Secret Manager.
    Args:
          event (dict): Event payload.
          unused_context (google.cloud.functions.Context): Metadata for the event.
    """
    event_type = event['attributes']['eventType']
    secret_id = event['attributes']['secretId']
    secret_metadata = base64.b64decode(event['data']).decode('utf-8')
    return f'Received {event_type} for {secret_id}. New metadata: {secret_metadata}'