/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateRepositoryRequest {
    /// Alias for `is_public`. When set to true, anonymous users can download artifacts without authentication. Useful for remote (pull-through cache) repositories that proxy public upstream registries. Write operations (upload, delete) still require authentication regardless of this setting. If both `is_public` and `allow_anonymous_access` are provided, `allow_anonymous_access` takes precedence.
    #[serde(rename = "allow_anonymous_access", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub allow_anonymous_access: Option<Option<bool>>,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    /// Update the Cargo index upstream URL (stored in `repository_config`). When provided, upserts the `index_upstream_url` key for this repository.
    #[serde(rename = "index_upstream_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub index_upstream_url: Option<Option<String>>,
    #[serde(rename = "is_public", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub is_public: Option<Option<bool>>,
    #[serde(rename = "key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub key: Option<Option<String>>,
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    /// When provided, enables/disables the `promotion_only` policy for this repository (admin-only). When omitted, the flag is left unchanged.
    #[serde(rename = "promotion_only", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub promotion_only: Option<Option<bool>>,
    /// Quarantine hold duration in minutes for this repository. Stored in `repository_config` under `quarantine_duration_minutes`.
    #[serde(rename = "quarantine_duration_minutes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub quarantine_duration_minutes: Option<Option<i64>>,
    /// Enable or disable quarantine period for this repository. When enabled, newly uploaded artifacts are held until scanned. Stored in `repository_config` under `quarantine_enabled`.
    #[serde(rename = "quarantine_enabled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub quarantine_enabled: Option<Option<bool>>,
    #[serde(rename = "quota_bytes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub quota_bytes: Option<Option<i64>>,
    /// Link this staging repository to a release (local) repository. Promotions from this staging repo will default to the linked release repo, and promotions to any other repo will be rejected. Pass an empty string to remove the link. Stored in `repository_config` under `release_repository_id`.
    #[serde(rename = "release_repository_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub release_repository_key: Option<Option<String>>,
}

impl UpdateRepositoryRequest {
    pub fn new() -> UpdateRepositoryRequest {
        UpdateRepositoryRequest {
            allow_anonymous_access: None,
            description: None,
            index_upstream_url: None,
            is_public: None,
            key: None,
            name: None,
            promotion_only: None,
            quarantine_duration_minutes: None,
            quarantine_enabled: None,
            quota_bytes: None,
            release_repository_key: None,
        }
    }
}

