use conjure_http::endpoint;
/// The Units Service serves as a comprehensive catalog of the units of measurement supported by scout. Units, by
/// default, follow the UCUM convention for representation.
#[conjure_http::conjure_endpoints(name = "UnitsService", use_legacy_error_serialization)]
pub trait UnitsService {
    /// Returns all known units, grouped by the physical property they measure.
    #[endpoint(
        method = GET,
        path = "/units/v1/units",
        name = "getAllUnits",
        produces = conjure_http::server::StdResponseSerializer
    )]
    fn get_all_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        super::super::super::objects::scout::units::api::GetUnitsResponse,
        conjure_http::private::Error,
    >;
    /// Returns information for a unit symbol if available. Returns as empty if the provided symbol cannot be parsed.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-unit",
        name = "getUnit",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    fn get_unit(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        Option<super::super::super::objects::scout::units::api::Unit>,
        conjure_http::private::Error,
    >;
    /// Returns information for the unit symbols if available. If the provided symbol cannot be parsed, it will be
    /// omitted from the map.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-batch-units",
        name = "getBatchUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    fn get_batch_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        units: std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::UnitSymbol,
        >,
    ) -> Result<
        std::collections::BTreeMap<
            super::super::super::objects::scout::units::api::UnitSymbol,
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
    /// Returns the set of cataloged units that can be converted to and from the given unit.
    /// No commensurable units does not imply the unit is invalid. Use /get-unit to check for validity.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/commensurable-units",
        name = "getCommensurableUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    fn get_commensurable_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
}
/// The Units Service serves as a comprehensive catalog of the units of measurement supported by scout. Units, by
/// default, follow the UCUM convention for representation.
#[conjure_http::conjure_endpoints(name = "UnitsService", use_legacy_error_serialization)]
pub trait AsyncUnitsService {
    /// Returns all known units, grouped by the physical property they measure.
    #[endpoint(
        method = GET,
        path = "/units/v1/units",
        name = "getAllUnits",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn get_all_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        super::super::super::objects::scout::units::api::GetUnitsResponse,
        conjure_http::private::Error,
    >;
    /// Returns information for a unit symbol if available. Returns as empty if the provided symbol cannot be parsed.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-unit",
        name = "getUnit",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_unit(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        Option<super::super::super::objects::scout::units::api::Unit>,
        conjure_http::private::Error,
    >;
    /// Returns information for the unit symbols if available. If the provided symbol cannot be parsed, it will be
    /// omitted from the map.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-batch-units",
        name = "getBatchUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_batch_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        units: std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::UnitSymbol,
        >,
    ) -> Result<
        std::collections::BTreeMap<
            super::super::super::objects::scout::units::api::UnitSymbol,
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
    /// Returns the set of cataloged units that can be converted to and from the given unit.
    /// No commensurable units does not imply the unit is invalid. Use /get-unit to check for validity.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/commensurable-units",
        name = "getCommensurableUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_commensurable_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
}
/// The Units Service serves as a comprehensive catalog of the units of measurement supported by scout. Units, by
/// default, follow the UCUM convention for representation.
#[conjure_http::conjure_endpoints(
    name = "UnitsService",
    use_legacy_error_serialization,
    local
)]
pub trait LocalAsyncUnitsService {
    /// Returns all known units, grouped by the physical property they measure.
    #[endpoint(
        method = GET,
        path = "/units/v1/units",
        name = "getAllUnits",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn get_all_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        super::super::super::objects::scout::units::api::GetUnitsResponse,
        conjure_http::private::Error,
    >;
    /// Returns information for a unit symbol if available. Returns as empty if the provided symbol cannot be parsed.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-unit",
        name = "getUnit",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_unit(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        Option<super::super::super::objects::scout::units::api::Unit>,
        conjure_http::private::Error,
    >;
    /// Returns information for the unit symbols if available. If the provided symbol cannot be parsed, it will be
    /// omitted from the map.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/get-batch-units",
        name = "getBatchUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_batch_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        units: std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::UnitSymbol,
        >,
    ) -> Result<
        std::collections::BTreeMap<
            super::super::super::objects::scout::units::api::UnitSymbol,
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
    /// Returns the set of cataloged units that can be converted to and from the given unit.
    /// No commensurable units does not imply the unit is invalid. Use /get-unit to check for validity.
    #[endpoint(
        method = POST,
        path = "/units/v1/units/commensurable-units",
        name = "getCommensurableUnits",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_commensurable_units(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        unit: super::super::super::objects::scout::units::api::UnitSymbol,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::units::api::Unit,
        >,
        conjure_http::private::Error,
    >;
}
