/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 3.1.0 (3.1)
 *
 * Generated by: https://openapi-generator.tech
 */

/// BulkWritableExternalIntegrationRequest : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct BulkWritableExternalIntegrationRequest {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "remote_url")]
    pub remote_url: String,
    /// Verify SSL certificates when connecting to the remote system
    #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")]
    pub verify_ssl: Option<bool>,
    /// Number of seconds to wait for a response
    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
    pub timeout: Option<i32>,
    /// Optional user-defined JSON data for this integration
    #[serde(
        rename = "extra_config",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub extra_config: Option<Option<serde_json::Value>>,
    #[serde(rename = "http_method", skip_serializing_if = "Option::is_none")]
    pub http_method: Option<Box<crate::models::BulkWritableExternalIntegrationRequestHttpMethod>>,
    /// Headers for the HTTP request
    #[serde(
        rename = "headers",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub headers: Option<Option<serde_json::Value>>,
    #[serde(rename = "ca_file_path", skip_serializing_if = "Option::is_none")]
    pub ca_file_path: Option<String>,
    #[serde(
        rename = "secrets_group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub secrets_group:
        Option<Option<Box<crate::models::BulkWritableExternalIntegrationRequestSecretsGroup>>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<
        ::std::collections::HashMap<
            String,
            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
        >,
    >,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
}

impl BulkWritableExternalIntegrationRequest {
    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
    pub fn new(
        id: uuid::Uuid,
        name: String,
        remote_url: String,
    ) -> BulkWritableExternalIntegrationRequest {
        BulkWritableExternalIntegrationRequest {
            id,
            name,
            remote_url,
            verify_ssl: None,
            timeout: None,
            extra_config: None,
            http_method: None,
            headers: None,
            ca_file_path: None,
            secrets_group: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}
