autogen-stedi 0.3.2

Auto-generated, strongly-typed Rust client for the Stedi APIs
Documentation
/*
 * Stedi Manager
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2024-04-01
 * Contact: healthcare@stedi.com
 * Generated by: https://openapi-generator.tech
 */

use crate::manager::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetBatchResponseContent {
    /// The type of batch. Currently only supports eligibility.
    #[serde(rename = "batchType")]
    pub batch_type: models::BatchType,
    /// The date and time when the batch was created.
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    /// The number of eligibility checks that failed during processing. A failure means that Stedi successfully processed the check but didn't receive a response from the payer, even after retrying. A common reason for failure is payer connectivity issues.
    #[serde(rename = "errorCount", skip_serializing_if = "Option::is_none")]
    pub error_count: Option<i32>,
    /// The unique identifier for the batch. This is the `batchId` returned in the Batch Eligibility Check endpoint response. It's also listed as the **Batch ID** in the Stedi portal.
    #[serde(rename = "id")]
    pub id: String,
    /// The URL to download the original CSV file. Only relevant for batches submitted through CSV upload in the Stedi portal.
    #[serde(rename = "importUrl", skip_serializing_if = "Option::is_none")]
    pub import_url: Option<String>,
    /// The number of eligibility checks that are currently in progress (started or retrying).
    #[serde(rename = "inProgressCount", skip_serializing_if = "Option::is_none")]
    pub in_progress_count: Option<i32>,
    /// The maximum number of hours that Stedi will retry eligibility checks in this batch that fail due to payer connectivity issues. This is the value that was set when the batch was created. Only applicable to batches submitted through the API.
    #[serde(rename = "maxRetryHours", skip_serializing_if = "Option::is_none")]
    pub max_retry_hours: Option<i32>,
    /// The name assigned to the batch upon creation. For CSV uploads, this is the name you provided when uploading the file. For API submissions, this is the same as the `batchId`.
    #[serde(rename = "name")]
    pub name: String,
    /// How the batch was submitted. Can be:   - `API`: The batch was submitted through the Batch Eligibility Check endpoint.   - `CSV_IMPORT`: The batch was submitted through CSV upload in the Stedi portal.
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<models::BatchSource>,
    /// The status of the batch. Can be:   - `PENDING`: Stedi created the batch and is waiting for the CSV file to finish uploading.   - `VALIDATED`: Stedi finished validating the batch and is ready to start executing it.   - `VALIDATION_FAILED`: Stedi found errors in the batch submission that you need to fix before processing can continue. This is usually due to malformed CSV data.   - `IN_PROGRESS`: Stedi is processing the batch. Some eligibility checks in the batch may be complete while others are still in progress.   - `COMPLETED`: Stedi finished processing all items in the batch successfully. This doesn't mean that all eligibility checks successfully returned benefits information, only that Stedi successfully sent them to the payers and received responses.   - `COMPLETED_WITH_ERRORS`: Stedi finished processing all eligibility checks in the batch, but some failed. A common reason for failure is payer connectivity issues.
    #[serde(rename = "status")]
    pub status: models::BatchStatus,
    /// The number of eligibility checks that were successfully completed. This means that Stedi successfully sent the check to the payer and received a response, but doesn't indicate whether the payer returned benefits information.
    #[serde(rename = "successCount", skip_serializing_if = "Option::is_none")]
    pub success_count: Option<i32>,
    /// The total number of eligibility checks in the batch. In the case of CSV uploads, one row in the CSV file corresponds to one eligibility check.
    #[serde(rename = "totalCount", skip_serializing_if = "Option::is_none")]
    pub total_count: Option<i32>,
    /// The date and time when the batch was last updated.
    #[serde(rename = "updatedAt")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
    /// The number of eligibility checks that Stedi has validated.
    #[serde(rename = "validatedCount", skip_serializing_if = "Option::is_none")]
    pub validated_count: Option<i32>,
    /// The number of eligibility checks that failed validation. This is relevant to CSV uploads, where Stedi validates each row in the CSV file before processing it.
    #[serde(rename = "validationFailedCount", skip_serializing_if = "Option::is_none")]
    pub validation_failed_count: Option<i32>,
}

impl GetBatchResponseContent {
    pub fn new(batch_type: models::BatchType, created_at: chrono::DateTime<chrono::FixedOffset>, id: String, name: String, status: models::BatchStatus, updated_at: chrono::DateTime<chrono::FixedOffset>) -> GetBatchResponseContent {
        GetBatchResponseContent {
            batch_type,
            created_at,
            error_count: None,
            id,
            import_url: None,
            in_progress_count: None,
            max_retry_hours: None,
            name,
            source: None,
            status,
            success_count: None,
            total_count: None,
            updated_at,
            validated_count: None,
            validation_failed_count: None,
        }
    }
}