orvanta_api/models/process_activity_retry.rs
1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProcessActivityRetry : automatic-retry detail attached to a ProcessActivityStatus. Present only when the element's most recent dispatch carried a retry policy. next_attempt_at set means the activity failed and is waiting to be retried at that instant -- the process is running, not broken, and no incident exists yet. next_attempt_at absent with attempt == max_attempts means the budget is spent; if the element also carries an error, that is the dead-lettered activity.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProcessActivityRetry {
17 /// 1-based; 1 is the original execution
18 #[serde(rename = "attempt")]
19 pub attempt: i64,
20 /// total attempts permitted, original included
21 #[serde(rename = "max_attempts")]
22 pub max_attempts: i64,
23 #[serde(rename = "next_attempt_at", skip_serializing_if = "Option::is_none")]
24 pub next_attempt_at: Option<String>,
25}
26
27impl ProcessActivityRetry {
28 /// automatic-retry detail attached to a ProcessActivityStatus. Present only when the element's most recent dispatch carried a retry policy. next_attempt_at set means the activity failed and is waiting to be retried at that instant -- the process is running, not broken, and no incident exists yet. next_attempt_at absent with attempt == max_attempts means the budget is spent; if the element also carries an error, that is the dead-lettered activity.
29 pub fn new(attempt: i64, max_attempts: i64) -> ProcessActivityRetry {
30 ProcessActivityRetry {
31 attempt,
32 max_attempts,
33 next_attempt_at: None,
34 }
35 }
36}
37