Repository: PrefectHQ/prefect

Issue:
The method read_flow_by_name missing additional fields error
### Describe the bug

I am having problems with the ```read_flow_by_name``` method.  I have verified that flow and deployment both exist and are pointing to the correct prefect profile (local in this case).  Also note that the non-name version of the method (using flow ID) is indeed working.

### To Reproduce

```python
from prefect.client import get_client
import asyncio
import json

async def main():
    async with get_client() as client:
            data = await client.read_flow_by_name(flow_name='test_flow')

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```

### Error
```
  File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for Deployment
flow_id
  field required (type=value_error.missing)
manifest_path
  field required (type=value_error.missing) 
```

```
# Copy complete stack trace and error message here, including log output if applicable.

Traceback (most recent call last):
  File 
    data = await client.read_flow_by_name(flow_name='test_flow')
 /.venv/lib/python3.9/site-packages/prefect/client.py", line 508, in read_flow_by_name
    return schemas.core.Deployment.parse_obj(response.json())
  File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for Deployment
flow_id
  field required (type=value_error.missing)
manifest_path
  field required (type=value_error.missing) 
```

### Versions

- OS: Mac 11.6
- Python: 3.9.13
- Prefect: 2.0.2


### Additional context

_No response_


Discussion:
Issue is also described on slack:
https://prefect-community.slack.com/archives/CL09KU1K7/p1659510452125109


Resolving patch:
diff --git a/src/prefect/client.py b/src/prefect/client.py
--- a/src/prefect/client.py
+++ b/src/prefect/client.py
@@ -505,7 +505,7 @@ async def read_flow_by_name(
             a fully hydrated [Flow model][prefect.orion.schemas.core.Flow]
         """
         response = await self._client.get(f"/flows/name/{flow_name}")
-        return schemas.core.Deployment.parse_obj(response.json())
+        return schemas.core.Flow.parse_obj(response.json())
 
     async def create_flow_run_from_deployment(
         self,


Test patch:
diff --git a/tests/test_client.py b/tests/test_client.py
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -845,6 +845,17 @@ def foobar():
     assert {flow.id for flow in flows} == {flow_id_1, flow_id_2}
 
 
+async def test_read_flow_by_name(orion_client):
+    @flow(name="null-flow")
+    def do_nothing():
+        pass
+
+    flow_id = await orion_client.create_flow(do_nothing)
+    the_flow = await orion_client.read_flow_by_name("null-flow")
+
+    assert the_flow.id == flow_id
+
+
 async def test_create_flow_run_from_deployment(orion_client, deployment):
     flow_run = await orion_client.create_flow_run_from_deployment(deployment.id)
     # Deployment details attached