namespace KlaviyoSharp.Models;

/// <summary>
/// Klaviyo Catalog Variant Bulk Job
/// </summary>
public class CatalogVariantBulkJob : KlaviyoObject<CatalogVariantBulkJobAttributes, CatalogVariantBulkJobRelationships>
{
    /// <summary>
    /// Not implemented. Use specific methods for creating bulk jobs.
    /// </summary>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    public static new CatalogVariantBulkJob Create()
    {
        throw new NotImplementedException("Use specific methods for creating bulk jobs.");
    }
    /// <summary>
    /// Creates a new instance with the type set to "catalog-variant-bulk-create-job"
    /// </summary>
    /// <returns></returns>
    public static CatalogVariantBulkJob CreateCreateJob()
    {
        return new() { Type = "catalog-variant-bulk-create-job" };
    }
    /// <summary>
    /// Creates a new instance with the type set to "catalog-variant-bulk-update-job"
    /// </summary>
    /// <returns></returns>
    public static CatalogVariantBulkJob CreateUpdateJob()
    {
        return new() { Type = "catalog-variant-bulk-update-job" };
    }
    /// <summary>
    /// Creates a new instance with the type set to "catalog-variant-bulk-delete-job"
    /// </summary>
    /// <returns></returns>
    public static CatalogVariantBulkJob CreateDeleteJob()
    {
        return new() { Type = "catalog-variant-bulk-delete-job" };
    }
}

/// <summary>
/// Klaviyo Catalog Variant Bulk Job Relationships
/// </summary>
public class CatalogVariantBulkJobRelationships
{
    /// <summary>
    /// Catalog Variants associated with the CatalogVariantBulkJob
    /// </summary>
    public DataListObject<GenericObject> Variants { get; set; }
}

/// <summary>
/// Klaviyo Catalog Variant Bulk Job Attributes
/// </summary>
public class CatalogVariantBulkJobAttributes
{
    /// <summary>
    /// Unique identifier for retrieving the job. Generated by Klaviyo.
    /// </summary>
    public string JobId { get; set; }
    /// <summary>
    /// Status of the asynchronous job. One of: cancelled, complete, processing, queued.
    /// </summary>
    public string Status { get; set; }
    /// <summary>
    /// The date and time the job was created in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).
    /// </summary>
    public DateTime? CreatedAt { get; set; }
    /// <summary>
    /// The total number of operations to be processed by the job. See completed_count for the job's current progress.
    /// </summary>
    public int? TotalCount { get; set; }
    /// <summary>
    /// The total number of operations that have been completed by the job.
    /// </summary>
    public int? CompletedCount { get; set; }
    /// <summary>
    /// The total number of operations that have failed as part of the job.
    /// </summary>
    public int? FailedCount { get; set; }
    /// <summary>
    /// Date and time the job was completed in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).
    /// </summary>
    public DateTime? CompletedAt { get; set; }
    /// <summary>
    /// Date and time the job expires in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).
    /// </summary>
    public DateTime? ExpiresAt { get; set; }
    /// <summary>
    /// Array of errors encountered during the processing of the job.
    /// </summary>
    public List<KlaviyoErrorDetails> Errors { get; set; }
    /// <summary>
    /// Array of catalog variants to create/update/delete.
    /// </summary>
    public List<CatalogVariant> Variants { get; set; }
}