/*
 * ByRefOrValue
 *
 * This tests for a oneOf interface representation 
 *
 * The version of the OpenAPI document: 0.0.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// EntityRef : Entity reference schema to be use for all entityRef class.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "@type")]
pub enum EntityRef {
    #[serde(rename="BarRef")]
    BarRef {
        /// Name of the related entity.
        #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
        name: Option<String>,
        /// The actual type of the target instance when needed for disambiguation.
        #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
        at_referred_type: Option<String>,
        /// Hyperlink reference
        #[serde(rename = "href", skip_serializing_if = "Option::is_none")]
        href: Option<String>,
        /// unique identifier
        #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
        id: Option<String>,
        /// A URI to a JSON-Schema file that defines additional attributes and relationships
        #[serde(rename = "@schemaLocation", skip_serializing_if = "Option::is_none")]
        at_schema_location: Option<String>,
        /// When sub-classing, this defines the super-class
        #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")]
        at_base_type: Option<String>,
    },
    #[serde(rename="FooRef")]
    FooRef {
        /// Name of the related entity.
        #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
        name: Option<String>,
        /// The actual type of the target instance when needed for disambiguation.
        #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
        at_referred_type: Option<String>,
        /// Hyperlink reference
        #[serde(rename = "href", skip_serializing_if = "Option::is_none")]
        href: Option<String>,
        /// unique identifier
        #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
        id: Option<String>,
        /// A URI to a JSON-Schema file that defines additional attributes and relationships
        #[serde(rename = "@schemaLocation", skip_serializing_if = "Option::is_none")]
        at_schema_location: Option<String>,
        /// When sub-classing, this defines the super-class
        #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")]
        at_base_type: Option<String>,
    },
}

impl Default for EntityRef {
    fn default() -> Self {
        Self::BarRef {
            name: Default::default(),
            at_referred_type: Default::default(),
            href: Default::default(),
            id: Default::default(),
            at_schema_location: Default::default(),
            at_base_type: Default::default(),
        }
        
    }
}


