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
17extern_conformance!(
18 unsafe impl NSCopying for UIEventAttribution {}
19);
20
21unsafe impl CopyingHelper for UIEventAttribution {
22 type Result = Self;
23}
24
25extern_conformance!(
26 unsafe impl NSObjectProtocol for UIEventAttribution {}
27);
28
29impl UIEventAttribution {
30 extern_methods!(
31 /// 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.
32 ///
33 /// This field corresponds to `source_id` in the subsequent attribution report.
34 #[unsafe(method(sourceIdentifier))]
35 #[unsafe(method_family = none)]
36 pub fn sourceIdentifier(&self) -> u8;
37
38 /// The destination URL of an attribution. For example, the link opened when an advertisement is tapped.
39 ///
40 /// This field corresponds to `attributed_on_site` in the subsequent attribution report.
41 #[unsafe(method(destinationURL))]
42 #[unsafe(method_family = none)]
43 pub fn destinationURL(&self) -> Retained<NSURL>;
44
45 /// 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
46 /// as a string in your app's Info.plist under the `NSAdvertisingAttributionReportEndpoint` key.
47 ///
48 /// This field corresponds to `source_site` in the subsequent attribution report.
49 #[unsafe(method(reportEndpoint))]
50 #[unsafe(method_family = none)]
51 pub fn reportEndpoint(&self) -> Option<Retained<NSURL>>;
52
53 /// 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.
54 ///
55 /// The system may truncate this field if it is too long.
56 #[unsafe(method(sourceDescription))]
57 #[unsafe(method_family = none)]
58 pub fn sourceDescription(&self) -> Retained<NSString>;
59
60 /// 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.
61 ///
62 /// The system may truncate this field if it is too long.
63 #[unsafe(method(purchaser))]
64 #[unsafe(method_family = none)]
65 pub fn purchaser(&self) -> Retained<NSString>;
66
67 /// Create a `UIEventAttribution` object.
68 ///
69 ///
70 /// Parameter `sourceIdentifier`: An identifier associated with the attribution.
71 ///
72 /// Parameter `destinationURL`: The destination URL of the attribution.
73 ///
74 /// Parameter `sourceDescription`: A high-level description of the content to be attributed. Pass in an empty string if no description is available.
75 ///
76 /// Parameter `purchaser`: The name of the party that purchased the content to be attributed. Pass in an empty string if no name is available.
77 ///
78 ///
79 /// Returns: An instance of `UIEventAttribution` with the specified values for each field.
80 ///
81 /// The `sourceDescription` and `purchaser` fields may be truncated by the system if they are too long.
82 #[unsafe(method(initWithSourceIdentifier:destinationURL:sourceDescription:purchaser:))]
83 #[unsafe(method_family = init)]
84 pub fn initWithSourceIdentifier_destinationURL_sourceDescription_purchaser(
85 this: Allocated<Self>,
86 source_identifier: u8,
87 destination_url: &NSURL,
88 source_description: &NSString,
89 purchaser: &NSString,
90 ) -> Retained<Self>;
91
92 #[unsafe(method(init))]
93 #[unsafe(method_family = init)]
94 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
95
96 #[unsafe(method(new))]
97 #[unsafe(method_family = new)]
98 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
99 );
100}