// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Record of an API-call block's outbound HTTP request during a run.
/// Lists each request `attempts` made (including retries) and any `error`
/// if the call ultimately failed.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ApiCallInvocation {
    /// The operation that produced this artifact
    ///
    /// Defaults to `api_call_invocation`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub operation: Option<String>,
    pub id: String,
    pub run_id: String,
    pub step_id: String,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub attempts: Option<Vec<ApiCallAttempt>>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub error: Option<ErrorDetails>,
    /// Timestamp when this artifact was created.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
}
impl ApiCallInvocation {
    /// Construct a new `ApiCallInvocation` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        run_id: impl Into<String>,
        step_id: impl Into<String>,
    ) -> Self {
        Self {
            operation: Default::default(),
            id: id.into(),
            run_id: run_id.into(),
            step_id: step_id.into(),
            attempts: Default::default(),
            error: Default::default(),
            created_at: Default::default(),
        }
    }
}
