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
190
191
192
193
194
195
196
197
198
199
200
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKOverlayPosition(pub NSInteger);
impl SKOverlayPosition {
    #[doc(alias = "SKOverlayPositionBottom")]
    pub const Bottom: Self = Self(0);
    #[doc(alias = "SKOverlayPositionBottomRaised")]
    pub const BottomRaised: Self = Self(1);
}

unsafe impl Encode for SKOverlayPosition {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

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

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

unsafe impl NSObjectProtocol for SKOverlayConfiguration {}

extern_methods!(
    unsafe impl SKOverlayConfiguration {
        #[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>;
    }
);

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

    unsafe impl ClassType for SKOverlayAppConfiguration {
        #[inherits(NSObject)]
        type Super = SKOverlayConfiguration;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for SKOverlayAppConfiguration {}

extern_methods!(
    unsafe impl SKOverlayAppConfiguration {
        #[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>;

        #[method_id(@__retain_semantics Init initWithAppIdentifier:position:)]
        pub unsafe fn initWithAppIdentifier_position(
            this: Allocated<Self>,
            app_identifier: &NSString,
            position: SKOverlayPosition,
        ) -> Retained<Self>;

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

        #[method(setAppIdentifier:)]
        pub unsafe fn setAppIdentifier(&self, app_identifier: &NSString);

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

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

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

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

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

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

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

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

        #[method(position)]
        pub unsafe fn position(&self) -> SKOverlayPosition;

        #[method(setPosition:)]
        pub unsafe fn setPosition(&self, position: SKOverlayPosition);

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

        #[method(setUserDismissible:)]
        pub unsafe fn setUserDismissible(&self, user_dismissible: bool);

        #[method(setAdditionalValue:forKey:)]
        pub unsafe fn setAdditionalValue_forKey(&self, value: Option<&AnyObject>, key: &NSString);

        #[method_id(@__retain_semantics Other additionalValueForKey:)]
        pub unsafe fn additionalValueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "SKAdImpression")]
        #[method(setAdImpression:)]
        pub unsafe fn setAdImpression(&self, impression: &SKAdImpression);
    }
);

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

    unsafe impl ClassType for SKOverlayAppClipConfiguration {
        #[inherits(NSObject)]
        type Super = SKOverlayConfiguration;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for SKOverlayAppClipConfiguration {}

extern_methods!(
    unsafe impl SKOverlayAppClipConfiguration {
        #[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>;

        #[method_id(@__retain_semantics Init initWithPosition:)]
        pub unsafe fn initWithPosition(
            this: Allocated<Self>,
            position: SKOverlayPosition,
        ) -> Retained<Self>;

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

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

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

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

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

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

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

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

        #[method(position)]
        pub unsafe fn position(&self) -> SKOverlayPosition;

        #[method(setPosition:)]
        pub unsafe fn setPosition(&self, position: SKOverlayPosition);

        #[method(setAdditionalValue:forKey:)]
        pub unsafe fn setAdditionalValue_forKey(&self, value: Option<&AnyObject>, key: &NSString);

        #[method_id(@__retain_semantics Other additionalValueForKey:)]
        pub unsafe fn additionalValueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;
    }
);