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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uieventattribution?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIEventAttribution;
);
extern_conformance!(
unsafe impl NSCopying for UIEventAttribution {}
);
unsafe impl CopyingHelper for UIEventAttribution {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIEventAttribution {}
);
impl UIEventAttribution {
extern_methods!(
/// 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.
///
/// This field corresponds to `source_id` in the subsequent attribution report.
#[unsafe(method(sourceIdentifier))]
#[unsafe(method_family = none)]
pub fn sourceIdentifier(&self) -> u8;
/// The destination URL of an attribution. For example, the link opened when an advertisement is tapped.
///
/// This field corresponds to `attributed_on_site` in the subsequent attribution report.
#[unsafe(method(destinationURL))]
#[unsafe(method_family = none)]
pub fn destinationURL(&self) -> Retained<NSURL>;
/// 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
/// as a string in your app's Info.plist under the `NSAdvertisingAttributionReportEndpoint` key.
///
/// This field corresponds to `source_site` in the subsequent attribution report.
#[unsafe(method(reportEndpoint))]
#[unsafe(method_family = none)]
pub fn reportEndpoint(&self) -> Option<Retained<NSURL>>;
/// 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.
///
/// The system may truncate this field if it is too long.
#[unsafe(method(sourceDescription))]
#[unsafe(method_family = none)]
pub fn sourceDescription(&self) -> Retained<NSString>;
/// 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.
///
/// The system may truncate this field if it is too long.
#[unsafe(method(purchaser))]
#[unsafe(method_family = none)]
pub fn purchaser(&self) -> Retained<NSString>;
/// Create a `UIEventAttribution` object.
///
///
/// Parameter `sourceIdentifier`: An identifier associated with the attribution.
///
/// Parameter `destinationURL`: The destination URL of the attribution.
///
/// Parameter `sourceDescription`: A high-level description of the content to be attributed. Pass in an empty string if no description is available.
///
/// Parameter `purchaser`: The name of the party that purchased the content to be attributed. Pass in an empty string if no name is available.
///
///
/// Returns: An instance of `UIEventAttribution` with the specified values for each field.
///
/// The `sourceDescription` and `purchaser` fields may be truncated by the system if they are too long.
#[unsafe(method(initWithSourceIdentifier:destinationURL:sourceDescription:purchaser:))]
#[unsafe(method_family = init)]
pub fn initWithSourceIdentifier_destinationURL_sourceDescription_purchaser(
this: Allocated<Self>,
source_identifier: u8,
destination_url: &NSURL,
source_description: &NSString,
purchaser: &NSString,
) -> Retained<Self>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
);
}