pub struct ScenarioEnvironmentVersion {
pub id: Uuid,
pub scenario_id: Uuid,
pub workspace_id: Uuid,
pub environment: String,
pub scenario_version: String,
pub promoted_at: DateTime<Utc>,
pub promoted_by: Uuid,
pub promotion_id: Option<Uuid>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Scenario environment version tracking
Tracks which scenario version is active in each environment for each workspace.
Fields§
§id: UuidUnique identifier
scenario_id: UuidScenario ID
workspace_id: UuidWorkspace ID
environment: StringEnvironment name (dev/test/prod)
scenario_version: StringActive scenario version in this environment
promoted_at: DateTime<Utc>When this version was promoted
promoted_by: UuidUser who promoted this version
promotion_id: Option<Uuid>Promotion ID that created this record
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last update timestamp
Implementations§
Source§impl ScenarioEnvironmentVersion
impl ScenarioEnvironmentVersion
Sourcepub async fn set_version(
pool: &Pool<Postgres>,
scenario_id: Uuid,
workspace_id: Uuid,
environment: &str,
scenario_version: &str,
promoted_by: Uuid,
promotion_id: Option<Uuid>,
) -> Result<ScenarioEnvironmentVersion, Error>
pub async fn set_version( pool: &Pool<Postgres>, scenario_id: Uuid, workspace_id: Uuid, environment: &str, scenario_version: &str, promoted_by: Uuid, promotion_id: Option<Uuid>, ) -> Result<ScenarioEnvironmentVersion, Error>
Get or create environment version record
If a version already exists for this scenario/workspace/environment, updates it. Otherwise creates a new record.
Sourcepub async fn get_version(
pool: &Pool<Postgres>,
scenario_id: Uuid,
workspace_id: Uuid,
environment: &str,
) -> Result<Option<ScenarioEnvironmentVersion>, Error>
pub async fn get_version( pool: &Pool<Postgres>, scenario_id: Uuid, workspace_id: Uuid, environment: &str, ) -> Result<Option<ScenarioEnvironmentVersion>, Error>
Get current version for a scenario in an environment
Sourcepub async fn list_by_scenario_workspace(
pool: &Pool<Postgres>,
scenario_id: Uuid,
workspace_id: Uuid,
) -> Result<Vec<ScenarioEnvironmentVersion>, Error>
pub async fn list_by_scenario_workspace( pool: &Pool<Postgres>, scenario_id: Uuid, workspace_id: Uuid, ) -> Result<Vec<ScenarioEnvironmentVersion>, Error>
List all environment versions for a scenario in a workspace
Trait Implementations§
Source§impl Clone for ScenarioEnvironmentVersion
impl Clone for ScenarioEnvironmentVersion
Source§fn clone(&self) -> ScenarioEnvironmentVersion
fn clone(&self) -> ScenarioEnvironmentVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScenarioEnvironmentVersion
impl Debug for ScenarioEnvironmentVersion
Source§impl<'de> Deserialize<'de> for ScenarioEnvironmentVersion
impl<'de> Deserialize<'de> for ScenarioEnvironmentVersion
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScenarioEnvironmentVersion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScenarioEnvironmentVersion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, R> FromRow<'a, R> for ScenarioEnvironmentVersionwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for ScenarioEnvironmentVersionwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for ScenarioEnvironmentVersion
impl Serialize for ScenarioEnvironmentVersion
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ScenarioEnvironmentVersion
impl RefUnwindSafe for ScenarioEnvironmentVersion
impl Send for ScenarioEnvironmentVersion
impl Sync for ScenarioEnvironmentVersion
impl Unpin for ScenarioEnvironmentVersion
impl UnsafeUnpin for ScenarioEnvironmentVersion
impl UnwindSafe for ScenarioEnvironmentVersion
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.