google-cloud-datastream-v1 1.8.0

Google Cloud Client Libraries for Rust - Datastream API
Documentation
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [Datastream](super::stub::Datastream) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Datastream<T>
where
    T: super::stub::Datastream + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Datastream<T>
where
    T: super::stub::Datastream + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Datastream for Datastream<T>
where
    T: super::stub::Datastream + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_connection_profiles(
        &self,
        req: crate::model::ListConnectionProfilesRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListConnectionProfilesResponse>> {
        self.inner.list_connection_profiles(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_connection_profile(
        &self,
        req: crate::model::GetConnectionProfileRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ConnectionProfile>> {
        self.inner.get_connection_profile(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_connection_profile(
        &self,
        req: crate::model::CreateConnectionProfileRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.create_connection_profile(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_connection_profile(
        &self,
        req: crate::model::UpdateConnectionProfileRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.update_connection_profile(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_connection_profile(
        &self,
        req: crate::model::DeleteConnectionProfileRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.delete_connection_profile(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn discover_connection_profile(
        &self,
        req: crate::model::DiscoverConnectionProfileRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::DiscoverConnectionProfileResponse>> {
        self.inner.discover_connection_profile(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_streams(
        &self,
        req: crate::model::ListStreamsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListStreamsResponse>> {
        self.inner.list_streams(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_stream(
        &self,
        req: crate::model::GetStreamRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Stream>> {
        self.inner.get_stream(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_stream(
        &self,
        req: crate::model::CreateStreamRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.create_stream(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_stream(
        &self,
        req: crate::model::UpdateStreamRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.update_stream(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_stream(
        &self,
        req: crate::model::DeleteStreamRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.delete_stream(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn run_stream(
        &self,
        req: crate::model::RunStreamRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.run_stream(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_stream_object(
        &self,
        req: crate::model::GetStreamObjectRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::StreamObject>> {
        self.inner.get_stream_object(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn lookup_stream_object(
        &self,
        req: crate::model::LookupStreamObjectRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::StreamObject>> {
        self.inner.lookup_stream_object(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_stream_objects(
        &self,
        req: crate::model::ListStreamObjectsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListStreamObjectsResponse>> {
        self.inner.list_stream_objects(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn start_backfill_job(
        &self,
        req: crate::model::StartBackfillJobRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::StartBackfillJobResponse>> {
        self.inner.start_backfill_job(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn stop_backfill_job(
        &self,
        req: crate::model::StopBackfillJobRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::StopBackfillJobResponse>> {
        self.inner.stop_backfill_job(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn fetch_static_ips(
        &self,
        req: crate::model::FetchStaticIpsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::FetchStaticIpsResponse>> {
        self.inner.fetch_static_ips(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_private_connection(
        &self,
        req: crate::model::CreatePrivateConnectionRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.create_private_connection(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_private_connection(
        &self,
        req: crate::model::GetPrivateConnectionRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::PrivateConnection>> {
        self.inner.get_private_connection(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_private_connections(
        &self,
        req: crate::model::ListPrivateConnectionsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListPrivateConnectionsResponse>> {
        self.inner.list_private_connections(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_private_connection(
        &self,
        req: crate::model::DeletePrivateConnectionRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.delete_private_connection(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_route(
        &self,
        req: crate::model::CreateRouteRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.create_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_route(
        &self,
        req: crate::model::GetRouteRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::Route>> {
        self.inner.get_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_routes(
        &self,
        req: crate::model::ListRoutesRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<crate::model::ListRoutesResponse>> {
        self.inner.list_routes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_route(
        &self,
        req: crate::model::DeleteRouteRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.delete_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: google_cloud_location::model::ListLocationsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: google_cloud_location::model::GetLocationRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: google_cloud_longrunning::model::ListOperationsRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: google_cloud_longrunning::model::GetOperationRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<google_cloud_longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: google_cloud_longrunning::model::DeleteOperationRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: google_cloud_longrunning::model::CancelOperationRequest,
        options: crate::RequestOptions,
    ) -> Result<crate::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &crate::RequestOptions,
    ) -> std::sync::Arc<dyn google_cloud_gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}