use conjure_http::endpoint;
/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
/// series that can be read from that database. This service is responsible for executing the scrape, and can
/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
#[conjure_http::conjure_client(name = "ConnectionBootstrapperService")]
pub trait ConnectionBootstrapperService<
    #[response_body]
    I: Iterator<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
    /// start or end. Will throw if the requested range is larger than 30 days.
    #[endpoint(
        method = POST,
        path = "/data-source/connection/v1/{rid}/populateSeries",
        name = "populateSeries",
        accept = conjure_http::client::conjure::EmptyResponseDeserializer
    )]
    fn populate_series(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
    ) -> Result<(), conjure_http::private::Error>;
}
/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
/// series that can be read from that database. This service is responsible for executing the scrape, and can
/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
#[conjure_http::conjure_client(name = "ConnectionBootstrapperService")]
pub trait AsyncConnectionBootstrapperService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
    /// start or end. Will throw if the requested range is larger than 30 days.
    #[endpoint(
        method = POST,
        path = "/data-source/connection/v1/{rid}/populateSeries",
        name = "populateSeries",
        accept = conjure_http::client::conjure::EmptyResponseDeserializer
    )]
    async fn populate_series(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
    ) -> Result<(), conjure_http::private::Error>;
}
/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
/// series that can be read from that database. This service is responsible for executing the scrape, and can
/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
#[conjure_http::conjure_client(name = "ConnectionBootstrapperService", local)]
pub trait LocalAsyncConnectionBootstrapperService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
    /// start or end. Will throw if the requested range is larger than 30 days.
    #[endpoint(
        method = POST,
        path = "/data-source/connection/v1/{rid}/populateSeries",
        name = "populateSeries",
        accept = conjure_http::client::conjure::EmptyResponseDeserializer
    )]
    async fn populate_series(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
    ) -> Result<(), conjure_http::private::Error>;
}
