I need help with a door animation

So i have 2 door and 2 animation 1 animation is door goes up and 2nd animation door goes down similar like to fnaf and i want to make a code or something that when i click a key door can close and open with animation

this i door code that i use:

using UnityEngine;
public class Door : MonoBehaviour
{

public GameObject DoorLeft;
public GameObject DoorRight;

void Start()
{
    DoorLeft.SetActive(false);
    DoorRight.SetActive(false);
}

void Update()
{
    //All we're doing is toggling the doors. If they're active, we deactivate them; if they're inactive, we activate them

    if (Input.GetKeyDown(KeyCode.A))
    {
        DoorLeft.SetActive(!DoorLeft.activeSelf);
    }
    else if (Input.GetKeyDown(KeyCode.D))
    {
        DoorRight.SetActive(!DoorRight.activeSelf);
    }
}

}

I would try to encapsulate all door behavior (animations, components accessibility) inside the door class itself and work only with exposed methods.

public class DoorsManager : MonoBehaviour 
{
     [SerializeField] private Door leftDoor;
     [SerializeField] private Door rightDoor;
    
     private bool _doorToggle;
    
     private void Start()
     {
          leftDoor.SetOpen(false);
          rightDoor.SetOpen(false);
          _doorToggle = false;
     }
    
     private void Update()
     {
          if (Input.GetKeyDown(KeyCode.A))
          {
                _doorToggle = true;
                SetDoorsState(_doorToggle);
          }
            
          if (Input.GetKeyDown(KeyCode.D))
          {
                _doorToggle = false;
                SetDoorsState(_doorToggle);
          }
     }
    
     private void SetDoorsState(bool b)
     {
          leftDoor.SetOpen(b);
          rightDoor.SetOpen(!b);
     }
}

i get to many errors

Like that

private void SetDoorsState(bool b)
{
leftDoor.SetOpen(b);
rightDoor.SetOpen(!b);
}
}