1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSEntityDescription;

    unsafe impl ClassType for NSEntityDescription {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for NSEntityDescription {}

unsafe impl NSCopying for NSEntityDescription {}

unsafe impl NSFastEnumeration for NSEntityDescription {}

unsafe impl NSObjectProtocol for NSEntityDescription {}

extern_methods!(
    unsafe impl NSEntityDescription {
        #[cfg(feature = "NSManagedObjectContext")]
        #[method_id(@__retain_semantics Other entityForName:inManagedObjectContext:)]
        pub unsafe fn entityForName_inManagedObjectContext(
            entity_name: &NSString,
            context: &NSManagedObjectContext,
        ) -> Option<Retained<NSEntityDescription>>;

        #[cfg(all(feature = "NSManagedObject", feature = "NSManagedObjectContext"))]
        #[method_id(@__retain_semantics Other insertNewObjectForEntityForName:inManagedObjectContext:)]
        pub unsafe fn insertNewObjectForEntityForName_inManagedObjectContext(
            entity_name: &NSString,
            context: &NSManagedObjectContext,
        ) -> Retained<NSManagedObject>;

        #[cfg(feature = "NSManagedObjectModel")]
        #[method_id(@__retain_semantics Other managedObjectModel)]
        pub unsafe fn managedObjectModel(&self) -> Retained<NSManagedObjectModel>;

        #[method_id(@__retain_semantics Other managedObjectClassName)]
        pub unsafe fn managedObjectClassName(&self) -> Retained<NSString>;

        #[method(setManagedObjectClassName:)]
        pub unsafe fn setManagedObjectClassName(
            &self,
            managed_object_class_name: Option<&NSString>,
        );

        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Retained<NSString>>;

        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[method(isAbstract)]
        pub unsafe fn isAbstract(&self) -> bool;

        #[method(setAbstract:)]
        pub unsafe fn setAbstract(&self, r#abstract: bool);

        #[method_id(@__retain_semantics Other subentitiesByName)]
        pub unsafe fn subentitiesByName(
            &self,
        ) -> Retained<NSDictionary<NSString, NSEntityDescription>>;

        #[method_id(@__retain_semantics Other subentities)]
        pub unsafe fn subentities(&self) -> Retained<NSArray<NSEntityDescription>>;

        #[method(setSubentities:)]
        pub unsafe fn setSubentities(&self, subentities: &NSArray<NSEntityDescription>);

        #[method_id(@__retain_semantics Other superentity)]
        pub unsafe fn superentity(&self) -> Option<Retained<NSEntityDescription>>;

        #[cfg(feature = "NSPropertyDescription")]
        #[method_id(@__retain_semantics Other propertiesByName)]
        pub unsafe fn propertiesByName(
            &self,
        ) -> Retained<NSDictionary<NSString, NSPropertyDescription>>;

        #[cfg(feature = "NSPropertyDescription")]
        #[method_id(@__retain_semantics Other properties)]
        pub unsafe fn properties(&self) -> Retained<NSArray<NSPropertyDescription>>;

        #[cfg(feature = "NSPropertyDescription")]
        #[method(setProperties:)]
        pub unsafe fn setProperties(&self, properties: &NSArray<NSPropertyDescription>);

        #[method_id(@__retain_semantics Other userInfo)]
        pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;

        #[method(setUserInfo:)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);

        #[cfg(all(feature = "NSAttributeDescription", feature = "NSPropertyDescription"))]
        #[method_id(@__retain_semantics Other attributesByName)]
        pub unsafe fn attributesByName(
            &self,
        ) -> Retained<NSDictionary<NSString, NSAttributeDescription>>;

        #[cfg(all(
            feature = "NSPropertyDescription",
            feature = "NSRelationshipDescription"
        ))]
        #[method_id(@__retain_semantics Other relationshipsByName)]
        pub unsafe fn relationshipsByName(
            &self,
        ) -> Retained<NSDictionary<NSString, NSRelationshipDescription>>;

        #[cfg(all(
            feature = "NSPropertyDescription",
            feature = "NSRelationshipDescription"
        ))]
        #[method_id(@__retain_semantics Other relationshipsWithDestinationEntity:)]
        pub unsafe fn relationshipsWithDestinationEntity(
            &self,
            entity: &NSEntityDescription,
        ) -> Retained<NSArray<NSRelationshipDescription>>;

        #[method(isKindOfEntity:)]
        pub unsafe fn isKindOfEntity(&self, entity: &NSEntityDescription) -> bool;

        #[method_id(@__retain_semantics Other versionHash)]
        pub unsafe fn versionHash(&self) -> Retained<NSData>;

        #[method_id(@__retain_semantics Other versionHashModifier)]
        pub unsafe fn versionHashModifier(&self) -> Option<Retained<NSString>>;

        #[method(setVersionHashModifier:)]
        pub unsafe fn setVersionHashModifier(&self, version_hash_modifier: Option<&NSString>);

        #[method_id(@__retain_semantics Other renamingIdentifier)]
        pub unsafe fn renamingIdentifier(&self) -> Option<Retained<NSString>>;

        #[method(setRenamingIdentifier:)]
        pub unsafe fn setRenamingIdentifier(&self, renaming_identifier: Option<&NSString>);

        #[cfg(feature = "NSFetchIndexDescription")]
        #[method_id(@__retain_semantics Other indexes)]
        pub unsafe fn indexes(&self) -> Retained<NSArray<NSFetchIndexDescription>>;

        #[cfg(feature = "NSFetchIndexDescription")]
        #[method(setIndexes:)]
        pub unsafe fn setIndexes(&self, indexes: &NSArray<NSFetchIndexDescription>);

        #[method_id(@__retain_semantics Other uniquenessConstraints)]
        pub unsafe fn uniquenessConstraints(&self) -> Retained<NSArray<NSArray<AnyObject>>>;

        #[method(setUniquenessConstraints:)]
        pub unsafe fn setUniquenessConstraints(
            &self,
            uniqueness_constraints: &NSArray<NSArray<AnyObject>>,
        );

        #[deprecated = "Use NSEntityDescription.indexes instead"]
        #[method_id(@__retain_semantics Other compoundIndexes)]
        pub unsafe fn compoundIndexes(&self) -> Retained<NSArray<NSArray<AnyObject>>>;

        #[deprecated = "Use NSEntityDescription.indexes instead"]
        #[method(setCompoundIndexes:)]
        pub unsafe fn setCompoundIndexes(&self, compound_indexes: &NSArray<NSArray<AnyObject>>);

        #[method_id(@__retain_semantics Other coreSpotlightDisplayNameExpression)]
        pub unsafe fn coreSpotlightDisplayNameExpression(&self) -> Retained<NSExpression>;

        #[method(setCoreSpotlightDisplayNameExpression:)]
        pub unsafe fn setCoreSpotlightDisplayNameExpression(
            &self,
            core_spotlight_display_name_expression: &NSExpression,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSEntityDescription {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);