def METHOD_NAME(cmd,
                  snapshot_name,
                  name=None,
                  fields=None,
                  connection_string=None,
                  auth_mode='key',
                  endpoint=None):
    query_fields = []
    if fields:
        for field in fields:
            if field == SnapshotQueryFields.ALL:
                query_fields.clear()
                break
            query_fields.append(field.name.lower())
    client = _get_snapshot_client(cmd, name, connection_string, auth_mode, endpoint)
    try:
        snapshot = client.get_snapshot(snapshot_name, fields=query_fields)
    except HttpResponseError as exception:
        if exception.status_code == StatusCodes.NOT_FOUND:
            raise ResourceNotFoundError("No snapshot with name '{}' was found.".format(snapshot_name))
        raise AzureResponseError(str(exception))
    except Exception as exception:
        raise CLIError("Request failed. {}".format(str(exception)))
    if not query_fields:
        return snapshot
    partial_snapshot = {}
    for field in query_fields:
        partial_snapshot[field] = snapshot.__dict__[field]
    return partial_snapshot