s2-api 0.30.1

API types for S2, the durable streams API
Documentation
use s2_common::types::{self, location::LocationName};
use serde::{Deserialize, Serialize};

#[rustfmt::skip]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct LocationInfo {
    /// Location name.
    pub name: LocationName,
    /// Location represents a private placement, limited by account.
    pub is_private: bool,
}

impl From<types::location::LocationInfo> for LocationInfo {
    fn from(value: types::location::LocationInfo) -> Self {
        let types::location::LocationInfo { name, is_private } = value;

        Self { name, is_private }
    }
}

pub type GetDefaultLocationResponse = LocationInfo;

pub type SetDefaultLocationRequest = LocationName;