diff --git a/proto b/proto index 604eb11..15780ff 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 604eb11dc1ae1852b689337255dbef8ce0bc0a5a +Subproject commit 15780ff233532f66a82e43e952ec9354ac5dd79c diff --git a/src/client.rs b/src/client.rs index 38b5c85..c96ed78 100644 --- a/src/client.rs +++ b/src/client.rs @@ -492,7 +492,7 @@ impl BasinClient { pub async fn reconfigure_stream( &self, req: types::ReconfigureStreamRequest, - ) -> Result<(), ClientError> { + ) -> Result { self.inner .send(ReconfigureStreamServiceRequest::new( self.inner.basin_service_client(), diff --git a/src/service/basin.rs b/src/service/basin.rs index bc6577c..a0aa9a8 100644 --- a/src/service/basin.rs +++ b/src/service/basin.rs @@ -190,7 +190,7 @@ impl ReconfigureStreamServiceRequest { impl ServiceRequest for ReconfigureStreamServiceRequest { type ApiRequest = api::ReconfigureStreamRequest; - type Response = (); + type Response = types::StreamConfig; type ApiResponse = api::ReconfigureStreamResponse; const IDEMPOTENCY_LEVEL: IdempotencyLevel = IdempotencyLevel::IdempotencyUnknown; @@ -208,8 +208,8 @@ impl ServiceRequest for ReconfigureStreamServiceRequest { fn parse_response( &self, - _resp: tonic::Response, + resp: tonic::Response, ) -> Result { - Ok(()) + resp.into_inner().try_into() } } diff --git a/src/types.rs b/src/types.rs index 552116b..122ed6b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -696,6 +696,15 @@ impl From for api::ReconfigureBasinRequest { } } +impl TryFrom for BasinConfig { + type Error = ConvertError; + fn try_from(value: api::ReconfigureBasinResponse) -> Result { + let api::ReconfigureBasinResponse { config } = value; + let config = config.ok_or("missing basin config")?; + config.try_into() + } +} + #[sync_docs] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone)] @@ -744,11 +753,11 @@ impl From for api::ReconfigureStreamRequest { } } -impl TryFrom for BasinConfig { +impl TryFrom for StreamConfig { type Error = ConvertError; - fn try_from(value: api::ReconfigureBasinResponse) -> Result { - let api::ReconfigureBasinResponse { config } = value; - let config = config.ok_or("missing basin config")?; + fn try_from(value: api::ReconfigureStreamResponse) -> Result { + let api::ReconfigureStreamResponse { config } = value; + let config = config.ok_or("missing stream config")?; config.try_into() } }