objc2_ui_kit/generated/
UIEventAttribution.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uieventattribution?language=objc)
11    #[unsafe(super(NSObject))]
12    #[thread_kind = MainThreadOnly]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct UIEventAttribution;
15);
16
17unsafe impl NSCopying for UIEventAttribution {}
18
19unsafe impl CopyingHelper for UIEventAttribution {
20    type Result = Self;
21}
22
23unsafe impl NSObjectProtocol for UIEventAttribution {}
24
25impl UIEventAttribution {
26    extern_methods!(
27        /// An identifier that is associated with the source of the attribution. For example, you may choose to use this as a campaign identifier to measure the effectiveness of different advertisement campaigns.
28        ///
29        /// This field corresponds to `source_id` in the subsequent attribution report.
30        #[unsafe(method(sourceIdentifier))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn sourceIdentifier(&self) -> u8;
33
34        /// The destination URL of an attribution. For example, the link opened when an advertisement is tapped.
35        ///
36        /// This field corresponds to `attributed_on_site` in the subsequent attribution report.
37        #[unsafe(method(destinationURL))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn destinationURL(&self) -> Retained<NSURL>;
40
41        /// The URL to which the attribution report will be sent. You do not provide this field at creation time. Instead, you must define the URL
42        /// as a string in your app's Info.plist under the `NSAdvertisingAttributionReportEndpoint` key.
43        ///
44        /// This field corresponds to `source_site` in the subsequent attribution report.
45        #[unsafe(method(reportEndpoint))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn reportEndpoint(&self) -> Option<Retained<NSURL>>;
48
49        /// A high-level description of the source of the attribution. For example, this could be a description of the content of an advertisement a user taps on.
50        ///
51        /// The system may truncate this field if it is too long.
52        #[unsafe(method(sourceDescription))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn sourceDescription(&self) -> Retained<NSString>;
55
56        /// The name of the party that purchased the content to be attributed. For example, this could be the name of the party that purchased the placement of an advertisement.
57        ///
58        /// The system may truncate this field if it is too long.
59        #[unsafe(method(purchaser))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn purchaser(&self) -> Retained<NSString>;
62
63        /// Create a `UIEventAttribution` object.
64        ///
65        ///
66        /// Parameter `sourceIdentifier`: An identifier associated with the attribution.
67        ///
68        /// Parameter `destinationURL`: The destination URL of the attribution.
69        ///
70        /// Parameter `sourceDescription`: A high-level description of the content to be attributed. Pass in an empty string if no description is available.
71        ///
72        /// Parameter `purchaser`: The name of the party that purchased the content to be attributed. Pass in an empty string if no name is available.
73        ///
74        ///
75        /// Returns: An instance of `UIEventAttribution` with the specified values for each field.
76        ///
77        /// The `sourceDescription` and `purchaser` fields may be truncated by the system if they are too long.
78        #[unsafe(method(initWithSourceIdentifier:destinationURL:sourceDescription:purchaser:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithSourceIdentifier_destinationURL_sourceDescription_purchaser(
81            this: Allocated<Self>,
82            source_identifier: u8,
83            destination_url: &NSURL,
84            source_description: &NSString,
85            purchaser: &NSString,
86        ) -> Retained<Self>;
87
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
95    );
96}