//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsentitymappingtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEntityMappingType(pub NSUInteger);
impl NSEntityMappingType {
    #[doc(alias = "NSUndefinedEntityMappingType")]
    pub const UndefinedEntityMappingType: Self = Self(0x00);
    #[doc(alias = "NSCustomEntityMappingType")]
    pub const CustomEntityMappingType: Self = Self(0x01);
    #[doc(alias = "NSAddEntityMappingType")]
    pub const AddEntityMappingType: Self = Self(0x02);
    #[doc(alias = "NSRemoveEntityMappingType")]
    pub const RemoveEntityMappingType: Self = Self(0x03);
    #[doc(alias = "NSCopyEntityMappingType")]
    pub const CopyEntityMappingType: Self = Self(0x04);
    #[doc(alias = "NSTransformEntityMappingType")]
    pub const TransformEntityMappingType: Self = Self(0x05);
}

unsafe impl Encode for NSEntityMappingType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEntityMappingType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsentitymapping?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSEntityMapping;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSEntityMapping {}
);

impl NSEntityMapping {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[unsafe(method(mappingType))]
        #[unsafe(method_family = none)]
        pub unsafe fn mappingType(&self) -> NSEntityMappingType;

        /// Setter for [`mappingType`][Self::mappingType].
        #[unsafe(method(setMappingType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMappingType(&self, mapping_type: NSEntityMappingType);

        #[unsafe(method(sourceEntityName))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceEntityName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`sourceEntityName`][Self::sourceEntityName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSourceEntityName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSourceEntityName(&self, source_entity_name: Option<&NSString>);

        #[unsafe(method(sourceEntityVersionHash))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceEntityVersionHash(&self) -> Option<Retained<NSData>>;

        /// Setter for [`sourceEntityVersionHash`][Self::sourceEntityVersionHash].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSourceEntityVersionHash:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSourceEntityVersionHash(
            &self,
            source_entity_version_hash: Option<&NSData>,
        );

        #[unsafe(method(destinationEntityName))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationEntityName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`destinationEntityName`][Self::destinationEntityName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDestinationEntityName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDestinationEntityName(&self, destination_entity_name: Option<&NSString>);

        #[unsafe(method(destinationEntityVersionHash))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationEntityVersionHash(&self) -> Option<Retained<NSData>>;

        /// Setter for [`destinationEntityVersionHash`][Self::destinationEntityVersionHash].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDestinationEntityVersionHash:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDestinationEntityVersionHash(
            &self,
            destination_entity_version_hash: Option<&NSData>,
        );

        #[cfg(feature = "NSPropertyMapping")]
        #[unsafe(method(attributeMappings))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributeMappings(&self) -> Option<Retained<NSArray<NSPropertyMapping>>>;

        #[cfg(feature = "NSPropertyMapping")]
        /// Setter for [`attributeMappings`][Self::attributeMappings].
        #[unsafe(method(setAttributeMappings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributeMappings(
            &self,
            attribute_mappings: Option<&NSArray<NSPropertyMapping>>,
        );

        #[cfg(feature = "NSPropertyMapping")]
        #[unsafe(method(relationshipMappings))]
        #[unsafe(method_family = none)]
        pub unsafe fn relationshipMappings(&self) -> Option<Retained<NSArray<NSPropertyMapping>>>;

        #[cfg(feature = "NSPropertyMapping")]
        /// Setter for [`relationshipMappings`][Self::relationshipMappings].
        #[unsafe(method(setRelationshipMappings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRelationshipMappings(
            &self,
            relationship_mappings: Option<&NSArray<NSPropertyMapping>>,
        );

        #[unsafe(method(sourceExpression))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceExpression(&self) -> Option<Retained<NSExpression>>;

        /// Setter for [`sourceExpression`][Self::sourceExpression].
        #[unsafe(method(setSourceExpression:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSourceExpression(&self, source_expression: Option<&NSExpression>);

        #[unsafe(method(userInfo))]
        #[unsafe(method_family = none)]
        pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;

        /// Setter for [`userInfo`][Self::userInfo].
        ///
        /// # Safety
        ///
        /// `user_info` generic should be of the correct type.
        #[unsafe(method(setUserInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);

        #[unsafe(method(entityMigrationPolicyClassName))]
        #[unsafe(method_family = none)]
        pub unsafe fn entityMigrationPolicyClassName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`entityMigrationPolicyClassName`][Self::entityMigrationPolicyClassName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setEntityMigrationPolicyClassName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEntityMigrationPolicyClassName(
            &self,
            entity_migration_policy_class_name: Option<&NSString>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl NSEntityMapping {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
