// This file is @generated by prost-build.
/// Diagnostic represents a warning or error message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Diagnostic {
    #[prost(enumeration = "diagnostic::Severity", tag = "1")]
    pub severity: i32,
    #[prost(string, tag = "2")]
    pub summary: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub detail: ::prost::alloc::string::String,
    /// Attribute path where the issue occurred
    #[prost(string, tag = "4")]
    pub attribute: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Diagnostic`.
pub mod diagnostic {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Severity {
        Unspecified = 0,
        Error = 1,
        Warning = 2,
    }
    impl Severity {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "SEVERITY_UNSPECIFIED",
                Self::Error => "ERROR",
                Self::Warning => "WARNING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
                "ERROR" => Some(Self::Error),
                "WARNING" => Some(Self::Warning),
                _ => None,
            }
        }
    }
}
/// Schema describes the structure of a resource, data source, or provider config.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Schema {
    #[prost(int64, tag = "1")]
    pub version: i64,
    #[prost(message, optional, tag = "2")]
    pub block: ::core::option::Option<Block>,
}
/// Block represents a group of attributes and nested blocks.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
    #[prost(message, repeated, tag = "1")]
    pub attributes: ::prost::alloc::vec::Vec<Attribute>,
    #[prost(message, repeated, tag = "2")]
    pub block_types: ::prost::alloc::vec::Vec<NestedBlock>,
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
}
/// Attribute describes a single configuration attribute.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Attribute {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// JSON-encoded AttributeType
    #[prost(bytes = "vec", tag = "2")]
    pub r#type: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "3")]
    pub required: bool,
    #[prost(bool, tag = "4")]
    pub optional: bool,
    #[prost(bool, tag = "5")]
    pub computed: bool,
    #[prost(bool, tag = "6")]
    pub sensitive: bool,
    #[prost(string, tag = "7")]
    pub description: ::prost::alloc::string::String,
    #[prost(bool, tag = "8")]
    pub force_new: bool,
    /// JSON-encoded default value
    #[prost(bytes = "vec", tag = "9")]
    pub default_value: ::prost::alloc::vec::Vec<u8>,
}
/// NestedBlock describes a nested block type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NestedBlock {
    #[prost(string, tag = "1")]
    pub type_name: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub block: ::core::option::Option<Block>,
    #[prost(enumeration = "nested_block::NestingMode", tag = "3")]
    pub nesting_mode: i32,
    #[prost(int32, tag = "4")]
    pub min_items: i32,
    #[prost(int32, tag = "5")]
    pub max_items: i32,
}
/// Nested message and enum types in `NestedBlock`.
pub mod nested_block {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum NestingMode {
        Unspecified = 0,
        Single = 1,
        List = 2,
        Set = 3,
        Map = 4,
    }
    impl NestingMode {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "NESTING_MODE_UNSPECIFIED",
                Self::Single => "SINGLE",
                Self::List => "LIST",
                Self::Set => "SET",
                Self::Map => "MAP",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "NESTING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "SINGLE" => Some(Self::Single),
                "LIST" => Some(Self::List),
                "SET" => Some(Self::Set),
                "MAP" => Some(Self::Map),
                _ => None,
            }
        }
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMetadataRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMetadataResponse {
    #[prost(message, optional, tag = "1")]
    pub server_capabilities: ::core::option::Option<ServerCapabilities>,
    /// List of resource type names
    #[prost(string, repeated, tag = "2")]
    pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// List of data source type names
    #[prost(string, repeated, tag = "3")]
    pub data_sources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "4")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServerCapabilities {
    /// Provider supports planning destroy operations
    #[prost(bool, tag = "1")]
    pub plan_destroy: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSchemaRequest {
    /// Protocol version of the calling client
    #[prost(uint32, tag = "1")]
    pub client_protocol_version: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSchemaResponse {
    /// Protocol version of this provider
    #[prost(uint32, tag = "1")]
    pub server_protocol_version: u32,
    #[prost(message, optional, tag = "2")]
    pub provider: ::core::option::Option<Schema>,
    #[prost(map = "string, message", tag = "3")]
    pub resources: ::std::collections::HashMap<::prost::alloc::string::String, Schema>,
    #[prost(map = "string, message", tag = "4")]
    pub data_sources: ::std::collections::HashMap<::prost::alloc::string::String, Schema>,
    #[prost(message, repeated, tag = "5")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateProviderConfigRequest {
    /// JSON-encoded provider configuration
    #[prost(bytes = "vec", tag = "1")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateProviderConfigResponse {
    #[prost(message, repeated, tag = "1")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConfigureRequest {
    /// JSON-encoded provider configuration
    #[prost(bytes = "vec", tag = "1")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigureResponse {
    #[prost(message, repeated, tag = "1")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopResponse {
    #[prost(string, tag = "1")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateResourceConfigRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded resource configuration
    #[prost(bytes = "vec", tag = "2")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateResourceConfigResponse {
    #[prost(message, repeated, tag = "1")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpgradeResourceStateRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// Schema version of the stored state
    #[prost(int64, tag = "2")]
    pub version: i64,
    /// JSON-encoded state from older version
    #[prost(bytes = "vec", tag = "3")]
    pub raw_state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpgradeResourceStateResponse {
    /// JSON-encoded state in current schema
    #[prost(bytes = "vec", tag = "1")]
    pub upgraded_state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PlanRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded current state (empty if creating)
    #[prost(bytes = "vec", tag = "2")]
    pub prior_state: ::prost::alloc::vec::Vec<u8>,
    /// JSON-encoded desired state
    #[prost(bytes = "vec", tag = "3")]
    pub proposed_state: ::prost::alloc::vec::Vec<u8>,
    /// JSON-encoded raw configuration
    #[prost(bytes = "vec", tag = "4")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanResponse {
    /// JSON-encoded planned state after apply
    #[prost(bytes = "vec", tag = "1")]
    pub planned_state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub changes: ::prost::alloc::vec::Vec<AttributeChange>,
    #[prost(bool, tag = "3")]
    pub requires_replace: bool,
    #[prost(message, repeated, tag = "4")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttributeChange {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    /// JSON-encoded value before
    #[prost(bytes = "vec", tag = "2")]
    pub before: ::prost::alloc::vec::Vec<u8>,
    /// JSON-encoded value after
    #[prost(bytes = "vec", tag = "3")]
    pub after: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded planned state from Plan
    #[prost(bytes = "vec", tag = "2")]
    pub planned_state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResponse {
    /// JSON-encoded new state
    #[prost(bytes = "vec", tag = "1")]
    pub state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded current state
    #[prost(bytes = "vec", tag = "2")]
    pub current_state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadResponse {
    /// JSON-encoded refreshed state
    #[prost(bytes = "vec", tag = "1")]
    pub state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded state before update
    #[prost(bytes = "vec", tag = "2")]
    pub prior_state: ::prost::alloc::vec::Vec<u8>,
    /// JSON-encoded planned state from Plan
    #[prost(bytes = "vec", tag = "3")]
    pub planned_state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResponse {
    /// JSON-encoded new state
    #[prost(bytes = "vec", tag = "1")]
    pub state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded current state
    #[prost(bytes = "vec", tag = "2")]
    pub current_state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResponse {
    #[prost(message, repeated, tag = "1")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportResourceStateRequest {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// External ID to import
    #[prost(string, tag = "2")]
    pub id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportResourceStateResponse {
    #[prost(message, repeated, tag = "1")]
    pub imported: ::prost::alloc::vec::Vec<ImportedResource>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportedResource {
    #[prost(string, tag = "1")]
    pub resource_type: ::prost::alloc::string::String,
    /// JSON-encoded imported state
    #[prost(bytes = "vec", tag = "2")]
    pub state: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateDataSourceConfigRequest {
    #[prost(string, tag = "1")]
    pub data_source_type: ::prost::alloc::string::String,
    /// JSON-encoded data source configuration
    #[prost(bytes = "vec", tag = "2")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateDataSourceConfigResponse {
    #[prost(message, repeated, tag = "1")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadDataSourceRequest {
    #[prost(string, tag = "1")]
    pub data_source_type: ::prost::alloc::string::String,
    /// JSON-encoded data source configuration
    #[prost(bytes = "vec", tag = "2")]
    pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadDataSourceResponse {
    /// JSON-encoded data source state
    #[prost(bytes = "vec", tag = "1")]
    pub state: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub diagnostics: ::prost::alloc::vec::Vec<Diagnostic>,
}
/// Generated client implementations.
pub mod provider_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value
    )]
    use tonic::codegen::http::Uri;
    use tonic::codegen::*;
    /// The Provider service defines all RPCs for a Hemmer provider.
    #[derive(Debug, Clone)]
    pub struct ProviderClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ProviderClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ProviderClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ProviderClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
                Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ProviderClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// GetMetadata returns metadata about the provider without full schema.
        /// This is used for performance optimization.
        pub async fn get_metadata(
            &mut self,
            request: impl tonic::IntoRequest<super::GetMetadataRequest>,
        ) -> std::result::Result<tonic::Response<super::GetMetadataResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/GetMetadata");
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "GetMetadata",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// GetSchema returns the full schema for the provider, resources, and data sources.
        pub async fn get_schema(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::GetSchemaResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/GetSchema");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "GetSchema"));
            self.inner.unary(req, path, codec).await
        }
        /// ValidateProviderConfig validates the provider configuration.
        pub async fn validate_provider_config(
            &mut self,
            request: impl tonic::IntoRequest<super::ValidateProviderConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateProviderConfigResponse>,
            tonic::Status,
        > {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/hemmer.provider.v1.Provider/ValidateProviderConfig",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "ValidateProviderConfig",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// Configure configures the provider with credentials and settings.
        pub async fn configure(
            &mut self,
            request: impl tonic::IntoRequest<super::ConfigureRequest>,
        ) -> std::result::Result<tonic::Response<super::ConfigureResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Configure");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Configure"));
            self.inner.unary(req, path, codec).await
        }
        /// Stop requests the provider to shut down gracefully.
        pub async fn stop(
            &mut self,
            request: impl tonic::IntoRequest<super::StopRequest>,
        ) -> std::result::Result<tonic::Response<super::StopResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Stop");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Stop"));
            self.inner.unary(req, path, codec).await
        }
        /// ValidateResourceConfig validates a resource's configuration.
        pub async fn validate_resource_config(
            &mut self,
            request: impl tonic::IntoRequest<super::ValidateResourceConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateResourceConfigResponse>,
            tonic::Status,
        > {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/hemmer.provider.v1.Provider/ValidateResourceConfig",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "ValidateResourceConfig",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// UpgradeResourceState upgrades resource state from an older schema version.
        pub async fn upgrade_resource_state(
            &mut self,
            request: impl tonic::IntoRequest<super::UpgradeResourceStateRequest>,
        ) -> std::result::Result<tonic::Response<super::UpgradeResourceStateResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/hemmer.provider.v1.Provider/UpgradeResourceState",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "UpgradeResourceState",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// Plan calculates changes needed to reach desired state.
        pub async fn plan(
            &mut self,
            request: impl tonic::IntoRequest<super::PlanRequest>,
        ) -> std::result::Result<tonic::Response<super::PlanResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Plan");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Plan"));
            self.inner.unary(req, path, codec).await
        }
        /// Create creates a new resource.
        pub async fn create(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateRequest>,
        ) -> std::result::Result<tonic::Response<super::CreateResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Create");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Create"));
            self.inner.unary(req, path, codec).await
        }
        /// Read retrieves the current state of a resource.
        pub async fn read(
            &mut self,
            request: impl tonic::IntoRequest<super::ReadRequest>,
        ) -> std::result::Result<tonic::Response<super::ReadResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Read");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Read"));
            self.inner.unary(req, path, codec).await
        }
        /// Update updates an existing resource.
        pub async fn update(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateRequest>,
        ) -> std::result::Result<tonic::Response<super::UpdateResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Update");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Update"));
            self.inner.unary(req, path, codec).await
        }
        /// Delete removes a resource.
        pub async fn delete(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteRequest>,
        ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/Delete");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("hemmer.provider.v1.Provider", "Delete"));
            self.inner.unary(req, path, codec).await
        }
        /// ImportResourceState imports existing infrastructure into management.
        pub async fn import_resource_state(
            &mut self,
            request: impl tonic::IntoRequest<super::ImportResourceStateRequest>,
        ) -> std::result::Result<tonic::Response<super::ImportResourceStateResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/hemmer.provider.v1.Provider/ImportResourceState",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "ImportResourceState",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// ValidateDataSourceConfig validates a data source's configuration.
        pub async fn validate_data_source_config(
            &mut self,
            request: impl tonic::IntoRequest<super::ValidateDataSourceConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateDataSourceConfigResponse>,
            tonic::Status,
        > {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/hemmer.provider.v1.Provider/ValidateDataSourceConfig",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "ValidateDataSourceConfig",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// ReadDataSource reads data from an external source.
        pub async fn read_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::ReadDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<super::ReadDataSourceResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/hemmer.provider.v1.Provider/ReadDataSource");
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "hemmer.provider.v1.Provider",
                "ReadDataSource",
            ));
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod provider_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with ProviderServer.
    #[async_trait]
    pub trait Provider: std::marker::Send + std::marker::Sync + 'static {
        /// GetMetadata returns metadata about the provider without full schema.
        /// This is used for performance optimization.
        async fn get_metadata(
            &self,
            request: tonic::Request<super::GetMetadataRequest>,
        ) -> std::result::Result<tonic::Response<super::GetMetadataResponse>, tonic::Status>;
        /// GetSchema returns the full schema for the provider, resources, and data sources.
        async fn get_schema(
            &self,
            request: tonic::Request<super::GetSchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::GetSchemaResponse>, tonic::Status>;
        /// ValidateProviderConfig validates the provider configuration.
        async fn validate_provider_config(
            &self,
            request: tonic::Request<super::ValidateProviderConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateProviderConfigResponse>,
            tonic::Status,
        >;
        /// Configure configures the provider with credentials and settings.
        async fn configure(
            &self,
            request: tonic::Request<super::ConfigureRequest>,
        ) -> std::result::Result<tonic::Response<super::ConfigureResponse>, tonic::Status>;
        /// Stop requests the provider to shut down gracefully.
        async fn stop(
            &self,
            request: tonic::Request<super::StopRequest>,
        ) -> std::result::Result<tonic::Response<super::StopResponse>, tonic::Status>;
        /// ValidateResourceConfig validates a resource's configuration.
        async fn validate_resource_config(
            &self,
            request: tonic::Request<super::ValidateResourceConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateResourceConfigResponse>,
            tonic::Status,
        >;
        /// UpgradeResourceState upgrades resource state from an older schema version.
        async fn upgrade_resource_state(
            &self,
            request: tonic::Request<super::UpgradeResourceStateRequest>,
        ) -> std::result::Result<tonic::Response<super::UpgradeResourceStateResponse>, tonic::Status>;
        /// Plan calculates changes needed to reach desired state.
        async fn plan(
            &self,
            request: tonic::Request<super::PlanRequest>,
        ) -> std::result::Result<tonic::Response<super::PlanResponse>, tonic::Status>;
        /// Create creates a new resource.
        async fn create(
            &self,
            request: tonic::Request<super::CreateRequest>,
        ) -> std::result::Result<tonic::Response<super::CreateResponse>, tonic::Status>;
        /// Read retrieves the current state of a resource.
        async fn read(
            &self,
            request: tonic::Request<super::ReadRequest>,
        ) -> std::result::Result<tonic::Response<super::ReadResponse>, tonic::Status>;
        /// Update updates an existing resource.
        async fn update(
            &self,
            request: tonic::Request<super::UpdateRequest>,
        ) -> std::result::Result<tonic::Response<super::UpdateResponse>, tonic::Status>;
        /// Delete removes a resource.
        async fn delete(
            &self,
            request: tonic::Request<super::DeleteRequest>,
        ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status>;
        /// ImportResourceState imports existing infrastructure into management.
        async fn import_resource_state(
            &self,
            request: tonic::Request<super::ImportResourceStateRequest>,
        ) -> std::result::Result<tonic::Response<super::ImportResourceStateResponse>, tonic::Status>;
        /// ValidateDataSourceConfig validates a data source's configuration.
        async fn validate_data_source_config(
            &self,
            request: tonic::Request<super::ValidateDataSourceConfigRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateDataSourceConfigResponse>,
            tonic::Status,
        >;
        /// ReadDataSource reads data from an external source.
        async fn read_data_source(
            &self,
            request: tonic::Request<super::ReadDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<super::ReadDataSourceResponse>, tonic::Status>;
    }
    /// The Provider service defines all RPCs for a Hemmer provider.
    #[derive(Debug)]
    pub struct ProviderServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> ProviderServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for ProviderServer<T>
    where
        T: Provider,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/hemmer.provider.v1.Provider/GetMetadata" => {
                    #[allow(non_camel_case_types)]
                    struct GetMetadataSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::GetMetadataRequest> for GetMetadataSvc<T> {
                        type Response = super::GetMetadataResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetMetadataRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut =
                                async move { <T as Provider>::get_metadata(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = GetMetadataSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/GetSchema" => {
                    #[allow(non_camel_case_types)]
                    struct GetSchemaSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::GetSchemaRequest> for GetSchemaSvc<T> {
                        type Response = super::GetSchemaResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetSchemaRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut =
                                async move { <T as Provider>::get_schema(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = GetSchemaSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/ValidateProviderConfig" => {
                    #[allow(non_camel_case_types)]
                    struct ValidateProviderConfigSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider>
                        tonic::server::UnaryService<super::ValidateProviderConfigRequest>
                        for ValidateProviderConfigSvc<T>
                    {
                        type Response = super::ValidateProviderConfigResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ValidateProviderConfigRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::validate_provider_config(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ValidateProviderConfigSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Configure" => {
                    #[allow(non_camel_case_types)]
                    struct ConfigureSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::ConfigureRequest> for ConfigureSvc<T> {
                        type Response = super::ConfigureResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ConfigureRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut =
                                async move { <T as Provider>::configure(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ConfigureSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Stop" => {
                    #[allow(non_camel_case_types)]
                    struct StopSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::StopRequest> for StopSvc<T> {
                        type Response = super::StopResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StopRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::stop(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StopSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/ValidateResourceConfig" => {
                    #[allow(non_camel_case_types)]
                    struct ValidateResourceConfigSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider>
                        tonic::server::UnaryService<super::ValidateResourceConfigRequest>
                        for ValidateResourceConfigSvc<T>
                    {
                        type Response = super::ValidateResourceConfigResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ValidateResourceConfigRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::validate_resource_config(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ValidateResourceConfigSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/UpgradeResourceState" => {
                    #[allow(non_camel_case_types)]
                    struct UpgradeResourceStateSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider>
                        tonic::server::UnaryService<super::UpgradeResourceStateRequest>
                        for UpgradeResourceStateSvc<T>
                    {
                        type Response = super::UpgradeResourceStateResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::UpgradeResourceStateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::upgrade_resource_state(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UpgradeResourceStateSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Plan" => {
                    #[allow(non_camel_case_types)]
                    struct PlanSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::PlanRequest> for PlanSvc<T> {
                        type Response = super::PlanResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::PlanRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::plan(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = PlanSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Create" => {
                    #[allow(non_camel_case_types)]
                    struct CreateSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::CreateRequest> for CreateSvc<T> {
                        type Response = super::CreateResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::CreateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::create(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = CreateSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Read" => {
                    #[allow(non_camel_case_types)]
                    struct ReadSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::ReadRequest> for ReadSvc<T> {
                        type Response = super::ReadResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ReadRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::read(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ReadSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Update" => {
                    #[allow(non_camel_case_types)]
                    struct UpdateSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::UpdateRequest> for UpdateSvc<T> {
                        type Response = super::UpdateResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::UpdateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::update(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UpdateSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/Delete" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::DeleteRequest> for DeleteSvc<T> {
                        type Response = super::DeleteResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move { <T as Provider>::delete(&inner, request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/ImportResourceState" => {
                    #[allow(non_camel_case_types)]
                    struct ImportResourceStateSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::ImportResourceStateRequest>
                        for ImportResourceStateSvc<T>
                    {
                        type Response = super::ImportResourceStateResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ImportResourceStateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::import_resource_state(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ImportResourceStateSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/ValidateDataSourceConfig" => {
                    #[allow(non_camel_case_types)]
                    struct ValidateDataSourceConfigSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider>
                        tonic::server::UnaryService<super::ValidateDataSourceConfigRequest>
                        for ValidateDataSourceConfigSvc<T>
                    {
                        type Response = super::ValidateDataSourceConfigResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ValidateDataSourceConfigRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::validate_data_source_config(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ValidateDataSourceConfigSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/hemmer.provider.v1.Provider/ReadDataSource" => {
                    #[allow(non_camel_case_types)]
                    struct ReadDataSourceSvc<T: Provider>(pub Arc<T>);
                    impl<T: Provider> tonic::server::UnaryService<super::ReadDataSourceRequest>
                        for ReadDataSourceSvc<T>
                    {
                        type Response = super::ReadDataSourceResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ReadDataSourceRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as Provider>::read_data_source(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ReadDataSourceSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => Box::pin(async move {
                    let mut response = http::Response::new(tonic::body::Body::default());
                    let headers = response.headers_mut();
                    headers.insert(
                        tonic::Status::GRPC_STATUS,
                        (tonic::Code::Unimplemented as i32).into(),
                    );
                    headers.insert(
                        http::header::CONTENT_TYPE,
                        tonic::metadata::GRPC_CONTENT_TYPE,
                    );
                    Ok(response)
                }),
            }
        }
    }
    impl<T> Clone for ProviderServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "hemmer.provider.v1.Provider";
    impl<T> tonic::server::NamedService for ProviderServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
