/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-48dd1e2d75e7eac65741e465279d2700f927137d
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

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

/// BulkEditShareableEntityResponse : Details of a request to bulk edit shareable entity.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkEditShareableEntityResponse {
    /// Allowed action for bulk edit shareable entity
    #[serde(rename = "action")]
    pub action: Action,
    /// The mapping dashboard id to errors if any.
    #[serde(rename = "entityErrors", skip_serializing_if = "Option::is_none")]
    pub entity_errors: Option<std::collections::HashMap<String, models::BulkEditActionError>>,
}

impl BulkEditShareableEntityResponse {
    /// Details of a request to bulk edit shareable entity.
    pub fn new(action: Action) -> BulkEditShareableEntityResponse {
        BulkEditShareableEntityResponse {
            action,
            entity_errors: None,
        }
    }
}
/// Allowed action for bulk edit shareable entity
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "changeOwner")]
    ChangeOwner,
    #[serde(rename = "changePermission")]
    ChangePermission,
    #[serde(rename = "addPermission")]
    AddPermission,
    #[serde(rename = "removePermission")]
    RemovePermission,
}

impl Default for Action {
    fn default() -> Action {
        Self::ChangeOwner
    }
}

