objc2_metric_kit/generated/MXDiagnosticPayload.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 /// A wrapper class which contains a diagnostic payload and associated properties of that payload.
11 ///
12 /// MXDiagnosticPayload encapsulates currently supported diagnostics that can be vended by MetricKit. Arrays of MXDiangostic subclasses on MXDiagnosticPayload are nullable. If an array of MXDiagnostic subclasses is nil, it indicates that the diagnostics are not available for this payload.
13 ///
14 /// MXDiagnosticPayload exposes a convenience function, JSONRepresentation, to convert the contents of the payload to a human readable JSON. This should be used in conjunction with other APIs that accept NSData.
15 ///
16 /// An MXDiagnosticPayload contains diagnostics that cover a 24 hour period of application usage. The properties timeStampBegin and timeStampEnd should be used to determine which time range the payload covers.
17 ///
18 /// It is possible for an MXDiagnosticPayload to cover regions of time where an application was updated, and thus each MXDiagnostic subclass will contain its own application version string. This is in contrast to MXMetricPayload, where only the latest application version string is included as metadata of the payload. Each MXDiagnostic subclass application version string should be inspected prior to processing.
19 ///
20 /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxdiagnosticpayload?language=objc)
21 #[unsafe(super(NSObject))]
22 #[derive(Debug, PartialEq, Eq, Hash)]
23 pub struct MXDiagnosticPayload;
24);
25
26extern_conformance!(
27 unsafe impl NSCoding for MXDiagnosticPayload {}
28);
29
30extern_conformance!(
31 unsafe impl NSObjectProtocol for MXDiagnosticPayload {}
32);
33
34extern_conformance!(
35 unsafe impl NSSecureCoding for MXDiagnosticPayload {}
36);
37
38impl MXDiagnosticPayload {
39 extern_methods!(
40 #[cfg(all(feature = "MXCPUExceptionDiagnostic", feature = "MXDiagnostic"))]
41 /// An array containing CPU exception diagnostics for this application.
42 #[unsafe(method(cpuExceptionDiagnostics))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn cpuExceptionDiagnostics(
45 &self,
46 ) -> Option<Retained<NSArray<MXCPUExceptionDiagnostic>>>;
47
48 #[cfg(all(feature = "MXDiagnostic", feature = "MXDiskWriteExceptionDiagnostic"))]
49 /// An array containing disk write exception diagnostics for this application.
50 #[unsafe(method(diskWriteExceptionDiagnostics))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn diskWriteExceptionDiagnostics(
53 &self,
54 ) -> Option<Retained<NSArray<MXDiskWriteExceptionDiagnostic>>>;
55
56 #[cfg(all(feature = "MXDiagnostic", feature = "MXHangDiagnostic"))]
57 /// An array containing hang diagnostics for this application.
58 #[unsafe(method(hangDiagnostics))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn hangDiagnostics(&self) -> Option<Retained<NSArray<MXHangDiagnostic>>>;
61
62 #[cfg(all(feature = "MXAppLaunchDiagnostic", feature = "MXDiagnostic"))]
63 /// An array containing app launch diagnostics for this application.
64 #[unsafe(method(appLaunchDiagnostics))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn appLaunchDiagnostics(
67 &self,
68 ) -> Option<Retained<NSArray<MXAppLaunchDiagnostic>>>;
69
70 #[cfg(all(feature = "MXCrashDiagnostic", feature = "MXDiagnostic"))]
71 /// An array containing crash diagnostics for this application.
72 #[unsafe(method(crashDiagnostics))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn crashDiagnostics(&self) -> Option<Retained<NSArray<MXCrashDiagnostic>>>;
75
76 /// An NSDate object that indicates the start time for which the payload was generated.
77 #[unsafe(method(timeStampBegin))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn timeStampBegin(&self) -> Retained<NSDate>;
80
81 /// An NSDate object that indicates the end time for which the payload was generated.
82 #[unsafe(method(timeStampEnd))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn timeStampEnd(&self) -> Retained<NSDate>;
85
86 /// Convenience method to return a JSON representation of this diagnostic payload.
87 ///
88 /// Returns: An NSData object containing the JSON representation
89 #[unsafe(method(JSONRepresentation))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn JSONRepresentation(&self) -> Retained<NSData>;
92
93 /// Convenience method to return a NSDictionary representation of this diagnostic payload.
94 ///
95 /// Returns: An NSDictionary object containing the dictionary representation
96 #[unsafe(method(dictionaryRepresentation))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
99 );
100}
101
102/// Methods declared on superclass `NSObject`.
103impl MXDiagnosticPayload {
104 extern_methods!(
105 #[unsafe(method(init))]
106 #[unsafe(method_family = init)]
107 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109 #[unsafe(method(new))]
110 #[unsafe(method_family = new)]
111 pub unsafe fn new() -> Retained<Self>;
112 );
113}