From 66e6984c7d481f2970aee14fc610b01b2a2d95ee Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 27 Jul 2026 14:44:25 +1200 Subject: [PATCH 1/3] ref: migrate Cocoa bindings to SentryObjC surface (#5444, partial) Rebind the generated Sentry.Bindings.Cocoa surface from the classic Sentry* Objective-C classes to the new SentryObjC* classes (options, SDK entry point, event model, scope, enums, and debug images via [SentryObjCSDK internal].debug). - generate-cocoa-bindings.ps1 now binds the SentryObjC umbrella header only. - patch-cocoa-bindings.cs keeps the SentryObjC* surface the .NET SDK consumes and the public SDK entry points (startWithOptions/configureScope/crash) plus the hybrid `internal` accessor. - Consumers under src/Sentry/Platforms/Cocoa migrated to the SentryObjC* types; debug images now come from the structured internal.debug API. - PrivateApiDefinitions.cs keeps a minimal classic Sentry.framework remnant for the two holdouts that SentryObjC* does not yet expose: scope.applyToEvent enrichment (CocoaEventProcessor) and the SentrySerializable protocol used by envelope serialization. These are the "to be decided" parts of #5444 and are left as-is. This is a partial step: Sentry.xcframework is still shipped, so it does not close the issue. #skip-changelog Co-Authored-By: Claude Opus 4.8 --- scripts/generate-cocoa-bindings.ps1 | 17 +- scripts/patch-cocoa-bindings.cs | 164 +- src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 3649 ++++++----------- .../PrivateApiDefinitions.cs | 70 +- .../Sentry.Bindings.Cocoa.csproj | 8 +- src/Sentry.Bindings.Cocoa/StructsAndEnums.cs | 217 +- src/Sentry/Platforms/Cocoa/CFunctions.cs | 2 +- .../Platforms/Cocoa/CocoaEventProcessor.cs | 5 +- .../Cocoa/Extensions/BreadcrumbExtensions.cs | 4 +- .../Cocoa/Extensions/CocoaExtensions.cs | 8 +- .../Cocoa/Extensions/EnumExtensions.cs | 136 +- .../Cocoa/Extensions/MiscExtensions.cs | 6 +- .../Extensions/SamplingContextExtensions.cs | 2 +- .../Cocoa/Extensions/UserExtensions.cs | 6 +- .../Cocoa/Facades/TransactionContextFacade.cs | 4 +- src/Sentry/Platforms/Cocoa/Sentry.Cocoa.props | 8 +- src/Sentry/Platforms/Cocoa/SentrySdk.cs | 14 +- 17 files changed, 1500 insertions(+), 2820 deletions(-) diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index e1e368d73a..76dcd60415 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -114,6 +114,7 @@ foreach ($file in $filesToPatch) if (Test-Path $file) { $content = Get-Content -Path $file -Raw + $content = $content -replace ']+)>', '"$1"' $content = $content -replace ']+)>', '"$1"' $content = $content -replace '#\s*import SENTRY_HEADER\(([^)]+)\)', '#import "$1.h"' Set-Content -Path $file -Value $content @@ -155,18 +156,16 @@ else } # Generate bindings -# The SentryObjC*.h headers expose the structured hybrid API (SentryObjCSDK.internal) +# We bind the SentryObjC umbrella header only. It exposes the full public surface +# (options, SDK entry point, event model, scope, enums) plus the structured hybrid API +# (SentryObjCSDK.internal, incl. debug images) via SentryObjC* classes. The classic +# Sentry.framework ObjC surface is no longer bound here; the few remaining classic +# holdouts (scope.applyToEvent enrichment + the SentrySerializable protocol) are declared +# by hand in PrivateApiDefinitions.cs. See getsentry/sentry-dotnet#5444. Write-Output 'Generating bindings with Objective Sharpie.' sharpie bind -sdk $iPhoneSdkVersion ` -scope "$CocoaSdkPath" ` - "$HeadersPath/Sentry.h" ` - "$HeadersPath/Sentry-Swift.h" ` - "$HeadersPath/SentryObjCSDK.h" ` - "$HeadersPath/SentryObjCInternalApi.h" ` - "$HeadersPath/SentryObjCInternalSdkApi.h" ` - "$HeadersPath/SentryObjCInternalProfilingApi.h" ` - "$HeadersPath/SentryObjCId.h" ` - "$HeadersPath/SentryObjCSpanId.h" ` + "$HeadersPath/SentryObjC.h" ` -o $BindingsPath ` -c -Wno-objc-property-no-attribute ` -F"$iPhoneSdkPath/System/Library/SubFrameworks" # needed for UIUtilities.framework in Xcode 26+ diff --git a/scripts/patch-cocoa-bindings.cs b/scripts/patch-cocoa-bindings.cs index b9edea2de5..360c57d9ad 100644 --- a/scripts/patch-cocoa-bindings.cs +++ b/scripts/patch-cocoa-bindings.cs @@ -32,60 +32,29 @@ var nodes = tree.GetCompilationUnitRoot() .WithNamespace("Sentry.CocoaSdk") .RemoveClass("CFunctions") - // Fold Swift-extension categories back into their base interface. Objective Sharpie emits - // members declared in a Swift `extension` (e.g. the entire `SentrySDK` API since sentry-cocoa - // 9.19.1 moved its class body into an extension) as a separate `[Category]` interface with an - // auto-generated name like `SentrySDK_Sentry_Swift_8248`. Left alone, KeepInterfaces would drop - // it because that generated name isn't in the keep-list, silently emptying the SentrySDK binding. - .MergeInterface("SentrySDK_*", "SentrySDK") // Make enums, interfaces, and delegates internal .AsInternal("Sentry*", "internal") .WithAttribute("*Sentry*", "Internal") - // Adjust protocols (some are models) - .VerifyModel("SentryRedactOptions") - .VerifyModel("SentrySerializable") - .VerifyModel("SentrySpan") - .RemoveComment("SentryRRWebEvent", "[Model]") - .RemoveComment("SentryReplayBreadcrumbConverter", "[Model]") - .RemoveComment("SentryViewScreenshotProvider", "[Model]") - // Adjust base types - .WithAttribute("SentrySpan", "BaseType (typeof(NSObject))") - .WithAttribute("SentryRedactOptions", "BaseType (typeof(NSObject))") // Remove INSCopying due to https://github.com/xamarin/xamarin-macios/issues/17130 .RemoveBaseType("INSCopying") // Fix property-to-method conversions .PropertyToMethod("Sentry*", "Serialize") - .PropertyToMethod("SentrySpan", "ToTraceHeader") - .PropertyToMethod("SentryTraceContext", "ToBaggage") + .PropertyToMethod("SentryObjCSpan", "ToTraceHeader") + .PropertyToMethod("SentryObjCTraceContext", "ToBaggage") // Verify the rest .VerifyProperty("*Sentry*", "*", "MethodToProperty") // TODO: replace broad patterns with one-by-one verification - .VerifyProperty("SentryOptions", "*Targets", "StronglyTypedNSArray") + .VerifyProperty("SentryObjCOptions", "*Targets", "StronglyTypedNSArray") // Fix delegate argument names .RenameParameter("NSError", "arg*", "error") .RenameParameter("NSHttpUrlResponse", "arg*", "response") - .RenameParameter("SentryEvent", "arg*", "@event") - .RenameParameter("SentrySamplingContext", "arg*", "samplingContext") - .RenameParameter("SentryBreadcrumb", "arg*", "breadcrumb") - .RenameParameter("SentrySpan", "arg*", "span") - .RenameParameter("SentryLog", "arg*", "log") - .RenameParameter("SentryProfileOptions", "arg*", "options") - // Fix interface names - .RenameInterface("ISentrySerializable", "SentrySerializable") - .RenameInterface("ISentryRedactOptions", "SentryRedactOptions") - .RenameBaseType("ISentrySerializable", "SentrySerializable") - .RenameBaseType("ISentryRedactOptions", "SentryRedactOptions") - // Rename conflicting SentryRRWebEvent (protocol vs. interface) - .RenameProtocol("SentryRRWebEvent", "ISentryRRWebEvent") - // Adjust nullable return delegates (though broken until this is fixed: https://github.com/xamarin/xamarin-macios/issues/17109) - .WithAttribute("SentryBeforeBreadcrumbCallback", "return: NullAllowed") - .WithAttribute("SentryBeforeSendEventCallback", "return: NullAllowed") - .WithAttribute("SentryTracesSamplerCallback", "return: NullAllowed") + .RenameParameter("SentryObjCEvent", "arg*", "@event") + .RenameParameter("SentryObjCSamplingContext", "arg*", "samplingContext") + .RenameParameter("SentryObjCBreadcrumb", "arg*", "breadcrumb") + .RenameParameter("SentryObjCSpan", "arg*", "span") // Fix nullable property attributes - .WithPropertyAttribute("SentryOptions", "OnCrashedLastRun", "NullAllowed") + .WithPropertyAttribute("SentryObjCOptions", "OnCrashedLastRun", "NullAllowed") // Fix nullable generic type arguments - .ChangePropertyType("SentryOptions", "OnLastRunStatusDetermined", "Action") - // For PrivateApiDefinitions.cs - .WithModifier("SentryScope", "partial") + .ChangePropertyType("SentryObjCOptions", "OnLastRunStatusDetermined", "Action") // error CS0246: The type or namespace name 'iOS' could not be found .RemoveAttribute("iOS") // error CS0246: The type or namespace name 'Mac' could not be found @@ -96,92 +65,55 @@ .RemoveMethod("Sentry*", "IsEqual") // error CS0246: The type or namespace name '_NSZone' could not be found .RemoveMethod("Sentry*", "CopyWithZone") - // error CS0111: Type 'SentryAttribute' already defines a member called 'Constructor' with the same parameter types - .RemoveMethod("SentryLog", "SetAttribute") - // SentryLoggerDelegate and SentryCurrentDateProvider are not whitelisted - .RemoveMethod("SentryLogger", "Constructor") - // SentryAppStartMeasurement is not whitelisted - .RemoveDelegate("SentryOnAppStartMeasurementAvailable") - // unused - .RemoveDelegate("SentryUserFeedbackConfigurationBlock") // error CS0114: 'SentryXxx.Description' hides inherited member 'NSObject.Description'. .RemoveProperty("Sentry*", "Description") - // Minimize SentryDependencyContainer - .RemoveMethod("SentryDependencyContainer", "*") - .KeepProperties("SentryDependencyContainer", "SharedInstance", "DebugImageProvider") - // SentryUserFeedbackConfiguration is not whitelisted - .RemoveProperty("SentryOptions", "ConfigureUserFeedback") - .RemoveProperty("SentryOptions", "UserFeedbackConfiguration") - // SentryObjCSDK.internal is the entry point to the API for hybrid SDKs - // We only bind the `internal` accessor; every other SentryObjCSDK member references SentryObjC* - // types we don't whitelist. - .KeepProperties("SentryObjCSDK", "Internal") - .RemoveMethod("SentryObjCSDK", "*") - .KeepProperties("SentryObjCInternalApi", "Sdk", "Profiling") + // Option properties that reference SentryObjC* types the .NET SDK doesn't whitelist. + .RemoveProperty("SentryObjCOptions", "BeforeSendLog") + .RemoveProperty("SentryObjCOptions", "BeforeSendMetric") + .RemoveProperty("SentryObjCOptions", "ConfigureUserFeedback") + // SentryObjCSDK is both the public entry point and the hybrid-SDK gateway (via `internal`). + // Keep the public members the .NET SDK calls plus the `internal` accessor; drop the rest, whose + // signatures reference SentryObjC* types we don't whitelist. + .KeepMethods("SentryObjCSDK", "StartWithOptions", "ConfigureScope", "Crash") + .KeepProperties("SentryObjCSDK", "Internal", "CrashedLastRun") + // SentryObjCInternalApi: keep only the sub-APIs the .NET SDK uses (sdk, profiling, debug). + .KeepProperties("SentryObjCInternalApi", "Sdk", "Profiling", "Debug") .KeepMethods("SentryObjCInternalApi", "SetTrace", "IgnoreNextSignal") - // Sharpie generates enums for types the SentryObjC headers reference, but the members that used - // them are trimmed above - drop the dead enums - .RemoveEnum("SentryObjC*") .KeepInterfaces( - "ISentryRRWebEvent", - "SentryAttachment", - "SentryBaggage", - "SentryBreadcrumb", - "SentryClient", - "SentryDebugImageProvider", - "SentryDebugMeta", - "SentryDependencyContainer", - "SentryDsn", - "SentryEvent", - "SentryException", - "SentryExperimentalOptions", - "SentryFeedback", - "SentryFeedbackAPI", - "SentryFrame", - "SentryGeo", - "SentryHttpStatusCodeRange", - "SentryHub", - "SentryId", - "SentryLog", - "SentryLogger", - "SentryMeasurementUnit", - "SentryMeasurementUnitDuration", - "SentryMeasurementUnitFraction", - "SentryMeasurementUnitInformation", - "SentryMechanism", - "SentryMechanismContext", - "SentryMessage", - "SentryNSError", + "SentryObjCAttachment", + "SentryObjCBreadcrumb", + "SentryObjCDebugMeta", + "SentryObjCEvent", + "SentryObjCException", + "SentryObjCExperimentalOptions", + "SentryObjCFrame", + "SentryObjCGeo", + "SentryObjCHttpStatusCodeRange", "SentryObjCId", "SentryObjCInternalApi", + "SentryObjCInternalDebugApi", "SentryObjCInternalProfilingApi", "SentryObjCInternalSdkApi", + "SentryObjCMeasurementUnit", + "SentryObjCMechanism", + "SentryObjCMechanismContext", + "SentryObjCMessage", + "SentryObjCNSError", + "SentryObjCOptions", + "SentryObjCReplayOptions", + "SentryObjCRequest", + "SentryObjCSamplingContext", + "SentryObjCScope", "SentryObjCSDK", + "SentryObjCSpan", + "SentryObjCSpanContext", "SentryObjCSpanId", - "SentryOptions", - "SentryProfileOptions", - "SentryRedactOptions", - "SentryReplayApi", - "SentryReplayBreadcrumbConverter", - "SentryReplayOptions", - "SentryRequest", - "SentryRRWebEvent", - "SentrySamplingContext", - "SentryScope", - "SentryScreenFrames", - "SentrySDK", - "SentrySerializable", - "SentrySpan", - "SentrySpanContext", - "SentrySpanId", - "SentryStacktrace", - "SentryThread", - "SentryTraceContext", - "SentryTraceHeader", - "SentryTransactionContext", - "SentryUser", - "SentryViewScreenshotOptions", - "SentryViewScreenshotProvider" + "SentryObjCStacktrace", + "SentryObjCThread", + "SentryObjCTraceContext", + "SentryObjCTraceHeader", + "SentryObjCTransactionContext", + "SentryObjCUser" ) // error CS0311: The type 'SentryXxx' cannot be used as type parameter 'TValue' in the generic type or method 'NSDictionary'. .ChangeGenericTypeArgument("NSDictionary", "Sentry*", "NSObject"); diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index d31e25a341..b33e426077 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -7,756 +7,609 @@ #nullable enable using System; -using CoreFoundation; -using CoreGraphics; using Foundation; using ObjCRuntime; using UIKit; namespace Sentry.CocoaSdk; -// typedef void (^SentryRequestFinished)(NSError * _Nullable); -[Internal] -delegate void SentryRequestFinished([NullAllowed] NSError error); - -// typedef void (^SentryRequestOperationFinished)(NSHTTPURLResponse * _Nullable, NSError * _Nullable); -[Internal] -delegate void SentryRequestOperationFinished([NullAllowed] NSHttpUrlResponse response, [NullAllowed] NSError error); - -// typedef SentryBreadcrumb * _Nullable (^SentryBeforeBreadcrumbCallback)(SentryBreadcrumb * _Nonnull); +// @interface SentryObjCDebugMeta : NSObject +[BaseType(typeof(NSObject))] [Internal] -[return: NullAllowed] -delegate SentryBreadcrumb SentryBeforeBreadcrumbCallback(SentryBreadcrumb breadcrumb); +interface SentryObjCDebugMeta +{ + // @property (copy, nonatomic) NSString * _Nullable debugID; + [NullAllowed, Export("debugID")] + string DebugID { get; set; } -// typedef SentryEvent * _Nullable (^SentryBeforeSendEventCallback)(SentryEvent * _Nonnull); -[Internal] -[return: NullAllowed] -delegate SentryEvent SentryBeforeSendEventCallback(SentryEvent @event); + // @property (copy, nonatomic) NSString * _Nullable type; + [NullAllowed, Export("type")] + string Type { get; set; } -// typedef id _Nullable (^SentryBeforeSendSpanCallback)(id _Nonnull); -[Internal] -delegate SentrySpan SentryBeforeSendSpanCallback(SentrySpan span); + // @property (copy, nonatomic) NSNumber * _Nullable imageSize; + [NullAllowed, Export("imageSize", ArgumentSemantic.Copy)] + NSNumber ImageSize { get; set; } -// typedef BOOL (^SentryBeforeCaptureScreenshotCallback)(SentryEvent * _Nonnull); -[Internal] -delegate bool SentryBeforeCaptureScreenshotCallback(SentryEvent @event); + // @property (copy, nonatomic) NSString * _Nullable imageAddress; + [NullAllowed, Export("imageAddress")] + string ImageAddress { get; set; } -// typedef BOOL (^SentryBeforeCaptureViewHierarchyCallback)(SentryEvent * _Nonnull); -[Internal] -delegate bool SentryBeforeCaptureViewHierarchyCallback(SentryEvent @event); + // @property (assign, nonatomic) uint64_t imageAddressRaw; + [Export("imageAddressRaw")] + ulong ImageAddressRaw { get; set; } -// typedef void (^SentryOnCrashedLastRunCallback)(SentryEvent * _Nonnull); -[Internal] -delegate void SentryOnCrashedLastRunCallback(SentryEvent @event); + // @property (copy, nonatomic) NSString * _Nullable imageVmAddress; + [NullAllowed, Export("imageVmAddress")] + string ImageVmAddress { get; set; } -// typedef BOOL (^SentryShouldQueueEvent)(NSHTTPURLResponse * _Nullable, NSError * _Nullable); -[Internal] -delegate bool SentryShouldQueueEvent([NullAllowed] NSHttpUrlResponse response, [NullAllowed] NSError error); + // @property (assign, nonatomic) uint64_t imageVmAddressRaw; + [Export("imageVmAddressRaw")] + ulong ImageVmAddressRaw { get; set; } -// typedef NSNumber * _Nullable (^SentryTracesSamplerCallback)(SentrySamplingContext * _Nonnull); -[Internal] -[return: NullAllowed] -delegate NSNumber SentryTracesSamplerCallback(SentrySamplingContext samplingContext); + // @property (copy, nonatomic) NSString * _Nullable codeFile; + [NullAllowed, Export("codeFile")] + string CodeFile { get; set; } +} -// @interface SentryAttachment : NSObject +// @interface SentryObjCFrame : NSObject [BaseType(typeof(NSObject))] -[DisableDefaultCtor] [Internal] -interface SentryAttachment +interface SentryObjCFrame { - // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename; - [Export("initWithData:filename:")] - NativeHandle Constructor(NSData data, string filename); - - // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType; - [Export("initWithData:filename:contentType:")] - NativeHandle Constructor(NSData data, string filename, [NullAllowed] string contentType); - - // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path; - [Export("initWithPath:")] - NativeHandle Constructor(string path); + // @property (copy, nonatomic) NSString * _Nullable symbolAddress; + [NullAllowed, Export("symbolAddress")] + string SymbolAddress { get; set; } - // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename; - [Export("initWithPath:filename:")] - NativeHandle Constructor(string path, string filename); + // @property (copy, nonatomic) NSString * _Nullable fileName; + [NullAllowed, Export("fileName")] + string FileName { get; set; } - // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType; - [Export("initWithPath:filename:contentType:")] - NativeHandle Constructor(string path, string filename, [NullAllowed] string contentType); + // @property (copy, nonatomic) NSString * _Nullable function; + [NullAllowed, Export("function")] + string Function { get; set; } - // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType attachmentType:(SentryAttachmentType)attachmentType; - [Export("initWithData:filename:contentType:attachmentType:")] - NativeHandle Constructor(NSData data, string filename, [NullAllowed] string contentType, SentryAttachmentType attachmentType); + // @property (copy, nonatomic) NSString * _Nullable module; + [NullAllowed, Export("module")] + string Module { get; set; } - // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType attachmentType:(SentryAttachmentType)attachmentType; - [Export("initWithPath:filename:contentType:attachmentType:")] - NativeHandle Constructor(string path, string filename, [NullAllowed] string contentType, SentryAttachmentType attachmentType); + // @property (copy, nonatomic) NSString * _Nullable package; + [NullAllowed, Export("package")] + string Package { get; set; } - // @property (readonly, nonatomic, strong) NSData * _Nullable data; - [NullAllowed, Export("data", ArgumentSemantic.Strong)] - NSData Data { get; } + // @property (copy, nonatomic) NSString * _Nullable imageAddress; + [NullAllowed, Export("imageAddress")] + string ImageAddress { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nullable path; - [NullAllowed, Export("path")] - string Path { get; } + // @property (copy, nonatomic) NSString * _Nullable platform; + [NullAllowed, Export("platform")] + string Platform { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nonnull filename; - [Export("filename")] - string Filename { get; } + // @property (copy, nonatomic) NSString * _Nullable instructionAddress; + [NullAllowed, Export("instructionAddress")] + string InstructionAddress { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nullable contentType; - [NullAllowed, Export("contentType")] - string ContentType { get; } + // @property (copy, nonatomic) NSNumber * _Nullable lineNumber; + [NullAllowed, Export("lineNumber", ArgumentSemantic.Copy)] + NSNumber LineNumber { get; set; } - // @property (readonly, nonatomic) SentryAttachmentType attachmentType; - [Export("attachmentType")] - SentryAttachmentType AttachmentType { get; } -} + // @property (copy, nonatomic) NSNumber * _Nullable columnNumber; + [NullAllowed, Export("columnNumber", ArgumentSemantic.Copy)] + NSNumber ColumnNumber { get; set; } -// @interface SentryBaggage : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryBaggage -{ - // @property (readonly, nonatomic) SentryId * _Nonnull traceId; - [Export("traceId")] - SentryId TraceId { get; } + // @property (copy, nonatomic) NSString * _Nullable contextLine; + [NullAllowed, Export("contextLine")] + string ContextLine { get; set; } - // @property (readonly, nonatomic) NSString * _Nonnull publicKey; - [Export("publicKey")] - string PublicKey { get; } + // @property (copy, nonatomic) NSNumber * _Nullable parentIndex; + [NullAllowed, Export("parentIndex", ArgumentSemantic.Copy)] + NSNumber ParentIndex { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable releaseName; - [NullAllowed, Export("releaseName")] - string ReleaseName { get; } + // @property (copy, nonatomic) NSNumber * _Nullable sampleCount; + [NullAllowed, Export("sampleCount", ArgumentSemantic.Copy)] + NSNumber SampleCount { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable environment; - [NullAllowed, Export("environment")] - string Environment { get; } + // @property (copy, nonatomic) NSArray * _Nullable preContext; + [NullAllowed, Export("preContext", ArgumentSemantic.Copy)] + string[] PreContext { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable transaction; - [NullAllowed, Export("transaction")] - string Transaction { get; } + // @property (copy, nonatomic) NSArray * _Nullable postContext; + [NullAllowed, Export("postContext", ArgumentSemantic.Copy)] + string[] PostContext { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable userId; - [NullAllowed, Export("userId")] - string UserId { get; } + // @property (copy, nonatomic) NSNumber * _Nullable inApp; + [NullAllowed, Export("inApp", ArgumentSemantic.Copy)] + NSNumber InApp { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable sampleRand; - [NullAllowed, Export("sampleRand")] - string SampleRand { get; } + // @property (copy, nonatomic) NSNumber * _Nullable stackStart; + [NullAllowed, Export("stackStart", ArgumentSemantic.Copy)] + NSNumber StackStart { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable sampleRate; - [NullAllowed, Export("sampleRate")] - string SampleRate { get; } + // @property (copy, nonatomic) NSDictionary * _Nullable vars; + [NullAllowed, Export("vars", ArgumentSemantic.Copy)] + NSDictionary Vars { get; set; } +} - // @property (nonatomic, strong) NSString * _Nullable sampled; - [NullAllowed, Export("sampled", ArgumentSemantic.Strong)] - string Sampled { get; set; } +// @interface SentryObjCGeo : NSObject +[BaseType(typeof(NSObject))] +[Internal] +interface SentryObjCGeo +{ + // @property (copy, nonatomic) NSString * _Nullable city; + [NullAllowed, Export("city")] + string City { get; set; } - // @property (nonatomic, strong) NSString * _Nullable replayId; - [NullAllowed, Export("replayId", ArgumentSemantic.Strong)] - string ReplayId { get; set; } + // @property (copy, nonatomic) NSString * _Nullable countryCode; + [NullAllowed, Export("countryCode")] + string CountryCode { get; set; } - // @property (readonly, nonatomic) NSString * _Nullable orgId; - [NullAllowed, Export("orgId")] - string OrgId { get; } + // @property (copy, nonatomic) NSString * _Nullable region; + [NullAllowed, Export("region")] + string Region { get; set; } +} - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction sampleRate:(NSString * _Nullable)sampleRate sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId; - [Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampled:replayId:")] - NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampled, [NullAllowed] string replayId); +// @interface SentryObjCHttpStatusCodeRange : NSObject +[BaseType(typeof(NSObject))] +[DisableDefaultCtor] +[Internal] +interface SentryObjCHttpStatusCodeRange +{ + // @property (readonly, nonatomic) NSInteger min; + [Export("min")] + nint Min { get; } - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction sampleRate:(NSString * _Nullable)sampleRate sampleRand:(NSString * _Nullable)sampleRand sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId; - [Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampleRand:sampled:replayId:")] - NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId); + // @property (readonly, nonatomic) NSInteger max; + [Export("max")] + nint Max { get; } - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction sampleRate:(NSString * _Nullable)sampleRate sampleRand:(NSString * _Nullable)sampleRand sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId orgId:(NSString * _Nullable)orgId; - [Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampleRand:sampled:replayId:orgId:")] - NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId, [NullAllowed] string orgId); + // -(instancetype _Nonnull)initWithMin:(NSInteger)min max:(NSInteger)max; + [Export("initWithMin:max:")] + NativeHandle Constructor(nint min, nint max); - // -(NSString * _Nonnull)toHTTPHeaderWithOriginalBaggage:(NSDictionary * _Nullable)originalBaggage; - [Export("toHTTPHeaderWithOriginalBaggage:")] - string ToHTTPHeaderWithOriginalBaggage([NullAllowed] NSDictionary originalBaggage); + // -(instancetype _Nonnull)initWithStatusCode:(NSInteger)statusCode; + [Export("initWithStatusCode:")] + NativeHandle Constructor(nint statusCode); } -// @protocol SentrySerializable -[Protocol] +// @interface SentryObjCId : NSObject [BaseType(typeof(NSObject))] -[DisableDefaultCtor] [Internal] -[Model] -interface SentrySerializable +interface SentryObjCId { - // @required -(NSDictionary * _Nonnull)serialize; - [Abstract] - [Export("serialize")] - NSDictionary Serialize(); + // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; + [Export("sentryIdString")] + string SentryIdString { get; } + + // @property (readonly, nonatomic, strong, class) SentryObjCId * _Nonnull empty; + [Static] + [Export("empty", ArgumentSemantic.Strong)] + SentryObjCId Empty { get; } + + // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid; + [Export("initWithUuid:")] + NativeHandle Constructor(NSUuid uuid); + + // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString; + [Export("initWithUUIDString:")] + NativeHandle Constructor(string uuidString); } -// @interface SentryBreadcrumb : NSObject +// @interface SentryObjCMeasurementUnit : NSObject [BaseType(typeof(NSObject))] +[DisableDefaultCtor] [Internal] -interface SentryBreadcrumb : SentrySerializable +interface SentryObjCMeasurementUnit { - // @property (nonatomic) SentryLevel level; - [Export("level", ArgumentSemantic.Assign)] - SentryLevel Level { get; set; } + // @property (readonly, copy, nonatomic) NSString * _Nonnull unit; + [Export("unit")] + string Unit { get; } - // @property (copy, nonatomic) NSString * _Nonnull category; - [Export("category")] - string Category { get; set; } + // -(instancetype _Nonnull)initWithUnit:(NSString * _Nonnull)unit; + [Export("initWithUnit:")] + NativeHandle Constructor(string unit); - // @property (nonatomic, strong) NSDate * _Nullable timestamp; - [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] - NSDate Timestamp { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull none; + [Static] + [Export("none", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit None { get; } - // @property (copy, nonatomic) NSString * _Nullable type; - [NullAllowed, Export("type")] - string Type { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull nanosecond; + [Static] + [Export("nanosecond", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Nanosecond { get; } - // @property (copy, nonatomic) NSString * _Nullable message; - [NullAllowed, Export("message")] - string Message { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull microsecond; + [Static] + [Export("microsecond", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Microsecond { get; } - // @property (copy, nonatomic) NSString * _Nullable origin; - [NullAllowed, Export("origin")] - string Origin { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull millisecond; + [Static] + [Export("millisecond", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Millisecond { get; } - // @property (copy, nonatomic) NSDictionary * _Nullable data; - [NullAllowed, Export("data", ArgumentSemantic.Copy)] - NSDictionary Data { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull second; + [Static] + [Export("second", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Second { get; } - // -(instancetype _Nonnull)initWithLevel:(SentryLevel)level category:(NSString * _Nonnull)category; - [Export("initWithLevel:category:")] - NativeHandle Constructor(SentryLevel level, string category); + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull minute; + [Static] + [Export("minute", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Minute { get; } - // -(NSDictionary * _Nonnull)serialize; - [Export("serialize")] - NSDictionary Serialize(); + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull hour; + [Static] + [Export("hour", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Hour { get; } - // -(BOOL)isEqualToBreadcrumb:(SentryBreadcrumb * _Nonnull)breadcrumb; - [Export("isEqualToBreadcrumb:")] - bool IsEqualToBreadcrumb(SentryBreadcrumb breadcrumb); + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull day; + [Static] + [Export("day", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Day { get; } - // -(NSUInteger)hash; - [Export("hash")] - nuint Hash { get; } -} + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull week; + [Static] + [Export("week", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Week { get; } -// @interface SentryDebugMeta : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryDebugMeta : SentrySerializable -{ - // @property (copy, nonatomic) NSString * _Nullable debugID; - [NullAllowed, Export("debugID")] - string DebugID { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull bit; + [Static] + [Export("bit", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Bit { get; } - // @property (copy, nonatomic) NSString * _Nullable type; - [NullAllowed, Export("type")] - string Type { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull byte; + [Static] + [Export("byte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Byte { get; } - // @property (copy, nonatomic) NSNumber * _Nullable imageSize; - [NullAllowed, Export("imageSize", ArgumentSemantic.Copy)] - NSNumber ImageSize { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull kilobyte; + [Static] + [Export("kilobyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Kilobyte { get; } - // @property (copy, nonatomic) NSString * _Nullable imageAddress; - [NullAllowed, Export("imageAddress")] - string ImageAddress { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull kibibyte; + [Static] + [Export("kibibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Kibibyte { get; } - // @property (assign, nonatomic) uint64_t imageAddressRaw; - [Export("imageAddressRaw")] - ulong ImageAddressRaw { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull megabyte; + [Static] + [Export("megabyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Megabyte { get; } - // @property (copy, nonatomic) NSString * _Nullable imageVmAddress; - [NullAllowed, Export("imageVmAddress")] - string ImageVmAddress { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull mebibyte; + [Static] + [Export("mebibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Mebibyte { get; } - // @property (assign, nonatomic) uint64_t imageVmAddressRaw; - [Export("imageVmAddressRaw")] - ulong ImageVmAddressRaw { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull gigabyte; + [Static] + [Export("gigabyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Gigabyte { get; } - // @property (copy, nonatomic) NSString * _Nullable codeFile; - [NullAllowed, Export("codeFile")] - string CodeFile { get; set; } -} + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull gibibyte; + [Static] + [Export("gibibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Gibibyte { get; } -// @interface SentryEvent : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryEvent : SentrySerializable -{ - // @property (nonatomic, strong) SentryId * _Nonnull eventId; - [Export("eventId", ArgumentSemantic.Strong)] - SentryId EventId { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull terabyte; + [Static] + [Export("terabyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Terabyte { get; } - // @property (nonatomic, strong) SentryMessage * _Nullable message; - [NullAllowed, Export("message", ArgumentSemantic.Strong)] - SentryMessage Message { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull tebibyte; + [Static] + [Export("tebibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Tebibyte { get; } - // @property (copy, nonatomic) NSError * _Nullable error; - [NullAllowed, Export("error", ArgumentSemantic.Copy)] - NSError Error { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull petabyte; + [Static] + [Export("petabyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Petabyte { get; } - // @property (nonatomic, strong) NSDate * _Nullable timestamp; - [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] - NSDate Timestamp { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull pebibyte; + [Static] + [Export("pebibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Pebibyte { get; } - // @property (nonatomic, strong) NSDate * _Nullable startTimestamp; - [NullAllowed, Export("startTimestamp", ArgumentSemantic.Strong)] - NSDate StartTimestamp { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull exabyte; + [Static] + [Export("exabyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Exabyte { get; } - // @property (nonatomic) SentryLevel level; - [Export("level", ArgumentSemantic.Assign)] - SentryLevel Level { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull exbibyte; + [Static] + [Export("exbibyte", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Exbibyte { get; } - // @property (copy, nonatomic) NSString * _Nonnull platform; - [Export("platform")] - string Platform { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull ratio; + [Static] + [Export("ratio", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Ratio { get; } - // @property (copy, nonatomic) NSString * _Nullable logger; - [NullAllowed, Export("logger")] - string Logger { get; set; } + // @property (readonly, copy, nonatomic, class) SentryObjCMeasurementUnit * _Nonnull percent; + [Static] + [Export("percent", ArgumentSemantic.Copy)] + SentryObjCMeasurementUnit Percent { get; } +} - // @property (copy, nonatomic) NSString * _Nullable serverName; - [NullAllowed, Export("serverName")] - string ServerName { get; set; } +// @interface SentryObjCMechanismContext : NSObject +[BaseType(typeof(NSObject))] +[Internal] +interface SentryObjCMechanismContext +{ + // @property (nonatomic, strong) NSDictionary * _Nullable signal; + [NullAllowed, Export("signal", ArgumentSemantic.Strong)] + NSDictionary Signal { get; set; } - // @property (copy, nonatomic) NSString * _Nullable releaseName; - [NullAllowed, Export("releaseName")] - string ReleaseName { get; set; } + // @property (nonatomic, strong) NSDictionary * _Nullable machException; + [NullAllowed, Export("machException", ArgumentSemantic.Strong)] + NSDictionary MachException { get; set; } - // @property (copy, nonatomic) NSString * _Nullable dist; - [NullAllowed, Export("dist")] - string Dist { get; set; } + // @property (nonatomic, strong) SentryObjCNSError * _Nullable error; + [NullAllowed, Export("error", ArgumentSemantic.Strong)] + SentryObjCNSError Error { get; set; } +} - // @property (copy, nonatomic) NSString * _Nullable environment; - [NullAllowed, Export("environment")] - string Environment { get; set; } +// @interface SentryObjCMessage : NSObject +[BaseType(typeof(NSObject))] +[DisableDefaultCtor] +[Internal] +interface SentryObjCMessage +{ + // @property (readonly, copy, nonatomic) NSString * _Nonnull formatted; + [Export("formatted")] + string Formatted { get; } - // @property (copy, nonatomic) NSString * _Nullable transaction; - [NullAllowed, Export("transaction")] - string Transaction { get; set; } + // @property (copy, nonatomic) NSString * _Nullable message; + [NullAllowed, Export("message")] + string Message { get; set; } - // @property (copy, nonatomic) NSString * _Nullable type; - [NullAllowed, Export("type")] - string Type { get; set; } + // @property (nonatomic, strong) NSArray * _Nullable params; + [NullAllowed, Export("params", ArgumentSemantic.Strong)] + string[] Params { get; set; } - // @property (nonatomic, strong) NSDictionary * _Nullable tags; - [NullAllowed, Export("tags", ArgumentSemantic.Strong)] - NSDictionary Tags { get; set; } + // -(instancetype _Nonnull)initWithFormatted:(NSString * _Nonnull)formatted; + [Export("initWithFormatted:")] + NativeHandle Constructor(string formatted); +} - // @property (nonatomic, strong) NSDictionary * _Nullable extra; - [NullAllowed, Export("extra", ArgumentSemantic.Strong)] - NSDictionary Extra { get; set; } +// @interface SentryObjCNSError : NSObject +[BaseType(typeof(NSObject))] +[DisableDefaultCtor] +[Internal] +interface SentryObjCNSError +{ + // @property (copy, nonatomic) NSString * _Nonnull domain; + [Export("domain")] + string Domain { get; set; } - // @property (nonatomic, strong) NSDictionary * _Nullable sdk; - [NullAllowed, Export("sdk", ArgumentSemantic.Strong)] - NSDictionary Sdk { get; set; } + // @property (assign, nonatomic) NSInteger code; + [Export("code")] + nint Code { get; set; } - // @property (nonatomic, strong) NSDictionary * _Nullable modules; - [NullAllowed, Export("modules", ArgumentSemantic.Strong)] - NSDictionary Modules { get; set; } + // -(instancetype _Nonnull)initWithDomain:(NSString * _Nonnull)domain code:(NSInteger)code; + [Export("initWithDomain:code:")] + NativeHandle Constructor(string domain, nint code); +} - // @property (nonatomic, strong) NSArray * _Nullable fingerprint; - [NullAllowed, Export("fingerprint", ArgumentSemantic.Strong)] - string[] Fingerprint { get; set; } +// @interface SentryObjCRequest : NSObject +[BaseType(typeof(NSObject))] +[Internal] +interface SentryObjCRequest +{ + // @property (copy, nonatomic) NSNumber * _Nullable bodySize; + [NullAllowed, Export("bodySize", ArgumentSemantic.Copy)] + NSNumber BodySize { get; set; } - // @property (nonatomic, strong) SentryUser * _Nullable user; - [NullAllowed, Export("user", ArgumentSemantic.Strong)] - SentryUser User { get; set; } + // @property (copy, nonatomic) NSString * _Nullable cookies; + [NullAllowed, Export("cookies")] + string Cookies { get; set; } - // @property (nonatomic, strong) NSDictionary *> * _Nullable context; - [NullAllowed, Export("context", ArgumentSemantic.Strong)] - NSDictionary> Context { get; set; } + // @property (nonatomic, strong) NSDictionary * _Nullable headers; + [NullAllowed, Export("headers", ArgumentSemantic.Strong)] + NSDictionary Headers { get; set; } - // @property (nonatomic, strong) NSArray * _Nullable threads; - [NullAllowed, Export("threads", ArgumentSemantic.Strong)] - SentryThread[] Threads { get; set; } + // @property (copy, nonatomic) NSString * _Nullable fragment; + [NullAllowed, Export("fragment")] + string Fragment { get; set; } - // @property (nonatomic, strong) NSArray * _Nullable exceptions; - [NullAllowed, Export("exceptions", ArgumentSemantic.Strong)] - SentryException[] Exceptions { get; set; } + // @property (copy, nonatomic) NSString * _Nullable method; + [NullAllowed, Export("method")] + string Method { get; set; } - // @property (nonatomic, strong) SentryStacktrace * _Nullable stacktrace; - [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] - SentryStacktrace Stacktrace { get; set; } + // @property (copy, nonatomic) NSString * _Nullable queryString; + [NullAllowed, Export("queryString")] + string QueryString { get; set; } - // @property (nonatomic, strong) NSArray * _Nullable debugMeta; - [NullAllowed, Export("debugMeta", ArgumentSemantic.Strong)] - SentryDebugMeta[] DebugMeta { get; set; } + // @property (copy, nonatomic) NSString * _Nullable url; + [NullAllowed, Export("url")] + string Url { get; set; } +} - // @property (nonatomic, strong) NSArray * _Nullable breadcrumbs; - [NullAllowed, Export("breadcrumbs", ArgumentSemantic.Strong)] - SentryBreadcrumb[] Breadcrumbs { get; set; } +// @interface SentryObjCSpanId : NSObject +[BaseType(typeof(NSObject))] +[Internal] +interface SentryObjCSpanId +{ + // @property (readonly, copy, nonatomic) NSString * _Nonnull sentrySpanIdString; + [Export("sentrySpanIdString")] + string SentrySpanIdString { get; } - // @property (nonatomic, strong) SentryRequest * _Nullable request; - [NullAllowed, Export("request", ArgumentSemantic.Strong)] - SentryRequest Request { get; set; } + // @property (readonly, nonatomic, strong, class) SentryObjCSpanId * _Nonnull empty; + [Static] + [Export("empty", ArgumentSemantic.Strong)] + SentryObjCSpanId Empty { get; } - // -(instancetype _Nonnull)initWithLevel:(enum SentryLevel)level __attribute__((objc_designated_initializer)); - [Export("initWithLevel:")] - [DesignatedInitializer] - NativeHandle Constructor(SentryLevel level); + // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid; + [Export("initWithUuid:")] + NativeHandle Constructor(NSUuid uuid); - // -(instancetype _Nonnull)initWithError:(NSError * _Nonnull)error; - [Export("initWithError:")] - NativeHandle Constructor(NSError error); + // -(instancetype _Nonnull)initWithValue:(NSString * _Nonnull)value; + [Export("initWithValue:")] + NativeHandle Constructor(string value); } -// @interface SentryException : NSObject +// @interface SentryObjCTraceHeader : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryException : SentrySerializable +interface SentryObjCTraceHeader { - // @property (copy, nonatomic) NSString * _Nullable value; - [NullAllowed, Export("value")] - string Value { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable type; - [NullAllowed, Export("type")] - string Type { get; set; } - - // @property (nonatomic, strong) SentryMechanism * _Nullable mechanism; - [NullAllowed, Export("mechanism", ArgumentSemantic.Strong)] - SentryMechanism Mechanism { get; set; } + // @property (readonly, nonatomic, strong) SentryObjCId * _Nonnull traceId; + [Export("traceId", ArgumentSemantic.Strong)] + SentryObjCId TraceId { get; } - // @property (copy, nonatomic) NSString * _Nullable module; - [NullAllowed, Export("module")] - string Module { get; set; } + // @property (readonly, nonatomic, strong) SentryObjCSpanId * _Nonnull spanId; + [Export("spanId", ArgumentSemantic.Strong)] + SentryObjCSpanId SpanId { get; } - // @property (copy, nonatomic) NSNumber * _Nullable threadId; - [NullAllowed, Export("threadId", ArgumentSemantic.Copy)] - NSNumber ThreadId { get; set; } + // @property (readonly, nonatomic) SentryObjCSampleDecision sampled; + [Export("sampled")] + SentryObjCSampleDecision Sampled { get; } - // @property (nonatomic, strong) SentryStacktrace * _Nullable stacktrace; - [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] - SentryStacktrace Stacktrace { get; set; } + // -(instancetype _Nonnull)initWithTraceId:(SentryObjCId * _Nonnull)traceId spanId:(SentryObjCSpanId * _Nonnull)spanId sampled:(SentryObjCSampleDecision)sampled; + [Export("initWithTraceId:spanId:sampled:")] + NativeHandle Constructor(SentryObjCId traceId, SentryObjCSpanId spanId, SentryObjCSampleDecision sampled); - // -(instancetype _Nonnull)initWithValue:(NSString * _Nullable)value type:(NSString * _Nullable)type; - [Export("initWithValue:type:")] - NativeHandle Constructor([NullAllowed] string value, [NullAllowed] string type); + // -(NSString * _Nonnull)value; + [Export("value")] + string Value { get; } } -// @interface SentryFrame : NSObject +// @interface SentryObjCAttachment : NSObject [BaseType(typeof(NSObject))] +[DisableDefaultCtor] [Internal] -interface SentryFrame : SentrySerializable +interface SentryObjCAttachment { - // @property (copy, nonatomic) NSString * _Nullable symbolAddress; - [NullAllowed, Export("symbolAddress")] - string SymbolAddress { get; set; } + // @property (readonly, nonatomic, strong) NSData * _Nullable data; + [NullAllowed, Export("data", ArgumentSemantic.Strong)] + NSData Data { get; } - // @property (copy, nonatomic) NSString * _Nullable fileName; - [NullAllowed, Export("fileName")] - string FileName { get; set; } + // @property (readonly, copy, nonatomic) NSString * _Nullable path; + [NullAllowed, Export("path")] + string Path { get; } - // @property (copy, nonatomic) NSString * _Nullable function; - [NullAllowed, Export("function")] - string Function { get; set; } + // @property (readonly, copy, nonatomic) NSString * _Nonnull filename; + [Export("filename")] + string Filename { get; } - // @property (copy, nonatomic) NSString * _Nullable module; - [NullAllowed, Export("module")] - string Module { get; set; } + // @property (readonly, copy, nonatomic) NSString * _Nullable contentType; + [NullAllowed, Export("contentType")] + string ContentType { get; } - // @property (copy, nonatomic) NSString * _Nullable package; - [NullAllowed, Export("package")] - string Package { get; set; } + // @property (readonly, nonatomic) SentryObjCAttachmentType attachmentType; + [Export("attachmentType")] + SentryObjCAttachmentType AttachmentType { get; } - // @property (copy, nonatomic) NSString * _Nullable imageAddress; - [NullAllowed, Export("imageAddress")] - string ImageAddress { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable platform; - [NullAllowed, Export("platform")] - string Platform { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable instructionAddress; - [NullAllowed, Export("instructionAddress")] - string InstructionAddress { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable lineNumber; - [NullAllowed, Export("lineNumber", ArgumentSemantic.Copy)] - NSNumber LineNumber { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable columnNumber; - [NullAllowed, Export("columnNumber", ArgumentSemantic.Copy)] - NSNumber ColumnNumber { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable contextLine; - [NullAllowed, Export("contextLine")] - string ContextLine { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable parentIndex; - [NullAllowed, Export("parentIndex", ArgumentSemantic.Copy)] - NSNumber ParentIndex { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable sampleCount; - [NullAllowed, Export("sampleCount", ArgumentSemantic.Copy)] - NSNumber SampleCount { get; set; } - - // @property (copy, nonatomic) NSArray * _Nullable preContext; - [NullAllowed, Export("preContext", ArgumentSemantic.Copy)] - string[] PreContext { get; set; } - - // @property (copy, nonatomic) NSArray * _Nullable postContext; - [NullAllowed, Export("postContext", ArgumentSemantic.Copy)] - string[] PostContext { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable inApp; - [NullAllowed, Export("inApp", ArgumentSemantic.Copy)] - NSNumber InApp { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable stackStart; - [NullAllowed, Export("stackStart", ArgumentSemantic.Copy)] - NSNumber StackStart { get; set; } + // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename; + [Export("initWithData:filename:")] + NativeHandle Constructor(NSData data, string filename); - // @property (copy, nonatomic) NSDictionary * _Nullable vars; - [NullAllowed, Export("vars", ArgumentSemantic.Copy)] - NSDictionary Vars { get; set; } -} + // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType; + [Export("initWithData:filename:contentType:")] + NativeHandle Constructor(NSData data, string filename, [NullAllowed] string contentType); -// @interface SentryGeo : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryGeo : SentrySerializable -{ - // @property (copy, atomic) NSString * _Nullable city; - [NullAllowed, Export("city")] - string City { get; set; } + // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path; + [Export("initWithPath:")] + NativeHandle Constructor(string path); - // @property (copy, atomic) NSString * _Nullable countryCode; - [NullAllowed, Export("countryCode")] - string CountryCode { get; set; } + // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename; + [Export("initWithPath:filename:")] + NativeHandle Constructor(string path, string filename); - // @property (copy, atomic) NSString * _Nullable region; - [NullAllowed, Export("region")] - string Region { get; set; } + // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType; + [Export("initWithPath:filename:contentType:")] + NativeHandle Constructor(string path, string filename, [NullAllowed] string contentType); - // -(BOOL)isEqualToGeo:(SentryGeo * _Nonnull)geo; - [Export("isEqualToGeo:")] - bool IsEqualToGeo(SentryGeo geo); + // -(instancetype _Nonnull)initWithData:(NSData * _Nonnull)data filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType attachmentType:(SentryObjCAttachmentType)attachmentType; + [Export("initWithData:filename:contentType:attachmentType:")] + NativeHandle Constructor(NSData data, string filename, [NullAllowed] string contentType, SentryObjCAttachmentType attachmentType); - // -(NSUInteger)hash; - [Export("hash")] - nuint Hash { get; } + // -(instancetype _Nonnull)initWithPath:(NSString * _Nonnull)path filename:(NSString * _Nonnull)filename contentType:(NSString * _Nullable)contentType attachmentType:(SentryObjCAttachmentType)attachmentType; + [Export("initWithPath:filename:contentType:attachmentType:")] + NativeHandle Constructor(string path, string filename, [NullAllowed] string contentType, SentryObjCAttachmentType attachmentType); } -// @interface SentryHttpStatusCodeRange : NSObject +// @interface SentryObjCBreadcrumb : NSObject [BaseType(typeof(NSObject))] -[DisableDefaultCtor] [Internal] -interface SentryHttpStatusCodeRange +interface SentryObjCBreadcrumb { - // @property (readonly, nonatomic) NSInteger min; - [Export("min")] - nint Min { get; } + // @property (nonatomic) SentryObjCLevel level; + [Export("level", ArgumentSemantic.Assign)] + SentryObjCLevel Level { get; set; } - // @property (readonly, nonatomic) NSInteger max; - [Export("max")] - nint Max { get; } + // @property (copy, nonatomic) NSString * _Nonnull category; + [Export("category")] + string Category { get; set; } - // -(instancetype _Nonnull)initWithMin:(NSInteger)min max:(NSInteger)max; - [Export("initWithMin:max:")] - NativeHandle Constructor(nint min, nint max); + // @property (nonatomic, strong) NSDate * _Nullable timestamp; + [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] + NSDate Timestamp { get; set; } - // -(instancetype _Nonnull)initWithStatusCode:(NSInteger)statusCode; - [Export("initWithStatusCode:")] - NativeHandle Constructor(nint statusCode); -} + // @property (copy, nonatomic) NSString * _Nullable type; + [NullAllowed, Export("type")] + string Type { get; set; } -// @interface SentryId : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryId -{ - // @property (readonly, nonatomic, strong, class) SentryId * _Nonnull empty; - [Static] - [Export("empty", ArgumentSemantic.Strong)] - SentryId Empty { get; } + // @property (copy, nonatomic) NSString * _Nullable message; + [NullAllowed, Export("message")] + string Message { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; - [Export("sentryIdString")] - string SentryIdString { get; } + // @property (copy, nonatomic) NSString * _Nullable origin; + [NullAllowed, Export("origin")] + string Origin { get; set; } - // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer)); - [Export("initWithUuid:")] - [DesignatedInitializer] - NativeHandle Constructor(NSUuid uuid); + // @property (copy, nonatomic) NSDictionary * _Nullable data; + [NullAllowed, Export("data", ArgumentSemantic.Copy)] + NSDictionary Data { get; set; } - // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer)); - [Export("initWithUUIDString:")] - [DesignatedInitializer] - NativeHandle Constructor(string uuidString); + // -(instancetype _Nonnull)initWithLevel:(SentryObjCLevel)level category:(NSString * _Nonnull)category; + [Export("initWithLevel:category:")] + NativeHandle Constructor(SentryObjCLevel level, string category); } -// @interface SentryMeasurementUnit : NSObject +// @interface SentryObjCException : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryMeasurementUnit -{ - // -(instancetype _Nonnull)initWithUnit:(NSString * _Nonnull)unit; - [Export("initWithUnit:")] - NativeHandle Constructor(string unit); - - // @property (readonly, copy) NSString * _Nonnull unit; - [Export("unit")] - string Unit { get; } - - // @property (readonly, copy, class) SentryMeasurementUnit * _Nonnull none; - [Static] - [Export("none", ArgumentSemantic.Copy)] - SentryMeasurementUnit None { get; } -} - -// @interface SentryMeasurementUnitDuration : SentryMeasurementUnit -[BaseType(typeof(SentryMeasurementUnit))] -[DisableDefaultCtor] -[Internal] -interface SentryMeasurementUnitDuration -{ - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull nanosecond; - [Static] - [Export("nanosecond", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Nanosecond { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull microsecond; - [Static] - [Export("microsecond", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Microsecond { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull millisecond; - [Static] - [Export("millisecond", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Millisecond { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull second; - [Static] - [Export("second", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Second { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull minute; - [Static] - [Export("minute", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Minute { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull hour; - [Static] - [Export("hour", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Hour { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull day; - [Static] - [Export("day", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Day { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitDuration * _Nonnull week; - [Static] - [Export("week", ArgumentSemantic.Copy)] - SentryMeasurementUnitDuration Week { get; } -} - -// @interface SentryMeasurementUnitInformation : SentryMeasurementUnit -[BaseType(typeof(SentryMeasurementUnit))] -[DisableDefaultCtor] -[Internal] -interface SentryMeasurementUnitInformation +interface SentryObjCException { - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull bit; - [Static] - [Export("bit", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Bit { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull byte; - [Static] - [Export("byte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Byte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull kilobyte; - [Static] - [Export("kilobyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Kilobyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull kibibyte; - [Static] - [Export("kibibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Kibibyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull megabyte; - [Static] - [Export("megabyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Megabyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull mebibyte; - [Static] - [Export("mebibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Mebibyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull gigabyte; - [Static] - [Export("gigabyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Gigabyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull gibibyte; - [Static] - [Export("gibibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Gibibyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull terabyte; - [Static] - [Export("terabyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Terabyte { get; } - - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull tebibyte; - [Static] - [Export("tebibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Tebibyte { get; } + // @property (copy, nonatomic) NSString * _Nullable value; + [NullAllowed, Export("value")] + string Value { get; set; } - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull petabyte; - [Static] - [Export("petabyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Petabyte { get; } + // @property (copy, nonatomic) NSString * _Nullable type; + [NullAllowed, Export("type")] + string Type { get; set; } - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull pebibyte; - [Static] - [Export("pebibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Pebibyte { get; } + // @property (nonatomic, strong) SentryObjCMechanism * _Nullable mechanism; + [NullAllowed, Export("mechanism", ArgumentSemantic.Strong)] + SentryObjCMechanism Mechanism { get; set; } - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull exabyte; - [Static] - [Export("exabyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Exabyte { get; } + // @property (copy, nonatomic) NSString * _Nullable module; + [NullAllowed, Export("module")] + string Module { get; set; } - // @property (readonly, copy, class) SentryMeasurementUnitInformation * _Nonnull exbibyte; - [Static] - [Export("exbibyte", ArgumentSemantic.Copy)] - SentryMeasurementUnitInformation Exbibyte { get; } -} + // @property (copy, nonatomic) NSNumber * _Nullable threadId; + [NullAllowed, Export("threadId", ArgumentSemantic.Copy)] + NSNumber ThreadId { get; set; } -// @interface SentryMeasurementUnitFraction : SentryMeasurementUnit -[BaseType(typeof(SentryMeasurementUnit))] -[DisableDefaultCtor] -[Internal] -interface SentryMeasurementUnitFraction -{ - // @property (readonly, copy, class) SentryMeasurementUnitFraction * _Nonnull ratio; - [Static] - [Export("ratio", ArgumentSemantic.Copy)] - SentryMeasurementUnitFraction Ratio { get; } + // @property (nonatomic, strong) SentryObjCStacktrace * _Nullable stacktrace; + [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] + SentryObjCStacktrace Stacktrace { get; set; } - // @property (readonly, copy, class) SentryMeasurementUnitFraction * _Nonnull percent; - [Static] - [Export("percent", ArgumentSemantic.Copy)] - SentryMeasurementUnitFraction Percent { get; } + // -(instancetype _Nonnull)initWithValue:(NSString * _Nullable)value type:(NSString * _Nullable)type; + [Export("initWithValue:type:")] + NativeHandle Constructor([NullAllowed] string value, [NullAllowed] string type); } -// @interface SentryMechanism : NSObject +// @interface SentryObjCMechanism : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryMechanism : SentrySerializable +interface SentryObjCMechanism { // @property (copy, nonatomic) NSString * _Nonnull type; [Export("type")] @@ -782,194 +635,132 @@ interface SentryMechanism : SentrySerializable [NullAllowed, Export("helpLink")] string HelpLink { get; set; } - // @property (nonatomic, strong) SentryMechanismContext * _Nullable meta; + // @property (nonatomic, strong) SentryObjCMechanismContext * _Nullable meta; [NullAllowed, Export("meta", ArgumentSemantic.Strong)] - SentryMechanismContext Meta { get; set; } + SentryObjCMechanismContext Meta { get; set; } // -(instancetype _Nonnull)initWithType:(NSString * _Nonnull)type; [Export("initWithType:")] NativeHandle Constructor(string type); } -// @interface SentryMechanismContext : NSObject +// @interface SentryObjCStacktrace : NSObject [BaseType(typeof(NSObject))] +[DisableDefaultCtor] [Internal] -interface SentryMechanismContext : SentrySerializable +interface SentryObjCStacktrace { - // @property (nonatomic, strong) NSDictionary * _Nullable signal; - [NullAllowed, Export("signal", ArgumentSemantic.Strong)] - NSDictionary Signal { get; set; } + // @property (nonatomic, strong) NSArray * _Nonnull frames; + [Export("frames", ArgumentSemantic.Strong)] + SentryObjCFrame[] Frames { get; set; } - // @property (nonatomic, strong) NSDictionary * _Nullable machException; - [NullAllowed, Export("machException", ArgumentSemantic.Strong)] - NSDictionary MachException { get; set; } + // @property (nonatomic, strong) NSDictionary * _Nonnull registers; + [Export("registers", ArgumentSemantic.Strong)] + NSDictionary Registers { get; set; } - // @property (nonatomic, strong) SentryNSError * _Nullable error; - [NullAllowed, Export("error", ArgumentSemantic.Strong)] - SentryNSError Error { get; set; } + // @property (copy, nonatomic) NSNumber * _Nullable snapshot; + [NullAllowed, Export("snapshot", ArgumentSemantic.Copy)] + NSNumber Snapshot { get; set; } + + // -(instancetype _Nonnull)initWithFrames:(NSArray * _Nonnull)frames registers:(NSDictionary * _Nonnull)registers; + [Export("initWithFrames:registers:")] + NativeHandle Constructor(SentryObjCFrame[] frames, NSDictionary registers); } -// @interface SentryMessage : NSObject +// @interface SentryObjCThread : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryMessage : SentrySerializable +interface SentryObjCThread { - // -(instancetype _Nonnull)initWithFormatted:(NSString * _Nonnull)formatted; - [Export("initWithFormatted:")] - NativeHandle Constructor(string formatted); + // @property (copy, nonatomic) NSNumber * _Nullable threadId; + [NullAllowed, Export("threadId", ArgumentSemantic.Copy)] + NSNumber ThreadId { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nonnull formatted; - [Export("formatted")] - string Formatted { get; } + // @property (copy, nonatomic) NSString * _Nullable name; + [NullAllowed, Export("name")] + string Name { get; set; } - // @property (copy, nonatomic) NSString * _Nullable message; - [NullAllowed, Export("message")] - string Message { get; set; } - - // @property (nonatomic, strong) NSArray * _Nullable params; - [NullAllowed, Export("params", ArgumentSemantic.Strong)] - string[] Params { get; set; } -} - -// @interface SentryNSError : NSObject -[BaseType(typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryNSError : SentrySerializable -{ - // @property (copy, nonatomic) NSString * _Nonnull domain; - [Export("domain")] - string Domain { get; set; } - - // @property (assign, nonatomic) NSInteger code; - [Export("code")] - nint Code { get; set; } - - // -(instancetype _Nonnull)initWithDomain:(NSString * _Nonnull)domain code:(NSInteger)code; - [Export("initWithDomain:code:")] - NativeHandle Constructor(string domain, nint code); -} - -// @interface SentryReplayApi : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryReplayApi -{ - // -(void)maskView:(UIView * _Nonnull)view __attribute__((swift_name("maskView(_:)"))); - [Export("maskView:")] - void MaskView(UIView view); - - // -(void)unmaskView:(UIView * _Nonnull)view __attribute__((swift_name("unmaskView(_:)"))); - [Export("unmaskView:")] - void UnmaskView(UIView view); - - // -(void)pause; - [Export("pause")] - void Pause(); - - // -(void)resume; - [Export("resume")] - void Resume(); - - // -(void)start; - [Export("start")] - void Start(); + // @property (nonatomic, strong) SentryObjCStacktrace * _Nullable stacktrace; + [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] + SentryObjCStacktrace Stacktrace { get; set; } - // -(void)stop; - [Export("stop")] - void Stop(); + // @property (copy, nonatomic) NSNumber * _Nullable crashed; + [NullAllowed, Export("crashed", ArgumentSemantic.Copy)] + NSNumber Crashed { get; set; } - // -(void)showMaskPreview; - [Export("showMaskPreview")] - void ShowMaskPreview(); + // @property (copy, nonatomic) NSNumber * _Nullable current; + [NullAllowed, Export("current", ArgumentSemantic.Copy)] + NSNumber Current { get; set; } - // -(void)showMaskPreview:(CGFloat)opacity; - [Export("showMaskPreview:")] - void ShowMaskPreview(nfloat opacity); + // @property (copy, nonatomic) NSNumber * _Nullable isMain; + [NullAllowed, Export("isMain", ArgumentSemantic.Copy)] + NSNumber IsMain { get; set; } - // -(void)hideMaskPreview; - [Export("hideMaskPreview")] - void HideMaskPreview(); + // -(instancetype _Nonnull)initWithThreadId:(NSNumber * _Nullable)threadId; + [Export("initWithThreadId:")] + NativeHandle Constructor([NullAllowed] NSNumber threadId); } -// @interface SentryRequest : NSObject +// @interface SentryObjCUser : NSObject [BaseType(typeof(NSObject))] [Internal] -interface SentryRequest : SentrySerializable +interface SentryObjCUser { - // @property (copy, nonatomic) NSNumber * _Nullable bodySize; - [NullAllowed, Export("bodySize", ArgumentSemantic.Copy)] - NSNumber BodySize { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable cookies; - [NullAllowed, Export("cookies")] - string Cookies { get; set; } - - // @property (nonatomic, strong) NSDictionary * _Nullable headers; - [NullAllowed, Export("headers", ArgumentSemantic.Strong)] - NSDictionary Headers { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable fragment; - [NullAllowed, Export("fragment")] - string Fragment { get; set; } + // @property (copy, nonatomic) NSString * _Nullable userId; + [NullAllowed, Export("userId")] + string UserId { get; set; } - // @property (copy, nonatomic) NSString * _Nullable method; - [NullAllowed, Export("method")] - string Method { get; set; } + // @property (copy, nonatomic) NSString * _Nullable email; + [NullAllowed, Export("email")] + string Email { get; set; } - // @property (copy, nonatomic) NSString * _Nullable queryString; - [NullAllowed, Export("queryString")] - string QueryString { get; set; } + // @property (copy, nonatomic) NSString * _Nullable username; + [NullAllowed, Export("username")] + string Username { get; set; } - // @property (copy, nonatomic) NSString * _Nullable url; - [NullAllowed, Export("url")] - string Url { get; set; } -} + // @property (copy, nonatomic) NSString * _Nullable ipAddress; + [NullAllowed, Export("ipAddress")] + string IpAddress { get; set; } -// @interface SentrySamplingContext : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentrySamplingContext -{ - // @property (readonly, nonatomic) SentryTransactionContext * _Nonnull transactionContext; - [Export("transactionContext")] - SentryTransactionContext TransactionContext { get; } + // @property (copy, nonatomic) NSString * _Nullable name; + [NullAllowed, Export("name")] + string Name { get; set; } - // @property (readonly, nonatomic) NSDictionary * _Nullable customSamplingContext; - [NullAllowed, Export("customSamplingContext")] - NSDictionary CustomSamplingContext { get; } + // @property (nonatomic, strong) SentryObjCGeo * _Nullable geo; + [NullAllowed, Export("geo", ArgumentSemantic.Strong)] + SentryObjCGeo Geo { get; set; } - // -(instancetype _Nonnull)initWithTransactionContext:(SentryTransactionContext * _Nonnull)transactionContext; - [Export("initWithTransactionContext:")] - NativeHandle Constructor(SentryTransactionContext transactionContext); + // @property (nonatomic, strong) NSDictionary * _Nullable data; + [NullAllowed, Export("data", ArgumentSemantic.Strong)] + NSDictionary Data { get; set; } - // -(instancetype _Nonnull)initWithTransactionContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; - [Export("initWithTransactionContext:customSamplingContext:")] - NativeHandle Constructor(SentryTransactionContext transactionContext, NSDictionary customSamplingContext); + // -(instancetype _Nonnull)initWithUserId:(NSString * _Nonnull)userId; + [Export("initWithUserId:")] + NativeHandle Constructor(string userId); } -// @interface SentrySpanContext : NSObject +// @interface SentryObjCSpanContext : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentrySpanContext : SentrySerializable +interface SentryObjCSpanContext { - // @property (readonly, nonatomic) SentryId * _Nonnull traceId; - [Export("traceId")] - SentryId TraceId { get; } + // @property (readonly, nonatomic, strong) SentryObjCId * _Nonnull traceId; + [Export("traceId", ArgumentSemantic.Strong)] + SentryObjCId TraceId { get; } - // @property (readonly, nonatomic) SentrySpanId * _Nonnull spanId; - [Export("spanId")] - SentrySpanId SpanId { get; } + // @property (readonly, nonatomic, strong) SentryObjCSpanId * _Nonnull spanId; + [Export("spanId", ArgumentSemantic.Strong)] + SentryObjCSpanId SpanId { get; } - // @property (readonly, nonatomic) SentrySpanId * _Nullable parentSpanId; - [NullAllowed, Export("parentSpanId")] - SentrySpanId ParentSpanId { get; } + // @property (readonly, nonatomic, strong) SentryObjCSpanId * _Nullable parentSpanId; + [NullAllowed, Export("parentSpanId", ArgumentSemantic.Strong)] + SentryObjCSpanId ParentSpanId { get; } - // @property (readonly, nonatomic) SentrySampleDecision sampled; + // @property (readonly, nonatomic) SentryObjCSampleDecision sampled; [Export("sampled")] - SentrySampleDecision Sampled { get; } + SentryObjCSampleDecision Sampled { get; } // @property (readonly, copy, nonatomic) NSString * _Nonnull operation; [Export("operation")] @@ -987,1828 +778,847 @@ interface SentrySpanContext : SentrySerializable [Export("initWithOperation:")] NativeHandle Constructor(string operation); - // -(instancetype _Nonnull)initWithOperation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled; + // -(instancetype _Nonnull)initWithOperation:(NSString * _Nonnull)operation sampled:(SentryObjCSampleDecision)sampled; [Export("initWithOperation:sampled:")] - NativeHandle Constructor(string operation, SentrySampleDecision sampled); + NativeHandle Constructor(string operation, SentryObjCSampleDecision sampled); - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentId:(SentrySpanId * _Nullable)parentId operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled; + // -(instancetype _Nonnull)initWithTraceId:(SentryObjCId * _Nonnull)traceId spanId:(SentryObjCSpanId * _Nonnull)spanId parentId:(SentryObjCSpanId * _Nullable)parentId operation:(NSString * _Nonnull)operation sampled:(SentryObjCSampleDecision)sampled; [Export("initWithTraceId:spanId:parentId:operation:sampled:")] - NativeHandle Constructor(SentryId traceId, SentrySpanId spanId, [NullAllowed] SentrySpanId parentId, string operation, SentrySampleDecision sampled); + NativeHandle Constructor(SentryObjCId traceId, SentryObjCSpanId spanId, [NullAllowed] SentryObjCSpanId parentId, string operation, SentryObjCSampleDecision sampled); - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentId:(SentrySpanId * _Nullable)parentId operation:(NSString * _Nonnull)operation spanDescription:(NSString * _Nullable)description sampled:(SentrySampleDecision)sampled; + // -(instancetype _Nonnull)initWithTraceId:(SentryObjCId * _Nonnull)traceId spanId:(SentryObjCSpanId * _Nonnull)spanId parentId:(SentryObjCSpanId * _Nullable)parentId operation:(NSString * _Nonnull)operation spanDescription:(NSString * _Nullable)description sampled:(SentryObjCSampleDecision)sampled; [Export("initWithTraceId:spanId:parentId:operation:spanDescription:sampled:")] - NativeHandle Constructor(SentryId traceId, SentrySpanId spanId, [NullAllowed] SentrySpanId parentId, string operation, [NullAllowed] string description, SentrySampleDecision sampled); -} - -// @protocol SentrySpan -[Protocol] -[Internal] -[Model] -[BaseType (typeof(NSObject))] -interface SentrySpan : SentrySerializable -{ - // @required @property (nonatomic, strong) SentryId * _Nonnull traceId; - [Abstract] - [Export("traceId", ArgumentSemantic.Strong)] - SentryId TraceId { get; set; } - - // @required @property (nonatomic, strong) SentrySpanId * _Nonnull spanId; - [Abstract] - [Export("spanId", ArgumentSemantic.Strong)] - SentrySpanId SpanId { get; set; } - - // @required @property (nonatomic, strong) SentrySpanId * _Nullable parentSpanId; - [Abstract] - [NullAllowed, Export("parentSpanId", ArgumentSemantic.Strong)] - SentrySpanId ParentSpanId { get; set; } - - // @required @property (nonatomic) SentrySampleDecision sampled; - [Abstract] - [Export("sampled", ArgumentSemantic.Assign)] - SentrySampleDecision Sampled { get; set; } - - // @required @property (copy, nonatomic) NSString * _Nonnull operation; - [Abstract] - [Export("operation")] - string Operation { get; set; } - - // @required @property (copy, nonatomic) NSString * _Nonnull origin; - [Abstract] - [Export("origin")] - string Origin { get; set; } - - // @required @property (copy, nonatomic) NSString * _Nullable spanDescription; - [Abstract] - [NullAllowed, Export("spanDescription")] - string SpanDescription { get; set; } - - // @required @property (nonatomic) SentrySpanStatus status; - [Abstract] - [Export("status", ArgumentSemantic.Assign)] - SentrySpanStatus Status { get; set; } - - // @required @property (nonatomic, strong) NSDate * _Nullable timestamp; - [Abstract] - [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] - NSDate Timestamp { get; set; } - - // @required @property (nonatomic, strong) NSDate * _Nullable startTimestamp; - [Abstract] - [NullAllowed, Export("startTimestamp", ArgumentSemantic.Strong)] - NSDate StartTimestamp { get; set; } - - // @required @property (readonly) NSDictionary * _Nonnull data; - [Abstract] - [Export("data")] - NSDictionary Data { get; } - - // @required @property (readonly) NSDictionary * _Nonnull tags; - [Abstract] - [Export("tags")] - NSDictionary Tags { get; } - - // @required @property (readonly) BOOL isFinished; - [Abstract] - [Export("isFinished")] - bool IsFinished { get; } - - // @required @property (readonly, nonatomic) SentryTraceContext * _Nullable traceContext; - [Abstract] - [NullAllowed, Export("traceContext")] - SentryTraceContext TraceContext { get; } - - // @required -(id _Nonnull)startChildWithOperation:(NSString * _Nonnull)operation __attribute__((swift_name("startChild(operation:)"))); - [Abstract] - [Export("startChildWithOperation:")] - SentrySpan StartChildWithOperation(string operation); - - // @required -(id _Nonnull)startChildWithOperation:(NSString * _Nonnull)operation description:(NSString * _Nullable)description __attribute__((swift_name("startChild(operation:description:)"))); - [Abstract] - [Export("startChildWithOperation:description:")] - SentrySpan StartChildWithOperation(string operation, [NullAllowed] string description); - - // @required -(void)setDataValue:(id _Nullable)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setData(value:key:)"))); - [Abstract] - [Export("setDataValue:forKey:")] - void SetDataValue([NullAllowed] NSObject value, string key); - - // @required -(void)removeDataForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeData(key:)"))); - [Abstract] - [Export("removeDataForKey:")] - void RemoveDataForKey(string key); - - // @required -(void)setTagValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setTag(value:key:)"))); - [Abstract] - [Export("setTagValue:forKey:")] - void SetTagValue(string value, string key); - - // @required -(void)removeTagForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeTag(key:)"))); - [Abstract] - [Export("removeTagForKey:")] - void RemoveTagForKey(string key); - - // @required -(void)setMeasurement:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value __attribute__((swift_name("setMeasurement(name:value:)"))); - [Abstract] - [Export("setMeasurement:value:")] - void SetMeasurement(string name, NSNumber value); - - // @required -(void)setMeasurement:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value unit:(SentryMeasurementUnit * _Nonnull)unit __attribute__((swift_name("setMeasurement(name:value:unit:)"))); - [Abstract] - [Export("setMeasurement:value:unit:")] - void SetMeasurement(string name, NSNumber value, SentryMeasurementUnit unit); - - // @required -(void)finish; - [Abstract] - [Export("finish")] - void Finish(); - - // @required -(void)finishWithStatus:(SentrySpanStatus)status __attribute__((swift_name("finish(status:)"))); - [Abstract] - [Export("finishWithStatus:")] - void FinishWithStatus(SentrySpanStatus status); - - // @required -(SentryTraceHeader * _Nonnull)toTraceHeader; - [Abstract] - [Export("toTraceHeader")] - SentryTraceHeader ToTraceHeader(); - - // @required -(NSString * _Nullable)baggageHttpHeader; - [Abstract] - [NullAllowed, Export("baggageHttpHeader")] - string BaggageHttpHeader { get; } - - // @required -(NSDictionary * _Nonnull)serialize; - [Abstract] - [Export("serialize")] - NSDictionary Serialize(); + NativeHandle Constructor(SentryObjCId traceId, SentryObjCSpanId spanId, [NullAllowed] SentryObjCSpanId parentId, string operation, [NullAllowed] string description, SentryObjCSampleDecision sampled); } -// @interface SentryScope : NSObject -[BaseType(typeof(NSObject))] +// @interface SentryObjCTransactionContext : SentryObjCSpanContext +[BaseType(typeof(SentryObjCSpanContext))] [Internal] -partial interface SentryScope : SentrySerializable +interface SentryObjCTransactionContext { - // @property (nonatomic, strong) id _Nullable span; - [NullAllowed, Export("span", ArgumentSemantic.Strong)] - SentrySpan Span { get; set; } - - // @property (nonatomic, strong) NSString * _Nullable replayId; - [NullAllowed, Export("replayId", ArgumentSemantic.Strong)] - string ReplayId { get; set; } - - // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull tags; - [Export("tags", ArgumentSemantic.Copy)] - NSDictionary Tags { get; } - - // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull attributes; - [Export("attributes", ArgumentSemantic.Copy)] - NSDictionary Attributes { get; } - - // -(instancetype _Nonnull)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs __attribute__((objc_designated_initializer)); - [Export("initWithMaxBreadcrumbs:")] - [DesignatedInitializer] - NativeHandle Constructor(nint maxBreadcrumbs); - - // -(instancetype _Nonnull)initWithScope:(SentryScope * _Nonnull)scope; - [Export("initWithScope:")] - NativeHandle Constructor(SentryScope scope); - - // -(void)setUser:(SentryUser * _Nullable)user; - [Export("setUser:")] - void SetUser([NullAllowed] SentryUser user); - - // -(void)setTagValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setTag(value:key:)"))); - [Export("setTagValue:forKey:")] - void SetTagValue(string value, string key); - - // -(void)removeTagForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeTag(key:)"))); - [Export("removeTagForKey:")] - void RemoveTagForKey(string key); - - // -(void)setTags:(NSDictionary * _Nullable)tags; - [Export("setTags:")] - void SetTags([NullAllowed] NSDictionary tags); - - // -(void)setExtras:(NSDictionary * _Nullable)extras; - [Export("setExtras:")] - void SetExtras([NullAllowed] NSDictionary extras); - - // -(void)setExtraValue:(id _Nullable)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setExtra(value:key:)"))); - [Export("setExtraValue:forKey:")] - void SetExtraValue([NullAllowed] NSObject value, string key); - - // -(void)removeExtraForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeExtra(key:)"))); - [Export("removeExtraForKey:")] - void RemoveExtraForKey(string key); - - // -(void)setDist:(NSString * _Nullable)dist; - [Export("setDist:")] - void SetDist([NullAllowed] string dist); - - // -(void)setEnvironment:(NSString * _Nullable)environment; - [Export("setEnvironment:")] - void SetEnvironment([NullAllowed] string environment); - - // -(void)setFingerprint:(NSArray * _Nullable)fingerprint; - [Export("setFingerprint:")] - void SetFingerprint([NullAllowed] string[] fingerprint); + // @property (readonly, copy, nonatomic) NSString * _Nonnull name; + [Export("name")] + string Name { get; } - // -(void)setLevel:(SentryLevel)level; - [Export("setLevel:")] - void SetLevel(SentryLevel level); + // @property (readonly, nonatomic) SentryObjCTransactionNameSource nameSource; + [Export("nameSource")] + SentryObjCTransactionNameSource NameSource { get; } - // -(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb __attribute__((swift_name("addBreadcrumb(_:)"))); - [Export("addBreadcrumb:")] - void AddBreadcrumb(SentryBreadcrumb crumb); + // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; + [NullAllowed, Export("sampleRate", ArgumentSemantic.Strong)] + NSNumber SampleRate { get; set; } - // -(void)clearBreadcrumbs; - [Export("clearBreadcrumbs")] - void ClearBreadcrumbs(); + // @property (nonatomic, strong) NSNumber * _Nullable sampleRand; + [NullAllowed, Export("sampleRand", ArgumentSemantic.Strong)] + NSNumber SampleRand { get; set; } - // -(NSDictionary * _Nonnull)serialize; - [Export("serialize")] - NSDictionary Serialize(); + // @property (nonatomic) SentryObjCSampleDecision parentSampled; + [Export("parentSampled", ArgumentSemantic.Assign)] + SentryObjCSampleDecision ParentSampled { get; set; } - // -(void)setContextValue:(NSDictionary * _Nonnull)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setContext(value:key:)"))); - [Export("setContextValue:forKey:")] - void SetContextValue(NSDictionary value, string key); + // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRate; + [NullAllowed, Export("parentSampleRate", ArgumentSemantic.Strong)] + NSNumber ParentSampleRate { get; set; } - // -(void)removeContextForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeContext(key:)"))); - [Export("removeContextForKey:")] - void RemoveContextForKey(string key); + // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRand; + [NullAllowed, Export("parentSampleRand", ArgumentSemantic.Strong)] + NSNumber ParentSampleRand { get; set; } - // -(void)addAttachment:(SentryAttachment * _Nonnull)attachment __attribute__((swift_name("addAttachment(_:)"))); - [Export("addAttachment:")] - void AddAttachment(SentryAttachment attachment); + // @property (assign, nonatomic) BOOL forNextAppLaunch; + [Export("forNextAppLaunch")] + bool ForNextAppLaunch { get; set; } - // -(void)setAttributeValue:(id _Nonnull)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setAttribute(value:key:)"))); - [Export("setAttributeValue:forKey:")] - void SetAttributeValue(NSObject value, string key); + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; + [Export("initWithName:operation:")] + NativeHandle Constructor(string name, string operation); - // -(void)removeAttributeForKey:(NSString * _Nonnull)key __attribute__((swift_name("removeAttribute(key:)"))); - [Export("removeAttributeForKey:")] - void RemoveAttributeForKey(string key); + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentryObjCSampleDecision)sampled sampleRate:(NSNumber * _Nullable)sampleRate sampleRand:(NSNumber * _Nullable)sampleRand; + [Export("initWithName:operation:sampled:sampleRate:sampleRand:")] + NativeHandle Constructor(string name, string operation, SentryObjCSampleDecision sampled, [NullAllowed] NSNumber sampleRate, [NullAllowed] NSNumber sampleRand); - // -(void)clearAttachments; - [Export("clearAttachments")] - void ClearAttachments(); - - // -(void)clear; - [Export("clear")] - void Clear(); -} - -// @interface SentrySpanId : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentrySpanId -{ - // -(instancetype _Nonnull)initWithUUID:(NSUUID * _Nonnull)uuid; - [Export("initWithUUID:")] - NativeHandle Constructor(NSUuid uuid); - - // -(instancetype _Nonnull)initWithValue:(NSString * _Nonnull)value; - [Export("initWithValue:")] - NativeHandle Constructor(string value); - - // @property (readonly, copy) NSString * _Nonnull sentrySpanIdString; - [Export("sentrySpanIdString")] - string SentrySpanIdString { get; } - - // @property (readonly, nonatomic, strong, class) SentrySpanId * _Nonnull empty; - [Static] - [Export("empty", ArgumentSemantic.Strong)] - SentrySpanId Empty { get; } -} - -// @interface SentryStacktrace : NSObject -[BaseType(typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryStacktrace : SentrySerializable -{ - // @property (nonatomic, strong) NSArray * _Nonnull frames; - [Export("frames", ArgumentSemantic.Strong)] - SentryFrame[] Frames { get; set; } - - // @property (nonatomic, strong) NSDictionary * _Nonnull registers; - [Export("registers", ArgumentSemantic.Strong)] - NSDictionary Registers { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable snapshot; - [NullAllowed, Export("snapshot", ArgumentSemantic.Copy)] - NSNumber Snapshot { get; set; } - - // -(instancetype _Nonnull)initWithFrames:(NSArray * _Nonnull)frames registers:(NSDictionary * _Nonnull)registers; - [Export("initWithFrames:registers:")] - NativeHandle Constructor(SentryFrame[] frames, NSDictionary registers); - - // -(void)fixDuplicateFrames; - [Export("fixDuplicateFrames")] - void FixDuplicateFrames(); -} - -// @interface SentryThread : NSObject -[BaseType(typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryThread : SentrySerializable -{ - // @property (copy, nonatomic) NSNumber * _Nullable threadId; - [NullAllowed, Export("threadId", ArgumentSemantic.Copy)] - NSNumber ThreadId { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable name; - [NullAllowed, Export("name")] - string Name { get; set; } - - // @property (nonatomic, strong) SentryStacktrace * _Nullable stacktrace; - [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] - SentryStacktrace Stacktrace { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable crashed; - [NullAllowed, Export("crashed", ArgumentSemantic.Copy)] - NSNumber Crashed { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable current; - [NullAllowed, Export("current", ArgumentSemantic.Copy)] - NSNumber Current { get; set; } - - // @property (copy, nonatomic) NSNumber * _Nullable isMain; - [NullAllowed, Export("isMain", ArgumentSemantic.Copy)] - NSNumber IsMain { get; set; } - - // -(instancetype _Nonnull)initWithThreadId:(NSNumber * _Nullable)threadId; - [Export("initWithThreadId:")] - NativeHandle Constructor([NullAllowed] NSNumber threadId); -} - -// @interface SentryTraceContext : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryTraceContext : SentrySerializable -{ - // @property (readonly, nonatomic) SentryId * _Nonnull traceId; - [Export("traceId")] - SentryId TraceId { get; } - - // @property (readonly, nonatomic) NSString * _Nonnull publicKey; - [Export("publicKey")] - string PublicKey { get; } - - // @property (readonly, nonatomic) NSString * _Nullable releaseName; - [NullAllowed, Export("releaseName")] - string ReleaseName { get; } - - // @property (readonly, nonatomic) NSString * _Nullable environment; - [NullAllowed, Export("environment")] - string Environment { get; } - - // @property (readonly, nonatomic) NSString * _Nullable transaction; - [NullAllowed, Export("transaction")] - string Transaction { get; } - - // @property (readonly, nonatomic) NSString * _Nullable sampleRate; - [NullAllowed, Export("sampleRate")] - string SampleRate { get; } - - // @property (readonly, nonatomic) NSString * _Nullable sampleRand; - [NullAllowed, Export("sampleRand")] - string SampleRand { get; } - - // @property (readonly, nonatomic) NSString * _Nullable sampled; - [NullAllowed, Export("sampled")] - string Sampled { get; } - - // @property (readonly, nonatomic) NSString * _Nullable replayId; - [NullAllowed, Export("replayId")] - string ReplayId { get; } - - // @property (readonly, nonatomic) NSString * _Nullable orgId; - [NullAllowed, Export("orgId")] - string OrgId { get; } - - // -(SentryBaggage * _Nonnull)toBaggage; - [Export("toBaggage")] - SentryBaggage ToBaggage(); -} - -// @interface SentryTraceHeader : NSObject -[BaseType(typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryTraceHeader -{ - // @property (readonly, nonatomic) SentryId * _Nonnull traceId; - [Export("traceId")] - SentryId TraceId { get; } - - // @property (readonly, nonatomic) SentrySpanId * _Nonnull spanId; - [Export("spanId")] - SentrySpanId SpanId { get; } - - // @property (readonly, nonatomic) SentrySampleDecision sampled; - [Export("sampled")] - SentrySampleDecision Sampled { get; } - - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId sampled:(SentrySampleDecision)sampled; - [Export("initWithTraceId:spanId:sampled:")] - NativeHandle Constructor(SentryId traceId, SentrySpanId spanId, SentrySampleDecision sampled); - - // -(NSString * _Nonnull)value; - [Export("value")] - string Value { get; } -} - -// @interface SentryTransactionContext : SentrySpanContext -[BaseType(typeof(SentrySpanContext))] -[DisableDefaultCtor] -[Internal] -interface SentryTransactionContext -{ - // @property (readonly, nonatomic) NSString * _Nonnull name; - [Export("name")] - string Name { get; } - - // @property (readonly, nonatomic) SentryTransactionNameSource nameSource; - [Export("nameSource")] - SentryTransactionNameSource NameSource { get; } - - // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; - [NullAllowed, Export("sampleRate", ArgumentSemantic.Strong)] - NSNumber SampleRate { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable sampleRand; - [NullAllowed, Export("sampleRand", ArgumentSemantic.Strong)] - NSNumber SampleRand { get; set; } - - // @property (nonatomic) SentrySampleDecision parentSampled; - [Export("parentSampled", ArgumentSemantic.Assign)] - SentrySampleDecision ParentSampled { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRate; - [NullAllowed, Export("parentSampleRate", ArgumentSemantic.Strong)] - NSNumber ParentSampleRate { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRand; - [NullAllowed, Export("parentSampleRand", ArgumentSemantic.Strong)] - NSNumber ParentSampleRand { get; set; } - - // @property (assign, nonatomic) BOOL forNextAppLaunch; - [Export("forNextAppLaunch")] - bool ForNextAppLaunch { get; set; } - - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; - [Export("initWithName:operation:")] - NativeHandle Constructor(string name, string operation); - - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled sampleRate:(NSNumber * _Nullable)sampleRate sampleRand:(NSNumber * _Nullable)sampleRand; - [Export("initWithName:operation:sampled:sampleRate:sampleRand:")] - NativeHandle Constructor(string name, string operation, SentrySampleDecision sampled, [NullAllowed] NSNumber sampleRate, [NullAllowed] NSNumber sampleRand); - - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation traceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentSpanId:(SentrySpanId * _Nullable)parentSpanId parentSampled:(SentrySampleDecision)parentSampled parentSampleRate:(NSNumber * _Nullable)parentSampleRate parentSampleRand:(NSNumber * _Nullable)parentSampleRand; - [Export("initWithName:operation:traceId:spanId:parentSpanId:parentSampled:parentSampleRate:parentSampleRand:")] - NativeHandle Constructor(string name, string operation, SentryId traceId, SentrySpanId spanId, [NullAllowed] SentrySpanId parentSpanId, SentrySampleDecision parentSampled, [NullAllowed] NSNumber parentSampleRate, [NullAllowed] NSNumber parentSampleRand); -} - -// @interface SentryUser : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryUser : SentrySerializable -{ - // @property (copy, atomic) NSString * _Nullable userId; - [NullAllowed, Export("userId")] - string UserId { get; set; } - - // @property (copy, atomic) NSString * _Nullable email; - [NullAllowed, Export("email")] - string Email { get; set; } - - // @property (copy, atomic) NSString * _Nullable username; - [NullAllowed, Export("username")] - string Username { get; set; } - - // @property (copy, atomic) NSString * _Nullable ipAddress; - [NullAllowed, Export("ipAddress")] - string IpAddress { get; set; } - - // @property (copy, atomic) NSString * _Nullable name; - [NullAllowed, Export("name")] - string Name { get; set; } - - // @property (nonatomic, strong) SentryGeo * _Nullable geo; - [NullAllowed, Export("geo", ArgumentSemantic.Strong)] - SentryGeo Geo { get; set; } - - // @property (atomic, strong) NSDictionary * _Nullable data; - [NullAllowed, Export("data", ArgumentSemantic.Strong)] - NSDictionary Data { get; set; } - - // -(instancetype _Nonnull)initWithUserId:(NSString * _Nonnull)userId; - [Export("initWithUserId:")] - NativeHandle Constructor(string userId); - - // -(BOOL)isEqualToUser:(SentryUser * _Nonnull)user; - [Export("isEqualToUser:")] - bool IsEqualToUser(SentryUser user); - - // -(NSUInteger)hash; - [Export("hash")] - nuint Hash { get; } -} - -// @interface SentryOptions : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryOptions -{ - // @property (copy, nonatomic) NSString * _Nullable dsn; - [NullAllowed, Export("dsn")] - string Dsn { get; set; } - - // @property (nonatomic, strong) SentryDsn * _Nullable parsedDsn; - [NullAllowed, Export("parsedDsn", ArgumentSemantic.Strong)] - SentryDsn ParsedDsn { get; set; } - - // @property (nonatomic) BOOL debug; - [Export("debug")] - bool Debug { get; set; } - - // @property (nonatomic) SentryLevel diagnosticLevel; - [Export("diagnosticLevel", ArgumentSemantic.Assign)] - SentryLevel DiagnosticLevel { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable releaseName; - [NullAllowed, Export("releaseName")] - string ReleaseName { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable dist; - [NullAllowed, Export("dist")] - string Dist { get; set; } - - // @property (copy, nonatomic) NSString * _Nonnull environment; - [Export("environment")] - string Environment { get; set; } - - // @property (nonatomic) BOOL enabled; - [Export("enabled")] - bool Enabled { get; set; } - - // @property (nonatomic) NSTimeInterval shutdownTimeInterval; - [Export("shutdownTimeInterval")] - double ShutdownTimeInterval { get; set; } - - // @property (nonatomic) BOOL enableCrashHandler; - [Export("enableCrashHandler")] - bool EnableCrashHandler { get; set; } - - // @property (nonatomic) BOOL enableSigtermReporting; - [Export("enableSigtermReporting")] - bool EnableSigtermReporting { get; set; } - - // @property (nonatomic) NSUInteger maxBreadcrumbs; - [Export("maxBreadcrumbs")] - nuint MaxBreadcrumbs { get; set; } - - // @property (nonatomic) BOOL enableNetworkBreadcrumbs; - [Export("enableNetworkBreadcrumbs")] - bool EnableNetworkBreadcrumbs { get; set; } - - // @property (nonatomic) NSUInteger maxCacheItems; - [Export("maxCacheItems")] - nuint MaxCacheItems { get; set; } - - // @property (copy, nonatomic) SentryBeforeSendEventCallback _Nullable beforeSend; - [NullAllowed, Export("beforeSend", ArgumentSemantic.Copy)] - SentryBeforeSendEventCallback BeforeSend { get; set; } - - // @property (copy, nonatomic) SentryBeforeSendSpanCallback _Nullable beforeSendSpan; - [NullAllowed, Export("beforeSendSpan", ArgumentSemantic.Copy)] - SentryBeforeSendSpanCallback BeforeSendSpan { get; set; } - - // @property (nonatomic) BOOL enableLogs; - [Export("enableLogs")] - bool EnableLogs { get; set; } - - // @property (copy, nonatomic) SentryLog * _Nullable (^ _Nullable)(SentryLog * _Nonnull) beforeSendLog; - [NullAllowed, Export("beforeSendLog", ArgumentSemantic.Copy)] - Func BeforeSendLog { get; set; } - - // @property (copy, nonatomic) SentryBeforeBreadcrumbCallback _Nullable beforeBreadcrumb; - [NullAllowed, Export("beforeBreadcrumb", ArgumentSemantic.Copy)] - SentryBeforeBreadcrumbCallback BeforeBreadcrumb { get; set; } - - // @property (copy, nonatomic) SentryBeforeCaptureScreenshotCallback _Nullable beforeCaptureScreenshot; - [NullAllowed, Export("beforeCaptureScreenshot", ArgumentSemantic.Copy)] - SentryBeforeCaptureScreenshotCallback BeforeCaptureScreenshot { get; set; } - - // @property (copy, nonatomic) SentryBeforeCaptureScreenshotCallback _Nullable beforeCaptureViewHierarchy; - [NullAllowed, Export("beforeCaptureViewHierarchy", ArgumentSemantic.Copy)] - SentryBeforeCaptureScreenshotCallback BeforeCaptureViewHierarchy { get; set; } - - // @property (copy, nonatomic) SWIFT_DEPRECATED_MSG("Use onLastRunStatusDetermined instead, which is called regardless of whether the app crashed.") SentryOnCrashedLastRunCallback onCrashedLastRun __attribute__((deprecated("Use onLastRunStatusDetermined instead, which is called regardless of whether the app crashed."))); - [NullAllowed, Export("onCrashedLastRun", ArgumentSemantic.Copy)] - SentryOnCrashedLastRunCallback OnCrashedLastRun { get; set; } - - // @property (copy, nonatomic) void (^ _Nullable)(enum SentryLastRunStatus, SentryEvent * _Nullable) onLastRunStatusDetermined; - [NullAllowed, Export("onLastRunStatusDetermined", ArgumentSemantic.Copy)] - Action OnLastRunStatusDetermined { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; - [NullAllowed, Export("sampleRate", ArgumentSemantic.Strong)] - NSNumber SampleRate { get; set; } - - // @property (nonatomic) BOOL enableAutoSessionTracking; - [Export("enableAutoSessionTracking")] - bool EnableAutoSessionTracking { get; set; } - - // @property (nonatomic) BOOL enableGraphQLOperationTracking; - [Export("enableGraphQLOperationTracking")] - bool EnableGraphQLOperationTracking { get; set; } - - // @property (nonatomic) BOOL enableWatchdogTerminationTracking; - [Export("enableWatchdogTerminationTracking")] - bool EnableWatchdogTerminationTracking { get; set; } - - // @property (nonatomic) NSUInteger sessionTrackingIntervalMillis; - [Export("sessionTrackingIntervalMillis")] - nuint SessionTrackingIntervalMillis { get; set; } - - // @property (nonatomic) BOOL attachStacktrace; - [Export("attachStacktrace")] - bool AttachStacktrace { get; set; } - - // @property (nonatomic) BOOL attachAllThreads; - [Export("attachAllThreads")] - bool AttachAllThreads { get; set; } - - // @property (nonatomic) NSUInteger maxAttachmentSize; - [Export("maxAttachmentSize")] - nuint MaxAttachmentSize { get; set; } - - // @property (nonatomic) BOOL sendDefaultPii; - [Export("sendDefaultPii")] - bool SendDefaultPii { get; set; } - - // @property (nonatomic) BOOL enableAutoPerformanceTracing; - [Export("enableAutoPerformanceTracing")] - bool EnableAutoPerformanceTracing { get; set; } - - // @property (nonatomic) BOOL enablePersistingTracesWhenCrashing; - [Export("enablePersistingTracesWhenCrashing")] - bool EnablePersistingTracesWhenCrashing { get; set; } - - // @property (copy, nonatomic) SentryScope * _Nonnull (^ _Nonnull)(SentryScope * _Nonnull) initialScope; - [Export("initialScope", ArgumentSemantic.Copy)] - Func InitialScope { get; set; } - - // @property (nonatomic) BOOL enableUIViewControllerTracing; - [Export("enableUIViewControllerTracing")] - bool EnableUIViewControllerTracing { get; set; } - - // @property (nonatomic) BOOL attachScreenshot; - [Export("attachScreenshot")] - bool AttachScreenshot { get; set; } - - // @property (nonatomic, strong) SentryViewScreenshotOptions * _Nonnull screenshot; - [Export("screenshot", ArgumentSemantic.Strong)] - SentryViewScreenshotOptions Screenshot { get; set; } - - // @property (nonatomic) BOOL attachViewHierarchy; - [Export("attachViewHierarchy")] - bool AttachViewHierarchy { get; set; } - - // @property (nonatomic) BOOL reportAccessibilityIdentifier; - [Export("reportAccessibilityIdentifier")] - bool ReportAccessibilityIdentifier { get; set; } - - // @property (nonatomic) BOOL enableUserInteractionTracing; - [Export("enableUserInteractionTracing")] - bool EnableUserInteractionTracing { get; set; } - - // @property (nonatomic) NSTimeInterval idleTimeout; - [Export("idleTimeout")] - double IdleTimeout { get; set; } - - // @property (nonatomic) BOOL enablePreWarmedAppStartTracing; - [Export("enablePreWarmedAppStartTracing")] - bool EnablePreWarmedAppStartTracing { get; set; } - - // @property (nonatomic) BOOL enableReportNonFullyBlockingAppHangs; - [Export("enableReportNonFullyBlockingAppHangs")] - bool EnableReportNonFullyBlockingAppHangs { get; set; } - - // -(BOOL)isAppHangTrackingDisabled __attribute__((warn_unused_result(""))); - [Export("isAppHangTrackingDisabled")] - bool IsAppHangTrackingDisabled { get; } - - // @property (nonatomic, strong) SentryReplayOptions * _Nonnull sessionReplay; - [Export("sessionReplay", ArgumentSemantic.Strong)] - SentryReplayOptions SessionReplay { get; set; } - - // @property (nonatomic) BOOL enableNetworkTracking; - [Export("enableNetworkTracking")] - bool EnableNetworkTracking { get; set; } - - // @property (nonatomic) BOOL enableFileIOTracing; - [Export("enableFileIOTracing")] - bool EnableFileIOTracing { get; set; } - - // @property (nonatomic) BOOL enableDataSwizzling; - [Export("enableDataSwizzling")] - bool EnableDataSwizzling { get; set; } - - // @property (nonatomic) BOOL enableFileManagerSwizzling; - [Export("enableFileManagerSwizzling")] - bool EnableFileManagerSwizzling { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable tracesSampleRate; - [NullAllowed, Export("tracesSampleRate", ArgumentSemantic.Strong)] - NSNumber TracesSampleRate { get; set; } - - // @property (copy, nonatomic) SentryTracesSamplerCallback _Nullable tracesSampler; - [NullAllowed, Export("tracesSampler", ArgumentSemantic.Copy)] - SentryTracesSamplerCallback TracesSampler { get; set; } - - // @property (readonly, nonatomic) BOOL isTracingEnabled; - [Export("isTracingEnabled")] - bool IsTracingEnabled { get; } - - // @property (readonly, copy, nonatomic) NSArray * _Nonnull inAppIncludes; - [Export("inAppIncludes", ArgumentSemantic.Copy)] - string[] InAppIncludes { get; } - - // -(void)addInAppInclude:(NSString * _Nonnull)inAppInclude; - [Export("addInAppInclude:")] - void AddInAppInclude(string inAppInclude); - - [Wrap("WeakUrlSessionDelegate")] - [NullAllowed] - NSUrlSessionDelegate UrlSessionDelegate { get; set; } - - // @property (nonatomic, weak) id _Nullable urlSessionDelegate; - [NullAllowed, Export("urlSessionDelegate", ArgumentSemantic.Weak)] - NSObject WeakUrlSessionDelegate { get; set; } - - // @property (nonatomic, strong) NSURLSession * _Nullable urlSession; - [NullAllowed, Export("urlSession", ArgumentSemantic.Strong)] - NSUrlSession UrlSession { get; set; } - - // @property (nonatomic) BOOL enableSwizzling; - [Export("enableSwizzling")] - bool EnableSwizzling { get; set; } - - // @property (copy, nonatomic) NSSet * _Nonnull swizzleClassNameExcludes; - [Export("swizzleClassNameExcludes", ArgumentSemantic.Copy)] - NSSet SwizzleClassNameExcludes { get; set; } - - // @property (nonatomic) BOOL enableCoreDataTracing; - [Export("enableCoreDataTracing")] - bool EnableCoreDataTracing { get; set; } - - // @property (copy, nonatomic) void (^ _Nullable)(SentryProfileOptions * _Nonnull) configureProfiling; - [NullAllowed, Export("configureProfiling", ArgumentSemantic.Copy)] - Action ConfigureProfiling { get; set; } - - // @property (nonatomic, strong) SentryProfileOptions * _Nullable profiling; - [NullAllowed, Export("profiling", ArgumentSemantic.Strong)] - SentryProfileOptions Profiling { get; set; } - - // -(BOOL)isContinuousProfilingEnabled __attribute__((warn_unused_result(""))); - [Export("isContinuousProfilingEnabled")] - bool IsContinuousProfilingEnabled { get; } - - // -(BOOL)isProfilingCorrelatedToTraces __attribute__((warn_unused_result(""))); - [Export("isProfilingCorrelatedToTraces")] - bool IsProfilingCorrelatedToTraces { get; } - - // @property (nonatomic) BOOL sendClientReports; - [Export("sendClientReports")] - bool SendClientReports { get; set; } - - // @property (nonatomic) BOOL enableAppHangTracking; - [Export("enableAppHangTracking")] - bool EnableAppHangTracking { get; set; } - - // @property (nonatomic) NSTimeInterval appHangTimeoutInterval; - [Export("appHangTimeoutInterval")] - double AppHangTimeoutInterval { get; set; } - - // @property (nonatomic) BOOL enableAutoBreadcrumbTracking; - [Export("enableAutoBreadcrumbTracking")] - bool EnableAutoBreadcrumbTracking { get; set; } - - // @property (nonatomic) BOOL enablePropagateTraceparent; - [Export("enablePropagateTraceparent")] - bool EnablePropagateTraceparent { get; set; } - - // @property (copy, nonatomic) NSArray * _Nonnull tracePropagationTargets; - [Export("tracePropagationTargets", ArgumentSemantic.Copy)] - NSObject[] TracePropagationTargets { get; set; } - - // @property (nonatomic) BOOL enableCaptureFailedRequests; - [Export("enableCaptureFailedRequests")] - bool EnableCaptureFailedRequests { get; set; } - - // @property (copy, nonatomic) NSArray * _Nonnull failedRequestStatusCodes; - [Export("failedRequestStatusCodes", ArgumentSemantic.Copy)] - SentryHttpStatusCodeRange[] FailedRequestStatusCodes { get; set; } - - // @property (copy, nonatomic) NSArray * _Nonnull failedRequestTargets; - [Export("failedRequestTargets", ArgumentSemantic.Copy)] - NSObject[] FailedRequestTargets { get; set; } - - // @property (nonatomic) BOOL enableMetricKit; - [Export("enableMetricKit")] - bool EnableMetricKit { get; set; } + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation traceId:(SentryObjCId * _Nonnull)traceId spanId:(SentryObjCSpanId * _Nonnull)spanId parentSpanId:(SentryObjCSpanId * _Nullable)parentSpanId parentSampled:(SentryObjCSampleDecision)parentSampled parentSampleRate:(NSNumber * _Nullable)parentSampleRate parentSampleRand:(NSNumber * _Nullable)parentSampleRand; + [Export("initWithName:operation:traceId:spanId:parentSpanId:parentSampled:parentSampleRate:parentSampleRand:")] + NativeHandle Constructor(string name, string operation, SentryObjCId traceId, SentryObjCSpanId spanId, [NullAllowed] SentryObjCSpanId parentSpanId, SentryObjCSampleDecision parentSampled, [NullAllowed] NSNumber parentSampleRate, [NullAllowed] NSNumber parentSampleRand); +} - // @property (nonatomic) BOOL enableMetricKitRawPayload; - [Export("enableMetricKitRawPayload")] - bool EnableMetricKitRawPayload { get; set; } +// @interface SentryObjCEvent : NSObject +[BaseType(typeof(NSObject))] +[Internal] +interface SentryObjCEvent +{ + // @property (nonatomic, strong) SentryObjCId * _Nonnull eventId; + [Export("eventId", ArgumentSemantic.Strong)] + SentryObjCId EventId { get; set; } - // @property (nonatomic) BOOL enableTimeToFullDisplayTracing; - [Export("enableTimeToFullDisplayTracing")] - bool EnableTimeToFullDisplayTracing { get; set; } + // @property (nonatomic, strong) SentryObjCMessage * _Nullable message; + [NullAllowed, Export("message", ArgumentSemantic.Strong)] + SentryObjCMessage Message { get; set; } - // @property (nonatomic) BOOL swiftAsyncStacktraces; - [Export("swiftAsyncStacktraces")] - bool SwiftAsyncStacktraces { get; set; } + // @property (copy, nonatomic) NSError * _Nullable error; + [NullAllowed, Export("error", ArgumentSemantic.Copy)] + NSError Error { get; set; } - // @property (copy, nonatomic) NSString * _Nonnull cacheDirectoryPath; - [Export("cacheDirectoryPath")] - string CacheDirectoryPath { get; set; } + // @property (nonatomic, strong) NSDate * _Nullable timestamp; + [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] + NSDate Timestamp { get; set; } - // @property (nonatomic) BOOL enableSpotlight; - [Export("enableSpotlight")] - bool EnableSpotlight { get; set; } + // @property (nonatomic, strong) NSDate * _Nullable startTimestamp; + [NullAllowed, Export("startTimestamp", ArgumentSemantic.Strong)] + NSDate StartTimestamp { get; set; } - // @property (copy, nonatomic) NSString * _Nonnull spotlightUrl; - [Export("spotlightUrl")] - string SpotlightUrl { get; set; } + // @property (nonatomic) SentryObjCLevel level; + [Export("level", ArgumentSemantic.Assign)] + SentryObjCLevel Level { get; set; } - // @property (nonatomic) BOOL strictTraceContinuation; - [Export("strictTraceContinuation")] - bool StrictTraceContinuation { get; set; } + // @property (copy, nonatomic) NSString * _Nonnull platform; + [Export("platform")] + string Platform { get; set; } - // @property (copy, nonatomic) NSString * _Nullable orgId; - [NullAllowed, Export("orgId")] - string OrgId { get; set; } + // @property (copy, nonatomic) NSString * _Nullable logger; + [NullAllowed, Export("logger")] + string Logger { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nullable effectiveOrgId; - [NullAllowed, Export("effectiveOrgId")] - string EffectiveOrgId { get; } + // @property (copy, nonatomic) NSString * _Nullable serverName; + [NullAllowed, Export("serverName")] + string ServerName { get; set; } - // @property (nonatomic, strong) SentryExperimentalOptions * _Nonnull experimental; - [Export("experimental", ArgumentSemantic.Strong)] - SentryExperimentalOptions Experimental { get; set; } + // @property (copy, nonatomic) NSString * _Nullable releaseName; + [NullAllowed, Export("releaseName")] + string ReleaseName { get; set; } - // +(BOOL)isValidSampleRate:(NSNumber * _Nonnull)rate __attribute__((warn_unused_result(""))); - [Static] - [Export("isValidSampleRate:")] - bool IsValidSampleRate(NSNumber rate); + // @property (copy, nonatomic) NSString * _Nullable dist; + [NullAllowed, Export("dist")] + string Dist { get; set; } - // @property (readonly, copy, nonatomic, class) NSString * _Nonnull defaultEnvironment; - [Static] - [Export("defaultEnvironment")] - string DefaultEnvironment { get; } + // @property (copy, nonatomic) NSString * _Nullable environment; + [NullAllowed, Export("environment")] + string Environment { get; set; } - // @property (nonatomic) BOOL enableMetrics; - [Export("enableMetrics")] - bool EnableMetrics { get; set; } -} + // @property (copy, nonatomic) NSString * _Nullable transaction; + [NullAllowed, Export("transaction")] + string Transaction { get; set; } -// @interface SentryClient : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry12SentryClient")] -[DisableDefaultCtor] -[Internal] -interface SentryClient -{ - // -(instancetype _Nullable)initWithOptions:(SentryOptions * _Nonnull)options __attribute__((objc_designated_initializer)); - [Export("initWithOptions:")] - [DesignatedInitializer] - NativeHandle Constructor(SentryOptions options); - - // @property (readonly, nonatomic) BOOL isEnabled; - [Export("isEnabled")] - bool IsEnabled { get; } - - // @property (nonatomic, strong) SentryOptions * _Nonnull options; - [Export("options", ArgumentSemantic.Strong)] - SentryOptions Options { get; set; } - - // -(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; - [Export("captureEvent:")] - SentryId CaptureEvent(SentryEvent @event); - - // -(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; - [Export("captureEvent:withScope:")] - SentryId CaptureEvent(SentryEvent @event, SentryScope scope); - - // -(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; - [Export("captureError:")] - SentryId CaptureError(NSError error); - - // -(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; - [Export("captureError:withScope:")] - SentryId CaptureError(NSError error, SentryScope scope); - - // -(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; - [Export("captureException:")] - SentryId CaptureException(NSException exception); - - // -(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; - [Export("captureException:withScope:")] - SentryId CaptureException(NSException exception, SentryScope scope); - - // -(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; - [Export("captureMessage:")] - SentryId CaptureMessage(string message); - - // -(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; - [Export("captureMessage:withScope:")] - SentryId CaptureMessage(string message, SentryScope scope); - - // -(void)captureFeedback:(SentryFeedback * _Nonnull)feedback withScope:(SentryScope * _Nonnull)scope; - [Export("captureFeedback:withScope:")] - void CaptureFeedback(SentryFeedback feedback, SentryScope scope); - - // -(void)captureLog:(SentryLog * _Nonnull)log withScope:(SentryScope * _Nonnull)scope; - [Export("captureLog:withScope:")] - void CaptureLog(SentryLog log, SentryScope scope); - - // -(void)flush:(NSTimeInterval)timeout; - [Export("flush:")] - void Flush(double timeout); - - // -(void)close; - [Export("close")] - void Close(); -} + // @property (copy, nonatomic) NSString * _Nullable type; + [NullAllowed, Export("type")] + string Type { get; set; } -// @interface SentryDebugImageProvider : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry24SentryDebugImageProvider")] -[Internal] -interface SentryDebugImageProvider -{ - // -(NSArray * _Nonnull)getDebugImagesFromCacheForFrames:(NSArray * _Nonnull)frames __attribute__((warn_unused_result(""))); - [Export("getDebugImagesFromCacheForFrames:")] - SentryDebugMeta[] GetDebugImagesFromCacheForFrames(SentryFrame[] frames); + // @property (nonatomic, strong) NSDictionary * _Nullable tags; + [NullAllowed, Export("tags", ArgumentSemantic.Strong)] + NSDictionary Tags { get; set; } - // -(NSArray * _Nonnull)getDebugImagesFromCacheForThreads:(NSArray * _Nonnull)threads __attribute__((warn_unused_result(""))); - [Export("getDebugImagesFromCacheForThreads:")] - SentryDebugMeta[] GetDebugImagesFromCacheForThreads(SentryThread[] threads); + // @property (nonatomic, strong) NSDictionary * _Nullable extra; + [NullAllowed, Export("extra", ArgumentSemantic.Strong)] + NSDictionary Extra { get; set; } - // -(NSArray * _Nonnull)getDebugImagesForImageAddressesFromCache:(NSSet * _Nonnull)imageAddresses __attribute__((warn_unused_result(""))); - [Export("getDebugImagesForImageAddressesFromCache:")] - SentryDebugMeta[] GetDebugImagesForImageAddressesFromCache(NSSet imageAddresses); + // @property (nonatomic, strong) NSDictionary * _Nullable sdk; + [NullAllowed, Export("sdk", ArgumentSemantic.Strong)] + NSDictionary Sdk { get; set; } - // -(NSArray * _Nonnull)getDebugImagesFromCache __attribute__((warn_unused_result(""))); - [Export("getDebugImagesFromCache")] - SentryDebugMeta[] DebugImagesFromCache { get; } -} + // @property (nonatomic, strong) NSDictionary * _Nullable modules; + [NullAllowed, Export("modules", ArgumentSemantic.Strong)] + NSDictionary Modules { get; set; } -// @interface SentryDependencyContainer : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry25SentryDependencyContainer")] -[Internal] -interface SentryDependencyContainer -{ + // @property (nonatomic, strong) NSArray * _Nullable fingerprint; + [NullAllowed, Export("fingerprint", ArgumentSemantic.Strong)] + string[] Fingerprint { get; set; } - // +(SentryDependencyContainer * _Nonnull)sharedInstance __attribute__((warn_unused_result(""))); - [Static] - [Export("sharedInstance")] - SentryDependencyContainer SharedInstance { get; } + // @property (nonatomic, strong) SentryObjCUser * _Nullable user; + [NullAllowed, Export("user", ArgumentSemantic.Strong)] + SentryObjCUser User { get; set; } - // @property (nonatomic, strong) SentryDebugImageProvider * _Nonnull debugImageProvider; - [Export("debugImageProvider", ArgumentSemantic.Strong)] - SentryDebugImageProvider DebugImageProvider { get; set; } -} + // @property (nonatomic, strong) NSDictionary *> * _Nullable context; + [NullAllowed, Export("context", ArgumentSemantic.Strong)] + NSDictionary> Context { get; set; } -// @interface SentryDsn : NSObject -[BaseType(typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryDsn -{ - // @property (readonly, copy, nonatomic) NSURL * _Nonnull url; - [Export("url", ArgumentSemantic.Copy)] - NSUrl Url { get; } + // @property (nonatomic, strong) NSArray * _Nullable threads; + [NullAllowed, Export("threads", ArgumentSemantic.Strong)] + SentryObjCThread[] Threads { get; set; } - // -(instancetype _Nullable)initWithString:(NSString * _Nullable)dsnString didFailWithError:(NSError * _Nullable * _Nullable)error __attribute__((objc_designated_initializer)); - [Export("initWithString:didFailWithError:")] - [DesignatedInitializer] - NativeHandle Constructor([NullAllowed] string dsnString, [NullAllowed] out NSError error); + // @property (nonatomic, strong) NSArray * _Nullable exceptions; + [NullAllowed, Export("exceptions", ArgumentSemantic.Strong)] + SentryObjCException[] Exceptions { get; set; } - // -(NSString * _Nonnull)getHash __attribute__((warn_unused_result(""))); - [Export("getHash")] - string Hash { get; } + // @property (nonatomic, strong) SentryObjCStacktrace * _Nullable stacktrace; + [NullAllowed, Export("stacktrace", ArgumentSemantic.Strong)] + SentryObjCStacktrace Stacktrace { get; set; } - // -(NSURL * _Nonnull)getEnvelopeEndpoint __attribute__((warn_unused_result(""))); - [Export("getEnvelopeEndpoint")] - NSUrl EnvelopeEndpoint { get; } + // @property (nonatomic, strong) NSArray * _Nullable debugMeta; + [NullAllowed, Export("debugMeta", ArgumentSemantic.Strong)] + SentryObjCDebugMeta[] DebugMeta { get; set; } - // @property (readonly, copy, nonatomic) NSString * _Nullable orgId; - [NullAllowed, Export("orgId")] - string OrgId { get; } -} + // @property (nonatomic, strong) NSArray * _Nullable breadcrumbs; + [NullAllowed, Export("breadcrumbs", ArgumentSemantic.Strong)] + SentryObjCBreadcrumb[] Breadcrumbs { get; set; } -// @interface SentryExperimentalOptions : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry25SentryExperimentalOptions")] -[Internal] -interface SentryExperimentalOptions -{ - // @property (nonatomic) BOOL enableUnhandledCPPExceptionsV2; - [Export("enableUnhandledCPPExceptionsV2")] - bool EnableUnhandledCPPExceptionsV2 { get; set; } + // @property (nonatomic, strong) SentryObjCRequest * _Nullable request; + [NullAllowed, Export("request", ArgumentSemantic.Strong)] + SentryObjCRequest Request { get; set; } - // @property (nonatomic) BOOL enableWatchdogTerminationsV2; - [Export("enableWatchdogTerminationsV2")] - bool EnableWatchdogTerminationsV2 { get; set; } + // -(instancetype _Nonnull)initWithLevel:(SentryObjCLevel)level; + [Export("initWithLevel:")] + NativeHandle Constructor(SentryObjCLevel level); - // @property (nonatomic) BOOL enableStandaloneAppStartTracing; - [Export("enableStandaloneAppStartTracing")] - bool EnableStandaloneAppStartTracing { get; set; } + // -(instancetype _Nonnull)initWithError:(NSError * _Nonnull)error; + [Export("initWithError:")] + NativeHandle Constructor(NSError error); } -// @interface SentryFeedback : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry14SentryFeedback")] +// @interface SentryObjCSamplingContext : NSObject +[BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryFeedback +interface SentryObjCSamplingContext { - // @property (readonly, nonatomic, strong) SentryId * _Nonnull eventId; - [Export("eventId", ArgumentSemantic.Strong)] - SentryId EventId { get; } + // @property (readonly, nonatomic, strong) SentryObjCTransactionContext * _Nonnull transactionContext; + [Export("transactionContext", ArgumentSemantic.Strong)] + SentryObjCTransactionContext TransactionContext { get; } - // -(instancetype _Nonnull)initWithMessage:(NSString * _Nonnull)message name:(NSString * _Nullable)name email:(NSString * _Nullable)email source:(enum SentryFeedbackSource)source associatedEventId:(SentryId * _Nullable)associatedEventId attachments:(NSArray * _Nullable)attachments __attribute__((objc_designated_initializer)); - [Export("initWithMessage:name:email:source:associatedEventId:attachments:")] - [DesignatedInitializer] - NativeHandle Constructor(string message, [NullAllowed] string name, [NullAllowed] string email, SentryFeedbackSource source, [NullAllowed] SentryId associatedEventId, [NullAllowed] SentryAttachment[] attachments); -} + // @property (readonly, nonatomic, strong) NSDictionary * _Nullable customSamplingContext; + [NullAllowed, Export("customSamplingContext", ArgumentSemantic.Strong)] + NSDictionary CustomSamplingContext { get; } -// @interface SentryFeedbackAPI : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry17SentryFeedbackAPI")] -[Internal] -interface SentryFeedbackAPI -{ - [Export("showWidget")] - void ShowWidget(); - [Export("hideWidget")] - void HideWidget(); + // -(instancetype _Nonnull)initWithTransactionContext:(SentryObjCTransactionContext * _Nonnull)transactionContext; + [Export("initWithTransactionContext:")] + NativeHandle Constructor(SentryObjCTransactionContext transactionContext); + + // -(instancetype _Nonnull)initWithTransactionContext:(SentryObjCTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; + [Export("initWithTransactionContext:customSamplingContext:")] + NativeHandle Constructor(SentryObjCTransactionContext transactionContext, NSDictionary customSamplingContext); } -// @interface SentryHub : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry9SentryHub")] -[DisableDefaultCtor] +// @interface SentryObjCScope : NSObject +[BaseType(typeof(NSObject))] [Internal] -interface SentryHub +interface SentryObjCScope { - // -(instancetype _Nonnull)initWithClient:(SentryClient * _Nullable)client andScope:(SentryScope * _Nullable)scope __attribute__((objc_designated_initializer)); - [Export("initWithClient:andScope:")] - [DesignatedInitializer] - NativeHandle Constructor([NullAllowed] SentryClient client, [NullAllowed] SentryScope scope); - - // -(void)startSession; - [Export("startSession")] - void StartSession(); - - // -(void)endSession; - [Export("endSession")] - void EndSession(); - - // -(void)endSessionWithTimestamp:(NSDate * _Nonnull)timestamp; - [Export("endSessionWithTimestamp:")] - void EndSessionWithTimestamp(NSDate timestamp); + // @property (copy, nonatomic) NSString * _Nullable replayId; + [NullAllowed, Export("replayId")] + string ReplayId { get; set; } - // -(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; - [Export("captureEvent:")] - SentryId CaptureEvent(SentryEvent @event); + // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull tags; + [Export("tags", ArgumentSemantic.Copy)] + NSDictionary Tags { get; } - // -(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; - [Export("captureEvent:withScope:")] - SentryId CaptureEvent(SentryEvent @event, SentryScope scope); + // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull attributes; + [Export("attributes", ArgumentSemantic.Copy)] + NSDictionary Attributes { get; } - // -(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; - [Export("startTransactionWithName:operation:")] - SentrySpan StartTransactionWithName(string name, string operation); + // -(instancetype _Nonnull)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs; + [Export("initWithMaxBreadcrumbs:")] + NativeHandle Constructor(nint maxBreadcrumbs); - // -(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope; - [Export("startTransactionWithName:operation:bindToScope:")] - SentrySpan StartTransactionWithName(string name, string operation, bool bindToScope); + // -(void)setUser:(SentryObjCUser * _Nullable)user; + [Export("setUser:")] + void SetUser([NullAllowed] SentryObjCUser user); - // -(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext; - [Export("startTransactionWithContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext); + // -(void)setTagValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull)key; + [Export("setTagValue:forKey:")] + void SetTagValue(string value, string key); - // -(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope; - [Export("startTransactionWithContext:bindToScope:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope); + // -(void)removeTagForKey:(NSString * _Nonnull)key; + [Export("removeTagForKey:")] + void RemoveTagForKey(string key); - // -(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; - [Export("startTransactionWithContext:bindToScope:customSamplingContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); + // -(void)setTags:(NSDictionary * _Nullable)tags; + [Export("setTags:")] + void SetTags([NullAllowed] NSDictionary tags); - // -(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; - [Export("startTransactionWithContext:customSamplingContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, NSDictionary customSamplingContext); + // -(void)setExtras:(NSDictionary * _Nullable)extras; + [Export("setExtras:")] + void SetExtras([NullAllowed] NSDictionary extras); - // -(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; - [Export("captureError:")] - SentryId CaptureError(NSError error); + // -(void)setExtraValue:(id _Nullable)value forKey:(NSString * _Nonnull)key; + [Export("setExtraValue:forKey:")] + void SetExtraValue([NullAllowed] NSObject value, string key); - // -(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; - [Export("captureError:withScope:")] - SentryId CaptureError(NSError error, SentryScope scope); + // -(void)removeExtraForKey:(NSString * _Nonnull)key; + [Export("removeExtraForKey:")] + void RemoveExtraForKey(string key); - // -(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; - [Export("captureException:")] - SentryId CaptureException(NSException exception); + // -(void)setDist:(NSString * _Nullable)dist; + [Export("setDist:")] + void SetDist([NullAllowed] string dist); - // -(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; - [Export("captureException:withScope:")] - SentryId CaptureException(NSException exception, SentryScope scope); + // -(void)setEnvironment:(NSString * _Nullable)environment; + [Export("setEnvironment:")] + void SetEnvironment([NullAllowed] string environment); - // -(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; - [Export("captureMessage:")] - SentryId CaptureMessage(string message); + // -(void)setFingerprint:(NSArray * _Nullable)fingerprint; + [Export("setFingerprint:")] + void SetFingerprint([NullAllowed] string[] fingerprint); - // -(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; - [Export("captureMessage:withScope:")] - SentryId CaptureMessage(string message, SentryScope scope); + // -(void)setLevel:(SentryObjCLevel)level; + [Export("setLevel:")] + void SetLevel(SentryObjCLevel level); - // -(void)captureFeedback:(SentryFeedback * _Nonnull)feedback; - [Export("captureFeedback:")] - void CaptureFeedback(SentryFeedback feedback); + // -(void)addBreadcrumb:(SentryObjCBreadcrumb * _Nonnull)crumb; + [Export("addBreadcrumb:")] + void AddBreadcrumb(SentryObjCBreadcrumb crumb); - // -(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; - [Export("configureScope:")] - void ConfigureScope(Action callback); + // -(void)clearBreadcrumbs; + [Export("clearBreadcrumbs")] + void ClearBreadcrumbs(); - // -(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb; - [Export("addBreadcrumb:")] - void AddBreadcrumb(SentryBreadcrumb crumb); + // -(void)addFeatureFlagWithName:(NSString * _Nonnull)name result:(BOOL)result; + [Export("addFeatureFlagWithName:result:")] + void AddFeatureFlagWithName(string name, bool result); - // -(SentryClient * _Nullable)getClient __attribute__((warn_unused_result(""))); - [NullAllowed, Export("getClient")] - SentryClient Client { get; } + // -(void)clearFeatureFlags; + [Export("clearFeatureFlags")] + void ClearFeatureFlags(); - // @property (readonly, nonatomic, strong) SentryScope * _Nonnull scope; - [Export("scope", ArgumentSemantic.Strong)] - SentryScope Scope { get; } + // -(void)setContextValue:(NSDictionary * _Nonnull)value forKey:(NSString * _Nonnull)key; + [Export("setContextValue:forKey:")] + void SetContextValue(NSDictionary value, string key); - // @property (readonly, nonatomic, strong) SentryLogger * _Nonnull logger; - [Export("logger", ArgumentSemantic.Strong)] - SentryLogger Logger { get; } + // -(void)removeContextForKey:(NSString * _Nonnull)key; + [Export("removeContextForKey:")] + void RemoveContextForKey(string key); - // -(void)bindClient:(SentryClient * _Nullable)client; - [Export("bindClient:")] - void BindClient([NullAllowed] SentryClient client); + // -(void)addAttachment:(SentryObjCAttachment * _Nonnull)attachment; + [Export("addAttachment:")] + void AddAttachment(SentryObjCAttachment attachment); - // -(BOOL)hasIntegration:(NSString * _Nonnull)integrationName __attribute__((warn_unused_result(""))); - [Export("hasIntegration:")] - bool HasIntegration(string integrationName); + // -(void)setAttributeValue:(id _Nonnull)value forKey:(NSString * _Nonnull)key; + [Export("setAttributeValue:forKey:")] + void SetAttributeValue(NSObject value, string key); - // -(BOOL)isIntegrationInstalled:(Class _Nonnull)integrationClass __attribute__((warn_unused_result(""))); - [Export("isIntegrationInstalled:")] - bool IsIntegrationInstalled(Class integrationClass); + // -(void)removeAttributeForKey:(NSString * _Nonnull)key; + [Export("removeAttributeForKey:")] + void RemoveAttributeForKey(string key); - // -(void)setUser:(SentryUser * _Nullable)user; - [Export("setUser:")] - void SetUser([NullAllowed] SentryUser user); + // -(void)clearAttachments; + [Export("clearAttachments")] + void ClearAttachments(); - // -(void)reportFullyDisplayed; - [Export("reportFullyDisplayed")] - void ReportFullyDisplayed(); + // @property (nonatomic, strong) SentryObjCSpan * _Nullable span; + [NullAllowed, Export("span", ArgumentSemantic.Strong)] + SentryObjCSpan Span { get; set; } - // -(void)flush:(NSTimeInterval)timeout; - [Export("flush:")] - void Flush(double timeout); + // -(NSDictionary * _Nonnull)serialize; + [Export("serialize")] + NSDictionary Serialize(); - // -(void)close; - [Export("close")] - void Close(); + // -(void)clear; + [Export("clear")] + void Clear(); } -// @interface SentryLog : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry9SentryLog")] +// @interface SentryObjCSpan : NSObject +[BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryLog +interface SentryObjCSpan { - // @property (copy, nonatomic) NSDate * _Nonnull timestamp; - [Export("timestamp", ArgumentSemantic.Copy)] - NSDate Timestamp { get; set; } - - // @property (nonatomic, strong) SentryId * _Nonnull traceId; + // @property (nonatomic, strong) SentryObjCId * _Nonnull traceId; [Export("traceId", ArgumentSemantic.Strong)] - SentryId TraceId { get; set; } + SentryObjCId TraceId { get; set; } - // @property (nonatomic, strong) SentrySpanId * _Nullable spanId; - [NullAllowed, Export("spanId", ArgumentSemantic.Strong)] - SentrySpanId SpanId { get; set; } + // @property (nonatomic, strong) SentryObjCSpanId * _Nonnull spanId; + [Export("spanId", ArgumentSemantic.Strong)] + SentryObjCSpanId SpanId { get; set; } - // @property (nonatomic) enum SentryLogLevel level; - [Export("level", ArgumentSemantic.Assign)] - SentryLogLevel Level { get; set; } + // @property (nonatomic, strong) SentryObjCSpanId * _Nullable parentSpanId; + [NullAllowed, Export("parentSpanId", ArgumentSemantic.Strong)] + SentryObjCSpanId ParentSpanId { get; set; } - // @property (copy, nonatomic) NSString * _Nonnull body; - [Export("body")] - string Body { get; set; } + // @property (nonatomic) SentryObjCSampleDecision sampled; + [Export("sampled", ArgumentSemantic.Assign)] + SentryObjCSampleDecision Sampled { get; set; } - // @property (copy, nonatomic) NSDictionary * _Nonnull attributes; - [Export("attributes", ArgumentSemantic.Copy)] - NSDictionary Attributes { get; set; } + // @property (copy, nonatomic) NSString * _Nonnull operation; + [Export("operation")] + string Operation { get; set; } - // @property (nonatomic, strong) NSNumber * _Nullable severityNumber; - [NullAllowed, Export("severityNumber", ArgumentSemantic.Strong)] - NSNumber SeverityNumber { get; set; } + // @property (copy, nonatomic) NSString * _Nonnull origin; + [Export("origin")] + string Origin { get; set; } - // -(instancetype _Nonnull)initWithLevel:(enum SentryLogLevel)level body:(NSString * _Nonnull)body; - [Export("initWithLevel:body:")] - NativeHandle Constructor(SentryLogLevel level, string body); + // @property (copy, nonatomic) NSString * _Nullable spanDescription; + [NullAllowed, Export("spanDescription")] + string SpanDescription { get; set; } - // -(instancetype _Nonnull)initWithLevel:(enum SentryLogLevel)level body:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("initWithLevel:body:attributes:")] - NativeHandle Constructor(SentryLogLevel level, string body, NSDictionary attributes); -} + // @property (nonatomic) SentryObjCSpanStatus status; + [Export("status", ArgumentSemantic.Assign)] + SentryObjCSpanStatus Status { get; set; } -// @interface SentryLogger : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry12SentryLogger")] -[DisableDefaultCtor] -[Internal] -interface SentryLogger -{ + // @property (nonatomic, strong) NSDate * _Nullable timestamp; + [NullAllowed, Export("timestamp", ArgumentSemantic.Strong)] + NSDate Timestamp { get; set; } + + // @property (nonatomic, strong) NSDate * _Nullable startTimestamp; + [NullAllowed, Export("startTimestamp", ArgumentSemantic.Strong)] + NSDate StartTimestamp { get; set; } - // -(void)trace:(NSString * _Nonnull)body; - [Export("trace:")] - void Trace(string body); + // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull data; + [Export("data", ArgumentSemantic.Copy)] + NSDictionary Data { get; } - // -(void)trace:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("trace:attributes:")] - void Trace(string body, NSDictionary attributes); + // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull tags; + [Export("tags", ArgumentSemantic.Copy)] + NSDictionary Tags { get; } - // -(void)debug:(NSString * _Nonnull)body; - [Export("debug:")] - void Debug(string body); + // @property (readonly, nonatomic) BOOL isFinished; + [Export("isFinished")] + bool IsFinished { get; } - // -(void)debug:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("debug:attributes:")] - void Debug(string body, NSDictionary attributes); + // @property (readonly, nonatomic, strong) SentryObjCTraceContext * _Nullable traceContext; + [NullAllowed, Export("traceContext", ArgumentSemantic.Strong)] + SentryObjCTraceContext TraceContext { get; } - // -(void)info:(NSString * _Nonnull)body; - [Export("info:")] - void Info(string body); + // -(SentryObjCSpan * _Nonnull)startChildWithOperation:(NSString * _Nonnull)operation; + [Export("startChildWithOperation:")] + SentryObjCSpan StartChildWithOperation(string operation); - // -(void)info:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("info:attributes:")] - void Info(string body, NSDictionary attributes); + // -(SentryObjCSpan * _Nonnull)startChildWithOperation:(NSString * _Nonnull)operation description:(NSString * _Nullable)description; + [Export("startChildWithOperation:description:")] + SentryObjCSpan StartChildWithOperation(string operation, [NullAllowed] string description); - // -(void)warn:(NSString * _Nonnull)body; - [Export("warn:")] - void Warn(string body); + // -(void)setDataValue:(id _Nullable)value forKey:(NSString * _Nonnull)key; + [Export("setDataValue:forKey:")] + void SetDataValue([NullAllowed] NSObject value, string key); - // -(void)warn:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("warn:attributes:")] - void Warn(string body, NSDictionary attributes); + // -(void)removeDataForKey:(NSString * _Nonnull)key; + [Export("removeDataForKey:")] + void RemoveDataForKey(string key); - // -(void)error:(NSString * _Nonnull)body; - [Export("error:")] - void Error(string body); + // -(void)setTagValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull)key; + [Export("setTagValue:forKey:")] + void SetTagValue(string value, string key); - // -(void)error:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("error:attributes:")] - void Error(string body, NSDictionary attributes); + // -(void)removeTagForKey:(NSString * _Nonnull)key; + [Export("removeTagForKey:")] + void RemoveTagForKey(string key); - // -(void)fatal:(NSString * _Nonnull)body; - [Export("fatal:")] - void Fatal(string body); + // -(void)setMeasurementWithName:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value; + [Export("setMeasurementWithName:value:")] + void SetMeasurementWithName(string name, NSNumber value); - // -(void)fatal:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; - [Export("fatal:attributes:")] - void Fatal(string body, NSDictionary attributes); -} + // -(void)setMeasurementWithName:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value unit:(SentryObjCMeasurementUnit * _Nonnull)unit; + [Export("setMeasurementWithName:value:unit:")] + void SetMeasurementWithName(string name, NSNumber value, SentryObjCMeasurementUnit unit); -// @interface SentryProfileOptions : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry20SentryProfileOptions")] -[Internal] -interface SentryProfileOptions -{ - // @property (nonatomic) enum SentryProfileLifecycle lifecycle; - [Export("lifecycle", ArgumentSemantic.Assign)] - SentryProfileLifecycle Lifecycle { get; set; } + // -(void)finish; + [Export("finish")] + void Finish(); - // @property (nonatomic) float sessionSampleRate; - [Export("sessionSampleRate")] - float SessionSampleRate { get; set; } + // -(void)finishWithStatus:(SentryObjCSpanStatus)status; + [Export("finishWithStatus:")] + void FinishWithStatus(SentryObjCSpanStatus status); - // @property (nonatomic) BOOL profileAppStarts; - [Export("profileAppStarts")] - bool ProfileAppStarts { get; set; } -} + // -(SentryObjCTraceHeader * _Nonnull)toTraceHeader; + [Export("toTraceHeader")] + SentryObjCTraceHeader ToTraceHeader(); -// @protocol SentryRRWebEvent -[Protocol] -[Internal] -interface ISentryRRWebEvent : SentrySerializable -{ + // -(NSString * _Nullable)baggageHttpHeader; + [NullAllowed, Export("baggageHttpHeader")] + string BaggageHttpHeader { get; } } -// @interface SentryRRWebEvent : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry16SentryRRWebEvent")] +// @interface SentryObjCTraceContext : NSObject +[BaseType(typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryRRWebEvent : ISentryRRWebEvent +interface SentryObjCTraceContext { - // @property (readonly, copy, nonatomic) NSDictionary * _Nullable data; - [NullAllowed, Export("data", ArgumentSemantic.Copy)] - NSDictionary Data { get; } + // @property (readonly, nonatomic, strong) SentryObjCId * _Nonnull traceId; + [Export("traceId", ArgumentSemantic.Strong)] + SentryObjCId TraceId { get; } - // -(NSDictionary * _Nonnull)serialize __attribute__((warn_unused_result(""))); - [Export("serialize")] - NSDictionary Serialize(); -} + // @property (readonly, copy, nonatomic) NSString * _Nonnull publicKey; + [Export("publicKey")] + string PublicKey { get; } -// @protocol SentryRedactOptions -[Protocol(Name = "_TtP6Sentry19SentryRedactOptions_")] -[Internal] -[Model] -[BaseType (typeof(NSObject))] -interface SentryRedactOptions -{ - // @required @property (readonly, nonatomic) BOOL maskAllText; - [Abstract] - [Export("maskAllText")] - bool MaskAllText { get; } + // @property (readonly, copy, nonatomic) NSString * _Nullable releaseName; + [NullAllowed, Export("releaseName")] + string ReleaseName { get; } - // @required @property (readonly, nonatomic) BOOL maskAllImages; - [Abstract] - [Export("maskAllImages")] - bool MaskAllImages { get; } + // @property (readonly, copy, nonatomic) NSString * _Nullable environment; + [NullAllowed, Export("environment")] + string Environment { get; } - // @required @property (readonly, copy, nonatomic) NSArray * _Nonnull maskedViewClasses; - [Abstract] - [Export("maskedViewClasses", ArgumentSemantic.Copy)] - Class[] MaskedViewClasses { get; } + // @property (readonly, copy, nonatomic) NSString * _Nullable transaction; + [NullAllowed, Export("transaction")] + string Transaction { get; } - // @required @property (readonly, copy, nonatomic) NSArray * _Nonnull unmaskedViewClasses; - [Abstract] - [Export("unmaskedViewClasses", ArgumentSemantic.Copy)] - Class[] UnmaskedViewClasses { get; } + // @property (readonly, copy, nonatomic) NSString * _Nullable sampleRate; + [NullAllowed, Export("sampleRate")] + string SampleRate { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable sampleRand; + [NullAllowed, Export("sampleRand")] + string SampleRand { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable sampled; + [NullAllowed, Export("sampled")] + string Sampled { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable replayId; + [NullAllowed, Export("replayId")] + string ReplayId { get; } - // @required @property (readonly, copy, nonatomic) NSSet * _Nonnull excludedViewClasses; - [Abstract] - [Export("excludedViewClasses", ArgumentSemantic.Copy)] - NSSet ExcludedViewClasses { get; } + // @property (readonly, copy, nonatomic) NSString * _Nullable orgId; + [NullAllowed, Export("orgId")] + string OrgId { get; } - // @required @property (readonly, copy, nonatomic) NSSet * _Nonnull includedViewClasses; - [Abstract] - [Export("includedViewClasses", ArgumentSemantic.Copy)] - NSSet IncludedViewClasses { get; } + // -(instancetype _Nullable)initWithTestDict:(NSDictionary * _Nonnull)dict; + [Export("initWithTestDict:")] + NativeHandle Constructor(NSDictionary dict); } -// @protocol SentryReplayBreadcrumbConverter -[Protocol(Name = "_TtP6Sentry31SentryReplayBreadcrumbConverter_")] -[BaseType(typeof(NSObject), Name = "_TtP6Sentry31SentryReplayBreadcrumbConverter_")] +// @interface SentryObjCExperimentalOptions : NSObject +[BaseType(typeof(NSObject))] [Internal] -interface SentryReplayBreadcrumbConverter +interface SentryObjCExperimentalOptions { - // @required -(id _Nullable)convertFrom:(SentryBreadcrumb * _Nonnull)breadcrumb __attribute__((warn_unused_result(""))); - [Abstract] - [Export("convertFrom:")] - [return: NullAllowed] - SentryRRWebEvent ConvertFrom(SentryBreadcrumb breadcrumb); + // @property (nonatomic) BOOL enableUnhandledCPPExceptionsV2; + [Export("enableUnhandledCPPExceptionsV2")] + bool EnableUnhandledCPPExceptionsV2 { get; set; } + + // @property (nonatomic) BOOL enableWatchdogTerminationsV2; + [Export("enableWatchdogTerminationsV2")] + bool EnableWatchdogTerminationsV2 { get; set; } } -// @interface SentryReplayOptions : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry19SentryReplayOptions")] +// @interface SentryObjCOptions : NSObject +[BaseType(typeof(NSObject))] [Internal] -interface SentryReplayOptions : SentryRedactOptions +interface SentryObjCOptions { - // @property (nonatomic) float sessionSampleRate; - [Export("sessionSampleRate")] - float SessionSampleRate { get; set; } + // @property (copy, nonatomic) NSString * _Nullable dsn; + [NullAllowed, Export("dsn")] + string Dsn { get; set; } - // @property (nonatomic) float onErrorSampleRate; - [Export("onErrorSampleRate")] - float OnErrorSampleRate { get; set; } + // @property (nonatomic) BOOL debug; + [Export("debug")] + bool Debug { get; set; } - // @property (nonatomic) BOOL maskAllText; - [Export("maskAllText")] - bool MaskAllText { get; set; } + // @property (nonatomic) SentryObjCLevel diagnosticLevel; + [Export("diagnosticLevel", ArgumentSemantic.Assign)] + SentryObjCLevel DiagnosticLevel { get; set; } - // @property (nonatomic) BOOL maskAllImages; - [Export("maskAllImages")] - bool MaskAllImages { get; set; } + // @property (copy, nonatomic) NSString * _Nullable releaseName; + [NullAllowed, Export("releaseName")] + string ReleaseName { get; set; } - // @property (nonatomic) enum SentryReplayQuality quality; - [Export("quality", ArgumentSemantic.Assign)] - SentryReplayQuality Quality { get; set; } + // @property (copy, nonatomic) NSString * _Nullable dist; + [NullAllowed, Export("dist")] + string Dist { get; set; } - // @property (copy, nonatomic) NSArray * _Nonnull maskedViewClasses; - [Export("maskedViewClasses", ArgumentSemantic.Copy)] - Class[] MaskedViewClasses { get; set; } + // @property (copy, nonatomic) NSString * _Nonnull environment; + [Export("environment")] + string Environment { get; set; } - // @property (copy, nonatomic) NSArray * _Nonnull unmaskedViewClasses; - [Export("unmaskedViewClasses", ArgumentSemantic.Copy)] - Class[] UnmaskedViewClasses { get; set; } + // @property (nonatomic) BOOL enabled; + [Export("enabled")] + bool Enabled { get; set; } - // @property (copy, nonatomic) NSSet * _Nonnull excludedViewClasses; - [Export("excludedViewClasses", ArgumentSemantic.Copy)] - NSSet ExcludedViewClasses { get; set; } + // @property (nonatomic) NSTimeInterval shutdownTimeInterval; + [Export("shutdownTimeInterval")] + double ShutdownTimeInterval { get; set; } - // @property (copy, nonatomic) NSSet * _Nonnull includedViewClasses; - [Export("includedViewClasses", ArgumentSemantic.Copy)] - NSSet IncludedViewClasses { get; set; } + // @property (nonatomic) BOOL enableCrashHandler; + [Export("enableCrashHandler")] + bool EnableCrashHandler { get; set; } - // -(void)excludeViewTypeFromSubtreeTraversal:(NSString * _Nonnull)viewType; - [Export("excludeViewTypeFromSubtreeTraversal:")] - void ExcludeViewTypeFromSubtreeTraversal(string viewType); + // @property (nonatomic) NSUInteger maxBreadcrumbs; + [Export("maxBreadcrumbs")] + nuint MaxBreadcrumbs { get; set; } - // -(void)includeViewTypeInSubtreeTraversal:(NSString * _Nonnull)viewType; - [Export("includeViewTypeInSubtreeTraversal:")] - void IncludeViewTypeInSubtreeTraversal(string viewType); + // @property (nonatomic) BOOL enableNetworkBreadcrumbs; + [Export("enableNetworkBreadcrumbs")] + bool EnableNetworkBreadcrumbs { get; set; } - // @property (nonatomic) BOOL enableExperimentalViewRenderer __attribute__((deprecated("", "enableViewRendererV2"))); - [Export("enableExperimentalViewRenderer")] - bool EnableExperimentalViewRenderer { get; set; } + // @property (nonatomic) NSUInteger maxCacheItems; + [Export("maxCacheItems")] + nuint MaxCacheItems { get; set; } - // @property (nonatomic) BOOL enableViewRendererV2; - [Export("enableViewRendererV2")] - bool EnableViewRendererV2 { get; set; } + // @property (copy, nonatomic) SentryObjCEvent * _Nullable (^ _Nullable)(SentryObjCEvent * _Nonnull) beforeSend; + [NullAllowed, Export("beforeSend", ArgumentSemantic.Copy)] + Func BeforeSend { get; set; } - // @property (nonatomic) BOOL enableFastViewRendering; - [Export("enableFastViewRendering")] - bool EnableFastViewRendering { get; set; } + // @property (copy, nonatomic) SentryObjCSpan * _Nullable (^ _Nullable)(SentryObjCSpan * _Nonnull) beforeSendSpan; + [NullAllowed, Export("beforeSendSpan", ArgumentSemantic.Copy)] + Func BeforeSendSpan { get; set; } - // @property (nonatomic) BOOL networkCaptureBodies; - [Export("networkCaptureBodies")] - bool NetworkCaptureBodies { get; set; } + // @property (nonatomic) BOOL enableLogs; + [Export("enableLogs")] + bool EnableLogs { get; set; } - // @property (copy, nonatomic) NSArray * _Nonnull networkRequestHeaders; - [Export("networkRequestHeaders", ArgumentSemantic.Copy)] - string[] NetworkRequestHeaders { get; set; } + // @property (copy, nonatomic) SentryObjCBreadcrumb * _Nullable (^ _Nullable)(SentryObjCBreadcrumb * _Nonnull) beforeBreadcrumb; + [NullAllowed, Export("beforeBreadcrumb", ArgumentSemantic.Copy)] + Func BeforeBreadcrumb { get; set; } - // @property (copy, nonatomic) NSArray * _Nonnull networkResponseHeaders; - [Export("networkResponseHeaders", ArgumentSemantic.Copy)] - string[] NetworkResponseHeaders { get; set; } + // @property (copy, nonatomic) BOOL (^ _Nullable)(SentryObjCEvent * _Nonnull) beforeCaptureScreenshot; + [NullAllowed, Export("beforeCaptureScreenshot", ArgumentSemantic.Copy)] + Func BeforeCaptureScreenshot { get; set; } - // @property (readonly, nonatomic) NSInteger replayBitRate; - [Export("replayBitRate")] - nint ReplayBitRate { get; } + // @property (copy, nonatomic) BOOL (^ _Nullable)(SentryObjCEvent * _Nonnull) beforeCaptureViewHierarchy; + [NullAllowed, Export("beforeCaptureViewHierarchy", ArgumentSemantic.Copy)] + Func BeforeCaptureViewHierarchy { get; set; } - // @property (readonly, nonatomic) float sizeScale; - [Export("sizeScale")] - float SizeScale { get; } + // @property (copy, nonatomic) void (^ _Nullable)(SentryObjCEvent * _Nonnull) onCrashedLastRun __attribute__((deprecated("Use onLastRunStatusDetermined instead."))); + [NullAllowed, Export("onCrashedLastRun", ArgumentSemantic.Copy)] + Action OnCrashedLastRun { get; set; } - // @property (nonatomic) NSUInteger frameRate; - [Export("frameRate")] - nuint FrameRate { get; set; } + // @property (copy, nonatomic) void (^ _Nullable)(SentryObjCLastRunStatus, SentryObjCEvent * _Nullable) onLastRunStatusDetermined; + [NullAllowed, Export("onLastRunStatusDetermined", ArgumentSemantic.Copy)] + Action OnLastRunStatusDetermined { get; set; } - // @property (nonatomic) NSTimeInterval errorReplayDuration; - [Export("errorReplayDuration")] - double ErrorReplayDuration { get; set; } + // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; + [NullAllowed, Export("sampleRate", ArgumentSemantic.Strong)] + NSNumber SampleRate { get; set; } - // @property (nonatomic) NSTimeInterval sessionSegmentDuration; - [Export("sessionSegmentDuration")] - double SessionSegmentDuration { get; set; } + // @property (nonatomic) BOOL enableAutoSessionTracking; + [Export("enableAutoSessionTracking")] + bool EnableAutoSessionTracking { get; set; } - // @property (nonatomic) NSTimeInterval maximumDuration; - [Export("maximumDuration")] - double MaximumDuration { get; set; } + // @property (nonatomic) BOOL enableGraphQLOperationTracking; + [Export("enableGraphQLOperationTracking")] + bool EnableGraphQLOperationTracking { get; set; } - // -(BOOL)isNetworkDetailCaptureEnabledFor:(NSString * _Nonnull)urlString __attribute__((warn_unused_result(""))); - [Export("isNetworkDetailCaptureEnabledFor:")] - bool IsNetworkDetailCaptureEnabledFor(string urlString); + // @property (nonatomic) BOOL enableWatchdogTerminationTracking; + [Export("enableWatchdogTerminationTracking")] + bool EnableWatchdogTerminationTracking { get; set; } - // -(instancetype _Nonnull)initWithDictionary:(NSDictionary * _Nonnull)dictionary; - [Export("initWithDictionary:")] - NativeHandle Constructor(NSDictionary dictionary); + // @property (nonatomic) NSUInteger sessionTrackingIntervalMillis; + [Export("sessionTrackingIntervalMillis")] + nuint SessionTrackingIntervalMillis { get; set; } - // -(instancetype _Nonnull)initWithSessionSampleRate:(float)sessionSampleRate onErrorSampleRate:(float)onErrorSampleRate maskAllText:(BOOL)maskAllText maskAllImages:(BOOL)maskAllImages enableViewRendererV2:(BOOL)enableViewRendererV2 enableFastViewRendering:(BOOL)enableFastViewRendering; - [Export("initWithSessionSampleRate:onErrorSampleRate:maskAllText:maskAllImages:enableViewRendererV2:enableFastViewRendering:")] - NativeHandle Constructor(float sessionSampleRate, float onErrorSampleRate, bool maskAllText, bool maskAllImages, bool enableViewRendererV2, bool enableFastViewRendering); -} + // @property (nonatomic) BOOL attachStacktrace; + [Export("attachStacktrace")] + bool AttachStacktrace { get; set; } -// @interface SentrySDK : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry9SentrySDK")] -[Internal] -interface SentrySDK -{ - // @property (readonly, nonatomic, strong, class) id _Nullable span; - [Static] - [NullAllowed, Export("span", ArgumentSemantic.Strong)] - SentrySpan Span { get; } + // @property (nonatomic) BOOL attachAllThreads; + [Export("attachAllThreads")] + bool AttachAllThreads { get; set; } - // @property (readonly, nonatomic, class) BOOL isEnabled; - [Static] - [Export("isEnabled")] - bool IsEnabled { get; } + // @property (nonatomic) NSUInteger maxAttachmentSize; + [Export("maxAttachmentSize")] + nuint MaxAttachmentSize { get; set; } - // @property (readonly, nonatomic, strong, class) SentryReplayApi * _Nonnull replay; - [Static] - [Export("replay", ArgumentSemantic.Strong)] - SentryReplayApi Replay { get; } + // @property (nonatomic) BOOL sendDefaultPii; + [Export("sendDefaultPii")] + bool SendDefaultPii { get; set; } - // @property (readonly, nonatomic, strong, class) SentryLogger * _Nonnull logger; - [Static] - [Export("logger", ArgumentSemantic.Strong)] - SentryLogger Logger { get; } + // @property (nonatomic) BOOL enableAutoPerformanceTracing; + [Export("enableAutoPerformanceTracing")] + bool EnableAutoPerformanceTracing { get; set; } - // +(void)startWithOptions:(SentryOptions * _Nonnull)options; - [Static] - [Export("startWithOptions:")] - void StartWithOptions(SentryOptions options); + // @property (nonatomic) BOOL enablePersistingTracesWhenCrashing; + [Export("enablePersistingTracesWhenCrashing")] + bool EnablePersistingTracesWhenCrashing { get; set; } - // +(void)startWithConfigureOptions:(void (^ _Nonnull)(SentryOptions * _Nonnull))configureOptions; - [Static] - [Export("startWithConfigureOptions:")] - void StartWithConfigureOptions(Action configureOptions); + // @property (copy, nonatomic) SentryObjCScope * _Nonnull (^ _Nonnull)(SentryObjCScope * _Nonnull) initialScope; + [Export("initialScope", ArgumentSemantic.Copy)] + Func InitialScope { get; set; } - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; - [Static] - [Export("captureEvent:")] - SentryId CaptureEvent(SentryEvent @event); + // @property (nonatomic) BOOL enableNetworkTracking; + [Export("enableNetworkTracking")] + bool EnableNetworkTracking { get; set; } - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; - [Static] - [Export("captureEvent:withScope:")] - SentryId CaptureEvent(SentryEvent @event, SentryScope scope); + // @property (nonatomic) BOOL enableFileIOTracing; + [Export("enableFileIOTracing")] + bool EnableFileIOTracing { get; set; } - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; - [Static] - [Export("captureEvent:withScopeBlock:")] - SentryId CaptureEvent(SentryEvent @event, Action block); + // @property (nonatomic) BOOL enableDataSwizzling; + [Export("enableDataSwizzling")] + bool EnableDataSwizzling { get; set; } - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event attachAllThreads:(BOOL)attachAllThreads; - [Static] - [Export("captureEvent:attachAllThreads:")] - SentryId CaptureEvent(SentryEvent @event, bool attachAllThreads); + // @property (nonatomic) BOOL enableFileManagerSwizzling; + [Export("enableFileManagerSwizzling")] + bool EnableFileManagerSwizzling { get; set; } - // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; - [Static] - [Export("startTransactionWithName:operation:")] - SentrySpan StartTransactionWithName(string name, string operation); + // @property (nonatomic, strong) NSNumber * _Nullable tracesSampleRate; + [NullAllowed, Export("tracesSampleRate", ArgumentSemantic.Strong)] + NSNumber TracesSampleRate { get; set; } - // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope; - [Static] - [Export("startTransactionWithName:operation:bindToScope:")] - SentrySpan StartTransactionWithName(string name, string operation, bool bindToScope); + // @property (copy, nonatomic) NSNumber * _Nullable (^ _Nullable)(SentryObjCSamplingContext * _Nonnull) tracesSampler; + [NullAllowed, Export("tracesSampler", ArgumentSemantic.Copy)] + Func TracesSampler { get; set; } - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext; - [Static] - [Export("startTransactionWithContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext); + // @property (readonly, nonatomic) BOOL isTracingEnabled; + [Export("isTracingEnabled")] + bool IsTracingEnabled { get; } - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope; - [Static] - [Export("startTransactionWithContext:bindToScope:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope); + // @property (readonly, copy, nonatomic) NSArray * _Nonnull inAppIncludes; + [Export("inAppIncludes", ArgumentSemantic.Copy)] + string[] InAppIncludes { get; } - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; - [Static] - [Export("startTransactionWithContext:bindToScope:customSamplingContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); + [Wrap("WeakUrlSessionDelegate")] + [NullAllowed] + NSUrlSessionDelegate UrlSessionDelegate { get; set; } - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; - [Static] - [Export("startTransactionWithContext:customSamplingContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, NSDictionary customSamplingContext); + // @property (nonatomic, weak) id _Nullable urlSessionDelegate; + [NullAllowed, Export("urlSessionDelegate", ArgumentSemantic.Weak)] + NSObject WeakUrlSessionDelegate { get; set; } - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; - [Static] - [Export("captureError:")] - SentryId CaptureError(NSError error); + // @property (nonatomic, strong) NSURLSession * _Nullable urlSession; + [NullAllowed, Export("urlSession", ArgumentSemantic.Strong)] + NSUrlSession UrlSession { get; set; } - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; - [Static] - [Export("captureError:withScope:")] - SentryId CaptureError(NSError error, SentryScope scope); + // @property (nonatomic) BOOL enableSwizzling; + [Export("enableSwizzling")] + bool EnableSwizzling { get; set; } - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; - [Static] - [Export("captureError:withScopeBlock:")] - SentryId CaptureError(NSError error, Action block); + // @property (copy, nonatomic) NSSet * _Nonnull swizzleClassNameExcludes; + [Export("swizzleClassNameExcludes", ArgumentSemantic.Copy)] + NSSet SwizzleClassNameExcludes { get; set; } - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error attachAllThreads:(BOOL)attachAllThreads; - [Static] - [Export("captureError:attachAllThreads:")] - SentryId CaptureError(NSError error, bool attachAllThreads); + // @property (nonatomic) BOOL enableCoreDataTracing; + [Export("enableCoreDataTracing")] + bool EnableCoreDataTracing { get; set; } - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; - [Static] - [Export("captureException:")] - SentryId CaptureException(NSException exception); + // @property (nonatomic) BOOL sendClientReports; + [Export("sendClientReports")] + bool SendClientReports { get; set; } - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; - [Static] - [Export("captureException:withScope:")] - SentryId CaptureException(NSException exception, SentryScope scope); + // @property (nonatomic) BOOL enableAppHangTracking; + [Export("enableAppHangTracking")] + bool EnableAppHangTracking { get; set; } - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; - [Static] - [Export("captureException:withScopeBlock:")] - SentryId CaptureException(NSException exception, Action block); + // @property (nonatomic) NSTimeInterval appHangTimeoutInterval; + [Export("appHangTimeoutInterval")] + double AppHangTimeoutInterval { get; set; } - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception attachAllThreads:(BOOL)attachAllThreads; - [Static] - [Export("captureException:attachAllThreads:")] - SentryId CaptureException(NSException exception, bool attachAllThreads); + // @property (nonatomic) BOOL enableAutoBreadcrumbTracking; + [Export("enableAutoBreadcrumbTracking")] + bool EnableAutoBreadcrumbTracking { get; set; } - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; - [Static] - [Export("captureMessage:")] - SentryId CaptureMessage(string message); + // @property (nonatomic) BOOL enablePropagateTraceparent; + [Export("enablePropagateTraceparent")] + bool EnablePropagateTraceparent { get; set; } + + // @property (copy, nonatomic) NSArray * _Nonnull tracePropagationTargets; + [Export("tracePropagationTargets", ArgumentSemantic.Copy)] + NSObject[] TracePropagationTargets { get; set; } - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; - [Static] - [Export("captureMessage:withScope:")] - SentryId CaptureMessage(string message, SentryScope scope); + // @property (nonatomic) BOOL enableCaptureFailedRequests; + [Export("enableCaptureFailedRequests")] + bool EnableCaptureFailedRequests { get; set; } - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; - [Static] - [Export("captureMessage:withScopeBlock:")] - SentryId CaptureMessage(string message, Action block); + // @property (copy, nonatomic) NSArray * _Nonnull failedRequestStatusCodes; + [Export("failedRequestStatusCodes", ArgumentSemantic.Copy)] + SentryObjCHttpStatusCodeRange[] FailedRequestStatusCodes { get; set; } - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message attachAllThreads:(BOOL)attachAllThreads; - [Static] - [Export("captureMessage:attachAllThreads:")] - SentryId CaptureMessage(string message, bool attachAllThreads); + // @property (copy, nonatomic) NSArray * _Nonnull failedRequestTargets; + [Export("failedRequestTargets", ArgumentSemantic.Copy)] + NSObject[] FailedRequestTargets { get; set; } - // +(void)captureFeedback:(SentryFeedback * _Nonnull)feedback; - [Static] - [Export("captureFeedback:")] - void CaptureFeedback(SentryFeedback feedback); - [Static] - [Export("feedback", ArgumentSemantic.Strong)] - SentryFeedbackAPI Feedback { get; } + // @property (nonatomic) BOOL enableTimeToFullDisplayTracing; + [Export("enableTimeToFullDisplayTracing")] + bool EnableTimeToFullDisplayTracing { get; set; } - // +(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb; - [Static] - [Export("addBreadcrumb:")] - void AddBreadcrumb(SentryBreadcrumb crumb); + // @property (nonatomic) BOOL swiftAsyncStacktraces; + [Export("swiftAsyncStacktraces")] + bool SwiftAsyncStacktraces { get; set; } - // +(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; - [Static] - [Export("configureScope:")] - void ConfigureScope(Action callback); + // @property (copy, nonatomic) NSString * _Nonnull cacheDirectoryPath; + [Export("cacheDirectoryPath")] + string CacheDirectoryPath { get; set; } - // @property (readonly, nonatomic, class) BOOL crashedLastRun __attribute__((deprecated("Use lastRunStatus instead, which distinguishes between 'did not crash' and 'unknown'."))); - [Static] - [Export("crashedLastRun")] - bool CrashedLastRun { get; } + // @property (nonatomic) BOOL enableSpotlight; + [Export("enableSpotlight")] + bool EnableSpotlight { get; set; } - // @property (readonly, nonatomic, class) enum SentryLastRunStatus lastRunStatus; - [Static] - [Export("lastRunStatus")] - SentryLastRunStatus LastRunStatus { get; } + // @property (copy, nonatomic) NSString * _Nonnull spotlightUrl; + [Export("spotlightUrl")] + string SpotlightUrl { get; set; } - // @property (readonly, nonatomic, class) BOOL detectedStartUpCrash; - [Static] - [Export("detectedStartUpCrash")] - bool DetectedStartUpCrash { get; } + // @property (nonatomic) BOOL strictTraceContinuation; + [Export("strictTraceContinuation")] + bool StrictTraceContinuation { get; set; } - // +(void)setUser:(SentryUser * _Nullable)user; - [Static] - [Export("setUser:")] - void SetUser([NullAllowed] SentryUser user); + // @property (copy, nonatomic) NSString * _Nullable orgId; + [NullAllowed, Export("orgId")] + string OrgId { get; set; } - // +(void)startSession; - [Static] - [Export("startSession")] - void StartSession(); + // @property (nonatomic, strong) SentryObjCExperimentalOptions * _Nonnull experimental; + [Export("experimental", ArgumentSemantic.Strong)] + SentryObjCExperimentalOptions Experimental { get; set; } - // +(void)endSession; - [Static] - [Export("endSession")] - void EndSession(); + // @property (nonatomic) BOOL enableMetrics; + [Export("enableMetrics")] + bool EnableMetrics { get; set; } - // +(void)crash; - [Static] - [Export("crash")] - void Crash(); + // @property (nonatomic) BOOL enableUIViewControllerTracing; + [Export("enableUIViewControllerTracing")] + bool EnableUIViewControllerTracing { get; set; } - // +(void)reportFullyDisplayed; - [Static] - [Export("reportFullyDisplayed")] - void ReportFullyDisplayed(); + // @property (nonatomic) BOOL attachScreenshot; + [Export("attachScreenshot")] + bool AttachScreenshot { get; set; } - // +(void)extendAppStart; - [Static] - [Export("extendAppStart")] - void ExtendAppStart(); + // @property (nonatomic) BOOL attachViewHierarchy; + [Export("attachViewHierarchy")] + bool AttachViewHierarchy { get; set; } - // +(id _Nullable)getExtendedAppStartSpan __attribute__((warn_unused_result(""))); - [Static] - [NullAllowed, Export("getExtendedAppStartSpan")] - SentrySpan ExtendedAppStartSpan { get; } + // @property (nonatomic) BOOL reportAccessibilityIdentifier; + [Export("reportAccessibilityIdentifier")] + bool ReportAccessibilityIdentifier { get; set; } - // +(void)finishExtendedAppStart; - [Static] - [Export("finishExtendedAppStart")] - void FinishExtendedAppStart(); + // @property (nonatomic) BOOL enableUserInteractionTracing; + [Export("enableUserInteractionTracing")] + bool EnableUserInteractionTracing { get; set; } - // +(void)pauseAppHangTracking; - [Static] - [Export("pauseAppHangTracking")] - void PauseAppHangTracking(); + // @property (nonatomic) NSTimeInterval idleTimeout; + [Export("idleTimeout")] + double IdleTimeout { get; set; } - // +(void)resumeAppHangTracking; - [Static] - [Export("resumeAppHangTracking")] - void ResumeAppHangTracking(); + // @property (nonatomic) BOOL enablePreWarmedAppStartTracing; + [Export("enablePreWarmedAppStartTracing")] + bool EnablePreWarmedAppStartTracing { get; set; } - // +(void)flush:(NSTimeInterval)timeout; - [Static] - [Export("flush:")] - void Flush(double timeout); + // @property (nonatomic) BOOL enableReportNonFullyBlockingAppHangs; + [Export("enableReportNonFullyBlockingAppHangs")] + bool EnableReportNonFullyBlockingAppHangs { get; set; } - // +(void)close; - [Static] - [Export("close")] - void Close(); + // @property (nonatomic, strong) SentryObjCReplayOptions * _Nonnull sessionReplay; + [Export("sessionReplay", ArgumentSemantic.Strong)] + SentryObjCReplayOptions SessionReplay { get; set; } - // +(void)startProfiler; - [Static] - [Export("startProfiler")] - void StartProfiler(); + // @property (nonatomic) BOOL enableSigtermReporting; + [Export("enableSigtermReporting")] + bool EnableSigtermReporting { get; set; } - // +(void)stopProfiler; - [Static] - [Export("stopProfiler")] - void StopProfiler(); + // @property (nonatomic) BOOL enableMetricKit; + [Export("enableMetricKit")] + bool EnableMetricKit { get; set; } - // @property (readonly, nonatomic, strong, class) SentryOptions * _Nullable startOption; - [Static] - [NullAllowed, Export("startOption", ArgumentSemantic.Strong)] - SentryOptions StartOption { get; } + // @property (nonatomic) BOOL enableMetricKitRawPayload; + [Export("enableMetricKitRawPayload")] + bool EnableMetricKitRawPayload { get; set; } - // +(void)setStartWith:(SentryOptions * _Nullable)option; - [Static] - [Export("setStartWith:")] - void SetStartWith([NullAllowed] SentryOptions option); + // -(void)addInAppInclude:(NSString * _Nonnull)inAppInclude; + [Export("addInAppInclude:")] + void AddInAppInclude(string inAppInclude); } -// @interface SentryScreenFrames : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry18SentryScreenFrames")] -[DisableDefaultCtor] +// @interface SentryObjCReplayOptions : NSObject +[BaseType(typeof(NSObject))] [Internal] -interface SentryScreenFrames +interface SentryObjCReplayOptions { - // @property (readonly, nonatomic) NSUInteger total; - [Export("total")] - nuint Total { get; } - - // @property (readonly, nonatomic) NSUInteger frozen; - [Export("frozen")] - nuint Frozen { get; } - - // @property (readonly, nonatomic) NSUInteger slow; - [Export("slow")] - nuint Slow { get; } - - // @property (readonly, copy, nonatomic) NSArray *> * _Nonnull slowFrameTimestamps; - [Export("slowFrameTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] SlowFrameTimestamps { get; } - - // @property (readonly, copy, nonatomic) NSArray *> * _Nonnull frozenFrameTimestamps; - [Export("frozenFrameTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] FrozenFrameTimestamps { get; } - - // @property (readonly, copy, nonatomic) NSArray *> * _Nonnull frameRateTimestamps; - [Export("frameRateTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] FrameRateTimestamps { get; } - - // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow __attribute__((objc_designated_initializer)); - [Export("initWithTotal:frozen:slow:")] - [DesignatedInitializer] - NativeHandle Constructor(nuint total, nuint frozen, nuint slow); - - // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow slowFrameTimestamps:(NSArray *> * _Nonnull)slowFrameTimestamps frozenFrameTimestamps:(NSArray *> * _Nonnull)frozenFrameTimestamps frameRateTimestamps:(NSArray *> * _Nonnull)frameRateTimestamps __attribute__((objc_designated_initializer)); - [Export("initWithTotal:frozen:slow:slowFrameTimestamps:frozenFrameTimestamps:frameRateTimestamps:")] - [DesignatedInitializer] - NativeHandle Constructor(nuint total, nuint frozen, nuint slow, NSDictionary[] slowFrameTimestamps, NSDictionary[] frozenFrameTimestamps, NSDictionary[] frameRateTimestamps); - - // @property (readonly, nonatomic) NSUInteger hash; - [Export("hash")] - nuint Hash { get; } -} + // @property (nonatomic) float sessionSampleRate; + [Export("sessionSampleRate")] + float SessionSampleRate { get; set; } -// @protocol SentryViewScreenshotProvider -[Protocol(Name = "_TtP6Sentry28SentryViewScreenshotProvider_")] -[BaseType(typeof(NSObject), Name = "_TtP6Sentry28SentryViewScreenshotProvider_")] -[Internal] -interface SentryViewScreenshotProvider -{ - // @required -(void)imageWithView:(UIView * _Nonnull)view onComplete:(void (^ _Nonnull)(UIImage * _Nonnull))onComplete; - [Abstract] - [Export("imageWithView:onComplete:")] - void OnComplete(UIView view, Action onComplete); -} + // @property (nonatomic) float onErrorSampleRate; + [Export("onErrorSampleRate")] + float OnErrorSampleRate { get; set; } + + // @property (nonatomic) BOOL maskAllText; + [Export("maskAllText")] + bool MaskAllText { get; set; } + + // @property (nonatomic) BOOL maskAllImages; + [Export("maskAllImages")] + bool MaskAllImages { get; set; } + + // @property (nonatomic) SentryObjCReplayQuality quality; + [Export("quality", ArgumentSemantic.Assign)] + SentryObjCReplayQuality Quality { get; set; } -// @interface SentryViewScreenshotOptions : NSObject -[BaseType(typeof(NSObject), Name = "_TtC6Sentry27SentryViewScreenshotOptions")] -[Internal] -interface SentryViewScreenshotOptions : SentryRedactOptions -{ // @property (nonatomic) BOOL enableViewRendererV2; [Export("enableViewRendererV2")] bool EnableViewRendererV2 { get; set; } @@ -2817,14 +1627,6 @@ interface SentryViewScreenshotOptions : SentryRedactOptions [Export("enableFastViewRendering")] bool EnableFastViewRendering { get; set; } - // @property (nonatomic) BOOL maskAllImages; - [Export("maskAllImages")] - bool MaskAllImages { get; set; } - - // @property (nonatomic) BOOL maskAllText; - [Export("maskAllText")] - bool MaskAllText { get; set; } - // @property (copy, nonatomic) NSArray * _Nonnull maskedViewClasses; [Export("maskedViewClasses", ArgumentSemantic.Copy)] Class[] MaskedViewClasses { get; set; } @@ -2833,13 +1635,17 @@ interface SentryViewScreenshotOptions : SentryRedactOptions [Export("unmaskedViewClasses", ArgumentSemantic.Copy)] Class[] UnmaskedViewClasses { get; set; } - // @property (readonly, copy, nonatomic) NSSet * _Nonnull excludedViewClasses; - [Export("excludedViewClasses", ArgumentSemantic.Copy)] - NSSet ExcludedViewClasses { get; } + // @property (nonatomic) BOOL networkCaptureBodies; + [Export("networkCaptureBodies")] + bool NetworkCaptureBodies { get; set; } + + // @property (copy, nonatomic) NSArray * _Nonnull networkRequestHeaders; + [Export("networkRequestHeaders", ArgumentSemantic.Copy)] + string[] NetworkRequestHeaders { get; set; } - // @property (readonly, copy, nonatomic) NSSet * _Nonnull includedViewClasses; - [Export("includedViewClasses", ArgumentSemantic.Copy)] - NSSet IncludedViewClasses { get; } + // @property (copy, nonatomic) NSArray * _Nonnull networkResponseHeaders; + [Export("networkResponseHeaders", ArgumentSemantic.Copy)] + string[] NetworkResponseHeaders { get; set; } // -(void)excludeViewTypeFromSubtreeTraversal:(NSString * _Nonnull)viewType; [Export("excludeViewTypeFromSubtreeTraversal:")] @@ -2848,23 +1654,6 @@ interface SentryViewScreenshotOptions : SentryRedactOptions // -(void)includeViewTypeInSubtreeTraversal:(NSString * _Nonnull)viewType; [Export("includeViewTypeInSubtreeTraversal:")] void IncludeViewTypeInSubtreeTraversal(string viewType); - - // -(instancetype _Nonnull)initWithEnableViewRendererV2:(BOOL)enableViewRendererV2 enableFastViewRendering:(BOOL)enableFastViewRendering maskAllText:(BOOL)maskAllText maskAllImages:(BOOL)maskAllImages maskedViewClasses:(NSArray * _Nonnull)maskedViewClasses unmaskedViewClasses:(NSArray * _Nonnull)unmaskedViewClasses excludedViewClasses:(NSSet * _Nonnull)excludedViewClasses includedViewClasses:(NSSet * _Nonnull)includedViewClasses __attribute__((objc_designated_initializer)); - [Export("initWithEnableViewRendererV2:enableFastViewRendering:maskAllText:maskAllImages:maskedViewClasses:unmaskedViewClasses:excludedViewClasses:includedViewClasses:")] - [DesignatedInitializer] - NativeHandle Constructor(bool enableViewRendererV2, bool enableFastViewRendering, bool maskAllText, bool maskAllImages, Class[] maskedViewClasses, Class[] unmaskedViewClasses, NSSet excludedViewClasses, NSSet includedViewClasses); -} - -// @interface SentryObjCSDK : NSObject -[BaseType(typeof(NSObject))] -[Internal] -interface SentryObjCSDK -{ - - // @property (readonly, nonatomic, class) SentryObjCInternalApi * _Nonnull internal; - [Static] - [Export("internal")] - SentryObjCInternalApi Internal { get; } } // @interface SentryObjCInternalApi : NSObject @@ -2877,6 +1666,10 @@ interface SentryObjCInternalApi [Export("sdk")] SentryObjCInternalSdkApi Sdk { get; } + // @property (readonly, nonatomic) SentryObjCInternalDebugApi * _Nonnull debug; + [Export("debug")] + SentryObjCInternalDebugApi Debug { get; } + // @property (readonly, nonatomic) SentryObjCInternalProfilingApi * _Nonnull profiling; [Export("profiling")] SentryObjCInternalProfilingApi Profiling { get; } @@ -2890,35 +1683,18 @@ interface SentryObjCInternalApi void IgnoreNextSignal(int signum); } -// @interface SentryObjCInternalSdkApi : NSObject +// @interface SentryObjCInternalDebugApi : NSObject [BaseType(typeof(NSObject))] -[DisableDefaultCtor] [Internal] -interface SentryObjCInternalSdkApi +interface SentryObjCInternalDebugApi { - // @property (copy, nonatomic) NSString * _Nonnull name; - [Export("name")] - string Name { get; set; } - - // @property (copy, nonatomic) NSString * _Nonnull versionString; - [Export("versionString")] - string VersionString { get; set; } - - // -(void)setName:(NSString * _Nonnull)name version:(NSString * _Nonnull)version; - [Export("setName:version:")] - void SetName(string name, string version); - - // -(void)addPackageName:(NSString * _Nonnull)name version:(NSString * _Nonnull)version; - [Export("addPackageName:version:")] - void AddPackageName(string name, string version); - - // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull extraContext; - [Export("extraContext", ArgumentSemantic.Copy)] - NSDictionary ExtraContext { get; } + // @property (readonly, copy, nonatomic) NSArray * _Nonnull images; + [Export("images", ArgumentSemantic.Copy)] + SentryObjCDebugMeta[] Images { get; } - // @property (readonly, copy, nonatomic) NSString * _Nonnull installationID; - [Export("installationID")] - string InstallationID { get; } + // -(NSArray * _Nonnull)imagesForAddresses:(NSArray * _Nonnull)addresses; + [Export("imagesForAddresses:")] + SentryObjCDebugMeta[] ImagesForAddresses(NSNumber[] addresses); } // @interface SentryObjCInternalProfilingApi : NSObject @@ -2941,48 +1717,65 @@ interface SentryObjCInternalProfilingApi void DiscardFor(SentryObjCId traceId); } -// @interface SentryObjCId : NSObject +// @interface SentryObjCInternalSdkApi : NSObject [BaseType(typeof(NSObject))] +[DisableDefaultCtor] [Internal] -interface SentryObjCId +interface SentryObjCInternalSdkApi { - // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; - [Export("sentryIdString")] - string SentryIdString { get; } + // @property (copy, nonatomic) NSString * _Nonnull name; + [Export("name")] + string Name { get; set; } - // @property (readonly, nonatomic, strong, class) SentryObjCId * _Nonnull empty; - [Static] - [Export("empty", ArgumentSemantic.Strong)] - SentryObjCId Empty { get; } + // @property (copy, nonatomic) NSString * _Nonnull versionString; + [Export("versionString")] + string VersionString { get; set; } - // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid; - [Export("initWithUuid:")] - NativeHandle Constructor(NSUuid uuid); + // -(void)setName:(NSString * _Nonnull)name version:(NSString * _Nonnull)version; + [Export("setName:version:")] + void SetName(string name, string version); - // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString; - [Export("initWithUUIDString:")] - NativeHandle Constructor(string uuidString); + // -(void)addPackageName:(NSString * _Nonnull)name version:(NSString * _Nonnull)version; + [Export("addPackageName:version:")] + void AddPackageName(string name, string version); + + // @property (readonly, copy, nonatomic) NSDictionary * _Nonnull extraContext; + [Export("extraContext", ArgumentSemantic.Copy)] + NSDictionary ExtraContext { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull installationID; + [Export("installationID")] + string InstallationID { get; } } -// @interface SentryObjCSpanId : NSObject +// @interface SentryObjCSDK : NSObject [BaseType(typeof(NSObject))] [Internal] -interface SentryObjCSpanId +interface SentryObjCSDK { - // @property (readonly, copy, nonatomic) NSString * _Nonnull sentrySpanIdString; - [Export("sentrySpanIdString")] - string SentrySpanIdString { get; } - // @property (readonly, nonatomic, strong, class) SentryObjCSpanId * _Nonnull empty; + // @property (readonly, nonatomic, class) SentryObjCInternalApi * _Nonnull internal; [Static] - [Export("empty", ArgumentSemantic.Strong)] - SentryObjCSpanId Empty { get; } + [Export("internal")] + SentryObjCInternalApi Internal { get; } - // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid; - [Export("initWithUuid:")] - NativeHandle Constructor(NSUuid uuid); + // @property (readonly, nonatomic, class) BOOL crashedLastRun __attribute__((deprecated("Use lastRunStatus instead."))); + [Static] + [Export("crashedLastRun")] + bool CrashedLastRun { get; } - // -(instancetype _Nonnull)initWithValue:(NSString * _Nonnull)value; - [Export("initWithValue:")] - NativeHandle Constructor(string value); + // +(void)startWithOptions:(SentryObjCOptions * _Nonnull)options; + [Static] + [Export("startWithOptions:")] + void StartWithOptions(SentryObjCOptions options); + + // +(void)configureScope:(void (^ _Nonnull)(SentryObjCScope * _Nonnull))callback; + [Static] + [Export("configureScope:")] + void ConfigureScope(Action callback); + + // +(void)crash; + [Static] + [Export("crash")] + void Crash(); } diff --git a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs index 55f59db3fe..7d1cfe238c 100644 --- a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs @@ -4,22 +4,72 @@ namespace Sentry.CocoaSdk; -// SentryScope.ApplyToEvent was made private in 8.x, but we use it in our CocoaEventProcessor class. -// TODO: Find a better way than using the private API. -partial interface SentryScope +// ----------------------------------------------------------------------------- +// Classic Sentry.framework holdouts. +// +// getsentry/sentry-dotnet#5444 migrated the generated bindings from the classic +// `Sentry*` Objective-C classes to the new `SentryObjC*` surface. Two consumers +// still depend on classic APIs that the `SentryObjC*` surface does not (yet) expose, +// so we keep binding just those classic types here by hand until follow-up work lands: +// +// 1. CocoaEventProcessor enriches .NET-captured events with the native SDK's contexts +// by applying the current scope to a throwaway event. `SentryObjCScope` exposes +// `serialize` but no `applyToEvent:maxBreadcrumb:`, so we still use classic +// `SentrySDK.configureScope` + `SentryScope.applyToEvent` + `SentryEvent.context`. +// +// 2. The envelope/JSON serialization path type-tests native objects against cocoa's +// `SentrySerializable` protocol. `SentryObjC*` types have `serialize` methods but +// expose no exported protocol to test against, so we keep the classic protocol. +// +// These classes still ship in Sentry.framework (linked alongside SentryObjC), so the +// hand-written bindings below resolve at runtime. See getsentry/sentry-dotnet#5444. +// ----------------------------------------------------------------------------- + +// SentrySDK.configureScope is used by CocoaEventProcessor to obtain the classic scope. +[Internal] +[BaseType(typeof(NSObject), Name = "_TtC6Sentry9SentrySDK")] +[DisableDefaultCtor] +interface SentrySDK +{ + // +(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; + [Static] + [Export("configureScope:")] + void ConfigureScope(Action callback); +} + +// SentryScope.applyToEvent was made private in 8.x, but we use it in CocoaEventProcessor. +// TODO: Find a better way than using the private API (getsentry/sentry-dotnet#5444). +[Internal] +[BaseType(typeof(NSObject))] +[DisableDefaultCtor] +interface SentryScope { // -(SentryEvent * _Nullable)applyToEvent:(SentryEvent * _Nonnull)event maxBreadcrumb:(NSUInteger)maxBreadcrumbs; - [Export ("applyToEvent:maxBreadcrumb:")] + [Export("applyToEvent:maxBreadcrumb:")] [return: NullAllowed] - SentryEvent ApplyToEvent (SentryEvent @event, nuint maxBreadcrumbs); + SentryEvent ApplyToEvent(SentryEvent @event, nuint maxBreadcrumbs); } -// The following types are type-forwarded in various public headers, but have no headers of their own. -// Generate stub classes so the APIs that use them can still operate. +// A minimal binding of the classic SentryEvent - CocoaEventProcessor creates a throwaway +// instance and reads its populated `context` dictionary. +[Internal] +[BaseType(typeof(NSObject))] +interface SentryEvent +{ + // @property (nonatomic, strong) NSDictionary *> * _Nullable context; + [NullAllowed, Export("context", ArgumentSemantic.Strong)] + NSDictionary> Context { get; set; } +} +// The classic SentrySerializable protocol. Envelope serialization type-tests native +// objects against ISentrySerializable and calls serialize() before JSON-encoding. [Internal] -[DisableDefaultCtor] -[BaseType (typeof(NSObject))] -interface SentryTracer +[Protocol, Model] +[BaseType(typeof(NSObject))] +interface SentrySerializable { + // @required -(NSDictionary * _Nonnull)serialize; + [Abstract] + [Export("serialize")] + NSDictionary Serialize(); } diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 6f23ff8266..ca98aaeb2d 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -116,8 +116,12 @@ - - + $(GeneratedSourcesDir)SupportDelegates.g.cs diff --git a/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs index 10d8c2ea43..2b9f180fd6 100644 --- a/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs @@ -6,58 +6,74 @@ #nullable enable -using System.Runtime.InteropServices; -using Foundation; using ObjCRuntime; namespace Sentry.CocoaSdk; [Native] -internal enum SentryAttachmentType : long +internal enum SentryObjCAttachmentType : long { - EventAttachment, + EventAttachment = 0, ViewHierarchy } [Native] -internal enum SentryLevel : ulong +internal enum SentryObjCFeedbackSource : long +{ + Widget = 0, + Custom +} + +[Native] +internal enum SentryObjCLastRunStatus : long +{ + Unknown = 0, + DidNotCrash, + DidCrash +} + +[Native] +internal enum SentryObjCLevel : ulong { None = 0, - Debug = 1, - Info = 2, - Warning = 3, - Error = 4, - Fatal = 5 + Debug, + Info, + Warning, + Error, + Fatal +} + +[Native] +internal enum SentryObjCLogLevel : long +{ + Trace = 0, + Debug, + Info, + Warn, + Error, + Fatal } [Native] -internal enum SentryError : long +internal enum SentryObjCReplayQuality : long { - UnknownError = -1, - InvalidDsnError = 100, - SentryCrashNotInstalledError = 101, - InvalidCrashReportError = 102, - CompressionError = 103, - JsonConversionError = 104, - CouldNotFindDirectory = 105, - RequestError = 106, - EventNotSent = 107, - FileIO = 108, - Kernel = 109 + Low = 0, + Medium, + High } [Native] -internal enum SentrySampleDecision : ulong +internal enum SentryObjCSampleDecision : ulong { - Undecided, + Undecided = 0, Yes, No } [Native] -internal enum SentrySpanStatus : ulong +internal enum SentryObjCSpanStatus : ulong { - Undefined, + Undefined = 0, Ok, DeadlineExceeded, Unauthenticated, @@ -78,145 +94,30 @@ internal enum SentrySpanStatus : ulong } [Native] -internal enum SentryAppStartType : ulong -{ - Warm, - Cold, - Unknown -} - -[Native] -internal enum SentryANRType : long +internal enum SentryObjCTransactionNameSource : long { - FatalFullyBlocking = 0, - FatalNonFullyBlocking = 1, - FullyBlocking = 2, - NonFullyBlocking = 3, - Unknown = 4 -} - -[Native] -internal enum SentryDataCategory : ulong -{ - All = 0, - Default = 1, - Error = 2, - Session = 3, - Transaction = 4, - Attachment = 5, - UserFeedback = 6, - Profile = 7, - MetricBucket = 8, - Replay = 9, - ProfileChunkUI = 10, - Span = 11, - Feedback = 12, - LogItem = 13, - TraceMetric = 14, - LogByte = 15, - TraceMetricByte = 16, - Unknown = 17 -} - -[Native] -internal enum SentryDiscardReason : ulong -{ - BeforeSend = 0, - EventProcessor = 1, - SampleRate = 2, - NetworkError = 3, - QueueOverflow = 4, - CacheOverflow = 5, - RateLimitBackoff = 6, - InsufficientData = 7, - SendError = 8 -} - -[Native] -internal enum SentryExtensionType : long -{ - Widget = 0, - Intent = 1, - Action = 2, - Share = 3, - NotificationService = 4 -} - -[Native] -internal enum SentryFeedbackSource : long -{ - Widget = 0, - Custom = 1 -} - -[Native] -internal enum SentryFlushResult : long -{ - Success = 0, - TimedOut = 1, - AlreadyFlushing = 2 -} - -[Native] -internal enum SentryHttpStatusCode : long -{ - Ok = 200, - Created = 201, - BadRequest = 400, - PreconditionFailed = 412, - ContentTooLarge = 413, - TooManyRequests = 429, - InternalServerError = 500 -} - -[Native] -internal enum SentryLastRunStatus : long -{ - Unknown = 0, - DidNotCrash = 1, - DidCrash = 2 -} - -[Native] -internal enum SentryLogLevel : long -{ - Trace = 0, - Debug = 1, - Info = 2, - Warn = 3, - Error = 4, - Fatal = 5 -} - -[Native] -internal enum SentryProfileLifecycle : long -{ - Manual = 0, - Trace = 1 -} - -[Native] -internal enum SentryReplayQuality : long -{ - Low = 0, - Medium = 1, - High = 2 + Custom = 0, + Url, + Route, + View, + Component, + Task } [Native] -internal enum SentryReplayType : long +internal enum SentryObjCRedactRegionType : long { - Session = 0, - Buffer = 1 + Redact = 0, + ClipOut, + ClipBegin, + ClipEnd, + RedactSwiftUI } [Native] -internal enum SentryTransactionNameSource : long +internal enum SentryObjCSwizzleMode : long { - Custom = 0, - Url = 1, - Route = 2, - View = 3, - Component = 4, - Task = 5 + Always = 0, + OncePerClass = 1, + OncePerClassAndSuperclasses = 2 } diff --git a/src/Sentry/Platforms/Cocoa/CFunctions.cs b/src/Sentry/Platforms/Cocoa/CFunctions.cs index b543d34b9d..cf949946a7 100644 --- a/src/Sentry/Platforms/Cocoa/CFunctions.cs +++ b/src/Sentry/Platforms/Cocoa/CFunctions.cs @@ -12,7 +12,7 @@ internal static Dictionary LoadDebugImages(IDiagnosticLogger? var result = new Dictionary(); try { - var cList = SentryCocoaDependencyContainer.SharedInstance.DebugImageProvider.DebugImagesFromCache; + var cList = SentryCocoaHybridSdk.Internal.Debug.Images; logger?.LogDebug("There are {0} native debug images, parsing the information.", cList.Length); foreach (var cItem in cList) { diff --git a/src/Sentry/Platforms/Cocoa/CocoaEventProcessor.cs b/src/Sentry/Platforms/Cocoa/CocoaEventProcessor.cs index f95d525953..6466d62338 100644 --- a/src/Sentry/Platforms/Cocoa/CocoaEventProcessor.cs +++ b/src/Sentry/Platforms/Cocoa/CocoaEventProcessor.cs @@ -26,10 +26,11 @@ public SentryEvent Process(SentryEvent @event) private static CocoaSdk.SentryEvent GetTempEvent() { // This will populate an event with all of the information we need, without actually capturing that event. + // SentryObjCScope exposes no applyToEvent, so this enrichment still uses the classic Sentry.framework + // SDK + scope + event. TODO: Find a non-private way to do this (getsentry/sentry-dotnet#5444). var @event = new CocoaSdk.SentryEvent(); - SentryCocoaSdk.ConfigureScope(scope => + SentryCocoaLegacySdk.ConfigureScope(scope => { - // TODO: As of Sentry Cocoa 8.0.0, this is a private API. Find a better way! scope.ApplyToEvent(@event, 0); }); diff --git a/src/Sentry/Platforms/Cocoa/Extensions/BreadcrumbExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/BreadcrumbExtensions.cs index f9594947f8..6b79b62734 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/BreadcrumbExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/BreadcrumbExtensions.cs @@ -4,7 +4,7 @@ namespace Sentry.Cocoa.Extensions; internal static class BreadcrumbExtensions { - public static Breadcrumb ToBreadcrumb(this CocoaSdk.SentryBreadcrumb breadcrumb, IDiagnosticLogger? logger) => + public static Breadcrumb ToBreadcrumb(this CocoaSdk.SentryObjCBreadcrumb breadcrumb, IDiagnosticLogger? logger) => new( breadcrumb.Timestamp?.ToDateTimeOffset(), breadcrumb.Message, @@ -13,7 +13,7 @@ public static Breadcrumb ToBreadcrumb(this CocoaSdk.SentryBreadcrumb breadcrumb, breadcrumb.Category, breadcrumb.Level.ToBreadcrumbLevel()); - public static CocoaSdk.SentryBreadcrumb ToCocoaBreadcrumb(this Breadcrumb breadcrumb) => + public static CocoaSdk.SentryObjCBreadcrumb ToCocoaBreadcrumb(this Breadcrumb breadcrumb) => new() { Timestamp = breadcrumb.Timestamp.ToNSDate(), diff --git a/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs index 00c91e5d75..2ce86fd923 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs @@ -276,7 +276,7 @@ public static object ToObject(this NSNumber n) }; } - public static void CopyToCocoaSentryEvent(this SentryEvent managed, CocoaSdk.SentryEvent native) + public static void CopyToCocoaSentryEvent(this SentryEvent managed, CocoaSdk.SentryObjCEvent native) { // we only support a subset of mutated data to be passed back to the native SDK at this time native.ServerName = managed.ServerName; @@ -302,7 +302,7 @@ public static void CopyToCocoaSentryEvent(this SentryEvent managed, CocoaSdk.Sen } } - public static SentryEvent? ToSentryEvent(this CocoaSdk.SentryEvent sentryEvent) + public static SentryEvent? ToSentryEvent(this CocoaSdk.SentryObjCEvent sentryEvent) { using var stream = sentryEvent.ToJsonStream(); if (stream == null) @@ -314,9 +314,9 @@ public static void CopyToCocoaSentryEvent(this SentryEvent managed, CocoaSdk.Sen return ev; } - public static CocoaSdk.SentryMessage ToCocoaSentryMessage(this SentryMessage msg) + public static CocoaSdk.SentryObjCMessage ToCocoaSentryMessage(this SentryMessage msg) { - var native = new CocoaSdk.SentryMessage(msg.Formatted ?? string.Empty); + var native = new CocoaSdk.SentryObjCMessage(msg.Formatted ?? string.Empty); native.Params = msg.Params?.Select(x => x.ToString()!).ToArray() ?? new string[0]; return native; diff --git a/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs index 9a6c67ed3f..d60bdabacb 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs @@ -3,108 +3,108 @@ namespace Sentry.Cocoa.Extensions; internal static class EnumExtensions { // These align, so we can just cast - public static SentryLevel ToSentryLevel(this CocoaSdk.SentryLevel level) => (SentryLevel)level; + public static SentryLevel ToSentryLevel(this CocoaSdk.SentryObjCLevel level) => (SentryLevel)level; - public static CocoaSdk.SentryLevel ToCocoaSentryLevel(this SentryLevel level) => level switch + public static CocoaSdk.SentryObjCLevel ToCocoaSentryLevel(this SentryLevel level) => level switch { - SentryLevel.Debug => CocoaSdk.SentryLevel.Debug, - SentryLevel.Info => CocoaSdk.SentryLevel.Info, - SentryLevel.Warning => CocoaSdk.SentryLevel.Warning, - SentryLevel.Error => CocoaSdk.SentryLevel.Error, - SentryLevel.Fatal => CocoaSdk.SentryLevel.Fatal, + SentryLevel.Debug => CocoaSdk.SentryObjCLevel.Debug, + SentryLevel.Info => CocoaSdk.SentryObjCLevel.Info, + SentryLevel.Warning => CocoaSdk.SentryObjCLevel.Warning, + SentryLevel.Error => CocoaSdk.SentryObjCLevel.Error, + SentryLevel.Fatal => CocoaSdk.SentryObjCLevel.Fatal, _ => throw new ArgumentOutOfRangeException(nameof(level), level, null) }; - public static BreadcrumbLevel ToBreadcrumbLevel(this CocoaSdk.SentryLevel level) => + public static BreadcrumbLevel ToBreadcrumbLevel(this CocoaSdk.SentryObjCLevel level) => level switch { - CocoaSdk.SentryLevel.Debug => BreadcrumbLevel.Debug, - CocoaSdk.SentryLevel.Info => BreadcrumbLevel.Info, - CocoaSdk.SentryLevel.Warning => BreadcrumbLevel.Warning, - CocoaSdk.SentryLevel.Error => BreadcrumbLevel.Error, - CocoaSdk.SentryLevel.Fatal => BreadcrumbLevel.Fatal, + CocoaSdk.SentryObjCLevel.Debug => BreadcrumbLevel.Debug, + CocoaSdk.SentryObjCLevel.Info => BreadcrumbLevel.Info, + CocoaSdk.SentryObjCLevel.Warning => BreadcrumbLevel.Warning, + CocoaSdk.SentryObjCLevel.Error => BreadcrumbLevel.Error, + CocoaSdk.SentryObjCLevel.Fatal => BreadcrumbLevel.Fatal, _ => throw new ArgumentOutOfRangeException(nameof(level), level, null) }; - public static CocoaSdk.SentryLevel ToCocoaSentryLevel(this BreadcrumbLevel level) => + public static CocoaSdk.SentryObjCLevel ToCocoaSentryLevel(this BreadcrumbLevel level) => level switch { - BreadcrumbLevel.Debug => CocoaSdk.SentryLevel.Debug, - BreadcrumbLevel.Info => CocoaSdk.SentryLevel.Info, - BreadcrumbLevel.Warning => CocoaSdk.SentryLevel.Warning, - BreadcrumbLevel.Error => CocoaSdk.SentryLevel.Error, - BreadcrumbLevel.Fatal => CocoaSdk.SentryLevel.Fatal, + BreadcrumbLevel.Debug => CocoaSdk.SentryObjCLevel.Debug, + BreadcrumbLevel.Info => CocoaSdk.SentryObjCLevel.Info, + BreadcrumbLevel.Warning => CocoaSdk.SentryObjCLevel.Warning, + BreadcrumbLevel.Error => CocoaSdk.SentryObjCLevel.Error, + BreadcrumbLevel.Fatal => CocoaSdk.SentryObjCLevel.Fatal, _ => throw new ArgumentOutOfRangeException(nameof(level), level, message: default) }; - public static bool? ToNullableBoolean(this CocoaSdk.SentrySampleDecision decision) => + public static bool? ToNullableBoolean(this CocoaSdk.SentryObjCSampleDecision decision) => decision switch { - CocoaSdk.SentrySampleDecision.Yes => true, - CocoaSdk.SentrySampleDecision.No => false, - CocoaSdk.SentrySampleDecision.Undecided => null, + CocoaSdk.SentryObjCSampleDecision.Yes => true, + CocoaSdk.SentryObjCSampleDecision.No => false, + CocoaSdk.SentryObjCSampleDecision.Undecided => null, _ => throw new ArgumentOutOfRangeException(nameof(decision), decision, null) }; - public static CocoaSdk.SentrySampleDecision ToCocoaSampleDecision(this bool? decision) => + public static CocoaSdk.SentryObjCSampleDecision ToCocoaSampleDecision(this bool? decision) => decision switch { - true => CocoaSdk.SentrySampleDecision.Yes, - false => CocoaSdk.SentrySampleDecision.No, - null => CocoaSdk.SentrySampleDecision.Undecided + true => CocoaSdk.SentryObjCSampleDecision.Yes, + false => CocoaSdk.SentryObjCSampleDecision.No, + null => CocoaSdk.SentryObjCSampleDecision.Undecided }; - public static SpanStatus? ToSpanStatus(this CocoaSdk.SentrySpanStatus status) => + public static SpanStatus? ToSpanStatus(this CocoaSdk.SentryObjCSpanStatus status) => status switch { - CocoaSdk.SentrySpanStatus.Undefined => null, - CocoaSdk.SentrySpanStatus.Ok => SpanStatus.Ok, - CocoaSdk.SentrySpanStatus.Cancelled => SpanStatus.Cancelled, - CocoaSdk.SentrySpanStatus.InternalError => SpanStatus.InternalError, - CocoaSdk.SentrySpanStatus.UnknownError => SpanStatus.UnknownError, - CocoaSdk.SentrySpanStatus.InvalidArgument => SpanStatus.InvalidArgument, - CocoaSdk.SentrySpanStatus.DeadlineExceeded => SpanStatus.DeadlineExceeded, - CocoaSdk.SentrySpanStatus.NotFound => SpanStatus.NotFound, - CocoaSdk.SentrySpanStatus.AlreadyExists => SpanStatus.AlreadyExists, - CocoaSdk.SentrySpanStatus.PermissionDenied => SpanStatus.PermissionDenied, - CocoaSdk.SentrySpanStatus.ResourceExhausted => SpanStatus.ResourceExhausted, - CocoaSdk.SentrySpanStatus.FailedPrecondition => SpanStatus.FailedPrecondition, - CocoaSdk.SentrySpanStatus.Aborted => SpanStatus.Aborted, - CocoaSdk.SentrySpanStatus.OutOfRange => SpanStatus.OutOfRange, - CocoaSdk.SentrySpanStatus.Unimplemented => SpanStatus.Unimplemented, - CocoaSdk.SentrySpanStatus.Unavailable => SpanStatus.Unavailable, - CocoaSdk.SentrySpanStatus.DataLoss => SpanStatus.DataLoss, - CocoaSdk.SentrySpanStatus.Unauthenticated => SpanStatus.Unauthenticated, + CocoaSdk.SentryObjCSpanStatus.Undefined => null, + CocoaSdk.SentryObjCSpanStatus.Ok => SpanStatus.Ok, + CocoaSdk.SentryObjCSpanStatus.Cancelled => SpanStatus.Cancelled, + CocoaSdk.SentryObjCSpanStatus.InternalError => SpanStatus.InternalError, + CocoaSdk.SentryObjCSpanStatus.UnknownError => SpanStatus.UnknownError, + CocoaSdk.SentryObjCSpanStatus.InvalidArgument => SpanStatus.InvalidArgument, + CocoaSdk.SentryObjCSpanStatus.DeadlineExceeded => SpanStatus.DeadlineExceeded, + CocoaSdk.SentryObjCSpanStatus.NotFound => SpanStatus.NotFound, + CocoaSdk.SentryObjCSpanStatus.AlreadyExists => SpanStatus.AlreadyExists, + CocoaSdk.SentryObjCSpanStatus.PermissionDenied => SpanStatus.PermissionDenied, + CocoaSdk.SentryObjCSpanStatus.ResourceExhausted => SpanStatus.ResourceExhausted, + CocoaSdk.SentryObjCSpanStatus.FailedPrecondition => SpanStatus.FailedPrecondition, + CocoaSdk.SentryObjCSpanStatus.Aborted => SpanStatus.Aborted, + CocoaSdk.SentryObjCSpanStatus.OutOfRange => SpanStatus.OutOfRange, + CocoaSdk.SentryObjCSpanStatus.Unimplemented => SpanStatus.Unimplemented, + CocoaSdk.SentryObjCSpanStatus.Unavailable => SpanStatus.Unavailable, + CocoaSdk.SentryObjCSpanStatus.DataLoss => SpanStatus.DataLoss, + CocoaSdk.SentryObjCSpanStatus.Unauthenticated => SpanStatus.Unauthenticated, _ => throw new ArgumentOutOfRangeException(nameof(status), status, message: default) }; - public static CocoaSdk.SentrySpanStatus ToCocoaSpanStatus(this SpanStatus? status) => + public static CocoaSdk.SentryObjCSpanStatus ToCocoaSpanStatus(this SpanStatus? status) => status switch { - null => CocoaSdk.SentrySpanStatus.Undefined, - SpanStatus.Ok => CocoaSdk.SentrySpanStatus.Ok, - SpanStatus.Cancelled => CocoaSdk.SentrySpanStatus.Cancelled, - SpanStatus.InternalError => CocoaSdk.SentrySpanStatus.InternalError, - SpanStatus.UnknownError => CocoaSdk.SentrySpanStatus.UnknownError, - SpanStatus.InvalidArgument => CocoaSdk.SentrySpanStatus.InvalidArgument, - SpanStatus.DeadlineExceeded => CocoaSdk.SentrySpanStatus.DeadlineExceeded, - SpanStatus.NotFound => CocoaSdk.SentrySpanStatus.NotFound, - SpanStatus.AlreadyExists => CocoaSdk.SentrySpanStatus.AlreadyExists, - SpanStatus.PermissionDenied => CocoaSdk.SentrySpanStatus.PermissionDenied, - SpanStatus.ResourceExhausted => CocoaSdk.SentrySpanStatus.ResourceExhausted, - SpanStatus.FailedPrecondition => CocoaSdk.SentrySpanStatus.FailedPrecondition, - SpanStatus.Aborted => CocoaSdk.SentrySpanStatus.Aborted, - SpanStatus.OutOfRange => CocoaSdk.SentrySpanStatus.OutOfRange, - SpanStatus.Unimplemented => CocoaSdk.SentrySpanStatus.Unimplemented, - SpanStatus.Unavailable => CocoaSdk.SentrySpanStatus.Unavailable, - SpanStatus.DataLoss => CocoaSdk.SentrySpanStatus.DataLoss, - SpanStatus.Unauthenticated => CocoaSdk.SentrySpanStatus.Unauthenticated, + null => CocoaSdk.SentryObjCSpanStatus.Undefined, + SpanStatus.Ok => CocoaSdk.SentryObjCSpanStatus.Ok, + SpanStatus.Cancelled => CocoaSdk.SentryObjCSpanStatus.Cancelled, + SpanStatus.InternalError => CocoaSdk.SentryObjCSpanStatus.InternalError, + SpanStatus.UnknownError => CocoaSdk.SentryObjCSpanStatus.UnknownError, + SpanStatus.InvalidArgument => CocoaSdk.SentryObjCSpanStatus.InvalidArgument, + SpanStatus.DeadlineExceeded => CocoaSdk.SentryObjCSpanStatus.DeadlineExceeded, + SpanStatus.NotFound => CocoaSdk.SentryObjCSpanStatus.NotFound, + SpanStatus.AlreadyExists => CocoaSdk.SentryObjCSpanStatus.AlreadyExists, + SpanStatus.PermissionDenied => CocoaSdk.SentryObjCSpanStatus.PermissionDenied, + SpanStatus.ResourceExhausted => CocoaSdk.SentryObjCSpanStatus.ResourceExhausted, + SpanStatus.FailedPrecondition => CocoaSdk.SentryObjCSpanStatus.FailedPrecondition, + SpanStatus.Aborted => CocoaSdk.SentryObjCSpanStatus.Aborted, + SpanStatus.OutOfRange => CocoaSdk.SentryObjCSpanStatus.OutOfRange, + SpanStatus.Unimplemented => CocoaSdk.SentryObjCSpanStatus.Unimplemented, + SpanStatus.Unavailable => CocoaSdk.SentryObjCSpanStatus.Unavailable, + SpanStatus.DataLoss => CocoaSdk.SentryObjCSpanStatus.DataLoss, + SpanStatus.Unauthenticated => CocoaSdk.SentryObjCSpanStatus.Unauthenticated, _ => throw new ArgumentOutOfRangeException(nameof(status), status, message: default) }; // These align, so we can just cast - public static TransactionNameSource ToTransactionNameSource(this CocoaSdk.SentryTransactionNameSource source) => + public static TransactionNameSource ToTransactionNameSource(this CocoaSdk.SentryObjCTransactionNameSource source) => (TransactionNameSource)source; - public static CocoaSdk.SentryTransactionNameSource ToCocoaTransactionNameSource(this TransactionNameSource source) => - (CocoaSdk.SentryTransactionNameSource)source; + public static CocoaSdk.SentryObjCTransactionNameSource ToCocoaTransactionNameSource(this TransactionNameSource source) => + (CocoaSdk.SentryObjCTransactionNameSource)source; } diff --git a/src/Sentry/Platforms/Cocoa/Extensions/MiscExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/MiscExtensions.cs index c23b5bf8d3..8b8d5115bb 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/MiscExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/MiscExtensions.cs @@ -2,12 +2,10 @@ namespace Sentry.Cocoa.Extensions; internal static class MiscExtensions { - public static SentryId ToSentryId(this CocoaSdk.SentryId sentryId) => new(Guid.Parse(sentryId.SentryIdString)); + public static SentryId ToSentryId(this CocoaSdk.SentryObjCId sentryId) => new(Guid.Parse(sentryId.SentryIdString)); - public static SpanId ToSpanId(this CocoaSdk.SentrySpanId spanId) => new(spanId.SentrySpanIdString); + public static SpanId ToSpanId(this CocoaSdk.SentryObjCSpanId spanId) => new(spanId.SentrySpanIdString); - // The SentryObjCSDK.internal hybrid API uses its own id types (SentryObjCId / SentryObjCSpanId) - // rather than the Sentry.framework SentryId / SentrySpanId used elsewhere. public static CocoaSdk.SentryObjCId ToCocoaObjCId(this SentryId sentryId) => new(sentryId.ToString()); public static CocoaSdk.SentryObjCSpanId ToCocoaObjCSpanId(this SpanId spanId) => new(spanId.ToString()); diff --git a/src/Sentry/Platforms/Cocoa/Extensions/SamplingContextExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/SamplingContextExtensions.cs index 9a1a487067..4d065f7289 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/SamplingContextExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/SamplingContextExtensions.cs @@ -4,7 +4,7 @@ namespace Sentry.Cocoa.Extensions; internal static class SamplingContextExtensions { - public static TransactionSamplingContext ToTransactionSamplingContext(this CocoaSdk.SentrySamplingContext context) + public static TransactionSamplingContext ToTransactionSamplingContext(this CocoaSdk.SentryObjCSamplingContext context) { var transactionContext = new TransactionContextFacade(context.TransactionContext); var customSamplingContext = context.CustomSamplingContext.ToObjectDictionary(); diff --git a/src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs index 301feb452a..e3f0f75c4f 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs @@ -4,7 +4,7 @@ namespace Sentry.Cocoa.Extensions; internal static class UserExtensions { - public static SentryUser ToUser(this CocoaSdk.SentryUser user, IDiagnosticLogger? logger = null) => + public static SentryUser ToUser(this CocoaSdk.SentryObjCUser user, IDiagnosticLogger? logger = null) => new() { Email = user.Email, @@ -14,9 +14,9 @@ public static SentryUser ToUser(this CocoaSdk.SentryUser user, IDiagnosticLogger Other = user.Data.ToStringDictionary(logger) }; - public static CocoaSdk.SentryUser ToCocoaUser(this SentryUser user) + public static CocoaSdk.SentryObjCUser ToCocoaUser(this SentryUser user) { - var cocoaUser = new CocoaSdk.SentryUser + var cocoaUser = new CocoaSdk.SentryObjCUser { Email = user.Email, UserId = user.Id, diff --git a/src/Sentry/Platforms/Cocoa/Facades/TransactionContextFacade.cs b/src/Sentry/Platforms/Cocoa/Facades/TransactionContextFacade.cs index 6be22bf65c..174b65bd64 100644 --- a/src/Sentry/Platforms/Cocoa/Facades/TransactionContextFacade.cs +++ b/src/Sentry/Platforms/Cocoa/Facades/TransactionContextFacade.cs @@ -4,9 +4,9 @@ namespace Sentry.Cocoa.Facades; internal class TransactionContextFacade : ITransactionContext { - private readonly CocoaSdk.SentryTransactionContext _context; + private readonly CocoaSdk.SentryObjCTransactionContext _context; - internal TransactionContextFacade(CocoaSdk.SentryTransactionContext context) + internal TransactionContextFacade(CocoaSdk.SentryObjCTransactionContext context) { _context = context; } diff --git a/src/Sentry/Platforms/Cocoa/Sentry.Cocoa.props b/src/Sentry/Platforms/Cocoa/Sentry.Cocoa.props index 7f02ed04c3..acd8bddc66 100644 --- a/src/Sentry/Platforms/Cocoa/Sentry.Cocoa.props +++ b/src/Sentry/Platforms/Cocoa/Sentry.Cocoa.props @@ -6,10 +6,12 @@ - - + + - + + diff --git a/src/Sentry/Platforms/Cocoa/SentrySdk.cs b/src/Sentry/Platforms/Cocoa/SentrySdk.cs index 2b0df2a7e3..b174f8304f 100644 --- a/src/Sentry/Platforms/Cocoa/SentrySdk.cs +++ b/src/Sentry/Platforms/Cocoa/SentrySdk.cs @@ -155,7 +155,7 @@ private static void InitSentryCocoaSdk(SentryOptions options) var sessionSampleRate = (float)(options.Native.ExperimentalOptions.SessionReplay.SessionSampleRate ?? 0f); var onErrorSampleRate = (float)(options.Native.ExperimentalOptions.SessionReplay.OnErrorSampleRate ?? 0f); - var cocoaReplayOptions = new Sentry.CocoaSdk.SentryReplayOptions(); + var cocoaReplayOptions = new Sentry.CocoaSdk.SentryObjCReplayOptions(); cocoaReplayOptions.SessionSampleRate = sessionSampleRate; cocoaReplayOptions.OnErrorSampleRate = onErrorSampleRate; cocoaReplayOptions.MaskAllText = options.Native.ExperimentalOptions.SessionReplay.MaskAllText; @@ -198,20 +198,20 @@ private static string GetDefaultReleaseString() private static string GetBundleValue(string key) => NSBundle.MainBundle.ObjectForInfoDictionary(key).ToString(); - private static CocoaSdk.SentryHttpStatusCodeRange[] GetFailedRequestStatusCodes(IList httpStatusCodeRanges) + private static CocoaSdk.SentryObjCHttpStatusCodeRange[] GetFailedRequestStatusCodes(IList httpStatusCodeRanges) { - var nativeRanges = new CocoaSdk.SentryHttpStatusCodeRange[httpStatusCodeRanges.Count]; + var nativeRanges = new CocoaSdk.SentryObjCHttpStatusCodeRange[httpStatusCodeRanges.Count]; for (var i = 0; i < httpStatusCodeRanges.Count; i++) { var range = httpStatusCodeRanges[i]; - nativeRanges[i] = new CocoaSdk.SentryHttpStatusCodeRange(range.Start, range.End); + nativeRanges[i] = new CocoaSdk.SentryObjCHttpStatusCodeRange(range.Start, range.End); } return nativeRanges; } [DebuggerStepThrough] - internal static CocoaSdk.SentryEvent? ProcessOnBeforeSend(SentryOptions options, CocoaSdk.SentryEvent evt) + internal static CocoaSdk.SentryObjCEvent? ProcessOnBeforeSend(SentryOptions options, CocoaSdk.SentryObjCEvent evt) => ProcessOnBeforeSend(options, evt, CurrentHub); /// @@ -222,7 +222,7 @@ private static CocoaSdk.SentryHttpStatusCodeRange[] GetFailedRequestStatusCodes( /// The managed exception is what a .NET developer would expect, and it is sent by the Sentry.NET SDK /// But we also get a native SIGABRT since it crashed the application, which is sent by the Sentry Cocoa SDK. /// - private static bool SuppressNativeCrash(SentryOptions options, CocoaSdk.SentryEvent evt) + private static bool SuppressNativeCrash(SentryOptions options, CocoaSdk.SentryObjCEvent evt) { // There should only be one exception on the event in this case if ((options.Native.SuppressSignalAborts || options.Native.SuppressExcBadAccess) && evt.Exceptions?.Length == 1) @@ -261,7 +261,7 @@ private static bool SuppressNativeCrash(SentryOptions options, CocoaSdk.SentryEv /// This overload allows us to inject an IHub for testing. During normal execution, the CurrentHub is used. /// However, since this class is static, there's no easy alternative way to inject this when executing tests. /// - internal static CocoaSdk.SentryEvent? ProcessOnBeforeSend(SentryOptions options, CocoaSdk.SentryEvent evt, IHub hub) + internal static CocoaSdk.SentryObjCEvent? ProcessOnBeforeSend(SentryOptions options, CocoaSdk.SentryObjCEvent evt, IHub hub) { // Redundant native crash events must be suppressed even if the SDK is // disabled (or not yet fully initialized) to avoid sending duplicates. From 2a0df77f51be6d1fd994a86167eb252988298ed5 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 28 Jul 2026 10:21:06 +1200 Subject: [PATCH 2/3] test: migrate iOS Cocoa tests to SentryObjC types CocoaExtensionsTests and the iOS-conditional SentrySdkTests block referenced the classic Sentry* binding types (SentryEvent, SentryException, SentryBreadcrumb, SentryUser, SentryLevel), which were renamed to SentryObjC* in the rebind. Point them at the SentryObjC* equivalents so the iOS test project compiles. #skip-changelog Co-Authored-By: Claude Opus 4.8 --- .../Platforms/iOS/CocoaExtensionsTests.cs | 12 ++++++------ test/Sentry.Tests/SentrySdkTests.cs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/Sentry.Tests/Platforms/iOS/CocoaExtensionsTests.cs b/test/Sentry.Tests/Platforms/iOS/CocoaExtensionsTests.cs index 2a7fdd97f1..a12e1a1eb4 100644 --- a/test/Sentry.Tests/Platforms/iOS/CocoaExtensionsTests.cs +++ b/test/Sentry.Tests/Platforms/iOS/CocoaExtensionsTests.cs @@ -35,7 +35,7 @@ public void CopyToCocoaSentryEvent_CopiesProperties() IpAddress = "127.0.0.1" }; - var native = new CocoaSdk.SentryEvent(); + var native = new CocoaSdk.SentryObjCEvent(); evt.CopyToCocoaSentryEvent(native); AssertEqual(evt, native); @@ -50,10 +50,10 @@ public void CopyToCocoaSentryEvent_CopiesProperties() [Fact] public void ToSentryEvent_ConvertToManaged() { - var native = new CocoaSdk.SentryEvent(); + var native = new CocoaSdk.SentryObjCEvent(); native.Timestamp = DateTimeOffset.UtcNow.ToNSDate(); - native.Level = Sentry.CocoaSdk.SentryLevel.Debug; + native.Level = Sentry.CocoaSdk.SentryObjCLevel.Debug; native.ServerName = "native server name"; native.Dist = "native dist"; native.Logger = "native logger"; @@ -66,9 +66,9 @@ public void ToSentryEvent_ConvertToManaged() native.Error = new NSError(new NSString("Test Error"), IntPtr.Zero); native.Breadcrumbs = [ - new CocoaSdk.SentryBreadcrumb(CocoaSdk.SentryLevel.Debug, "category") + new CocoaSdk.SentryObjCBreadcrumb(CocoaSdk.SentryObjCLevel.Debug, "category") ]; - native.User = new CocoaSdk.SentryUser + native.User = new CocoaSdk.SentryObjCUser { UserId = "user id", Username = "test", @@ -136,7 +136,7 @@ public void ToCocoaBreadcrumbData_RequestStartKey_NonNumericValue_FallsBackToNSO result[(NSString)SentryHttpMessageHandler.RequestStartKey].Should().Be(NSObject.FromObject("not-a-number")); } - private static void AssertEqual(SentryEvent managed, CocoaSdk.SentryEvent native) + private static void AssertEqual(SentryEvent managed, CocoaSdk.SentryObjCEvent native) { native.ServerName.Should().Be(managed.ServerName, "Server Name"); native.Dist.Should().Be(managed.Distribution, "Distribution"); diff --git a/test/Sentry.Tests/SentrySdkTests.cs b/test/Sentry.Tests/SentrySdkTests.cs index 45750ebd93..1418708ea2 100644 --- a/test/Sentry.Tests/SentrySdkTests.cs +++ b/test/Sentry.Tests/SentrySdkTests.cs @@ -1068,8 +1068,8 @@ public void ProcessOnBeforeSend_NativeErrorSuppression(bool suppressNativeErrors hub.When(h => hub.ConfigureScope(Arg.Any>())) .Do(callback => callback.Arg>().Invoke(scope)); - var evt = new Sentry.CocoaSdk.SentryEvent(); - var ex = new Sentry.CocoaSdk.SentryException("Not checked", "EXC_BAD_ACCESS"); + var evt = new Sentry.CocoaSdk.SentryObjCEvent(); + var ex = new Sentry.CocoaSdk.SentryObjCException("Not checked", "EXC_BAD_ACCESS"); evt.Exceptions = [ex]; // Act @@ -1111,8 +1111,8 @@ public void ProcessOnBeforeSend_NativeErrorSuppressionBeforeHubInit(bool suppres // the Cocoa SDK init before the Hub instance has been created var hub = DisabledHub.Instance; - var evt = new Sentry.CocoaSdk.SentryEvent(); - var ex = new Sentry.CocoaSdk.SentryException("Not checked", "EXC_BAD_ACCESS"); + var evt = new Sentry.CocoaSdk.SentryObjCEvent(); + var ex = new Sentry.CocoaSdk.SentryObjCException("Not checked", "EXC_BAD_ACCESS"); evt.Exceptions = [ex]; // Act @@ -1144,7 +1144,7 @@ public void ProcessOnBeforeSend_OptionsBeforeOnSendRuns() InitNativeSdks = false }; - var native = new Sentry.CocoaSdk.SentryEvent(); + var native = new Sentry.CocoaSdk.SentryObjCEvent(); native.ServerName = "server name"; native.Dist = "dist"; native.Logger = "logger"; @@ -1192,7 +1192,7 @@ public void ProcessOnBeforeSend_EventProcessorsInvoked() hub.When(h => hub.ConfigureScope(Arg.Any>())) .Do(callback => callback.Arg>().Invoke(scope)); - var native = new Sentry.CocoaSdk.SentryEvent(); + var native = new Sentry.CocoaSdk.SentryObjCEvent(); // Act SentrySdk.ProcessOnBeforeSend(options, native, hub); From 5625d2c7a4a753c3c54e3f1f2f6313fd16108854 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 28 Jul 2026 16:44:12 +1200 Subject: [PATCH 3/3] fix: reconstruct managed event from SentryObjCEvent properties The classic SentryEvent exposed serialize() (via SentrySerializable), which ToSentryEvent used to round-trip a native event into a managed one through JSON. SentryObjCEvent exposes no serialize(), so that path returned null - which made the native beforeSend/event-processor pipeline bail (event dropped, callbacks skipped) and NRE'd the tests that assert on the converted event. Reconstruct the managed SentryEvent directly from the SentryObjCEvent properties instead, mapping the same subset CopyToCocoaSentryEvent writes back plus the exception from the native NSError. Adds ToSentryMessage and a name-correct ToSentryLevelOrNull (SentryObjCLevel has a leading None member, so a direct cast would be off by one). Verified locally against the iOS device test suite (2698 tests, 0 failed), including the four previously-failing CocoaExtensionsTests / SentrySdkTests cases. #skip-changelog Co-Authored-By: Claude Opus 4.8 --- .../Cocoa/Extensions/CocoaExtensions.cs | 59 ++++++++++++++++--- .../Cocoa/Extensions/EnumExtensions.cs | 13 ++++ 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs index 2ce86fd923..df5745b504 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs @@ -302,18 +302,63 @@ public static void CopyToCocoaSentryEvent(this SentryEvent managed, CocoaSdk.Sen } } - public static SentryEvent? ToSentryEvent(this CocoaSdk.SentryObjCEvent sentryEvent) + public static SentryEvent? ToSentryEvent(this CocoaSdk.SentryObjCEvent sentryEvent, IDiagnosticLogger? logger = null) { - using var stream = sentryEvent.ToJsonStream(); - if (stream == null) - return null; + // Unlike the classic SentryEvent, SentryObjCEvent exposes no serialize() to round-trip through + // JSON, so we reconstruct the managed event from its properties. We map the same subset that + // CopyToCocoaSentryEvent writes back, plus the exception derived from the native NSError. + // TODO: revisit once the SentryObjC surface exposes event serialization (getsentry/sentry-dotnet#5444). + var exception = sentryEvent.Error is { } error ? new NSErrorException(error) : null; + var ev = new SentryEvent(exception) + { + Level = sentryEvent.Level.ToSentryLevelOrNull(), + ServerName = sentryEvent.ServerName, + Distribution = sentryEvent.Dist, + Logger = sentryEvent.Logger, + Release = sentryEvent.ReleaseName, + Environment = sentryEvent.Environment, + TransactionName = sentryEvent.Transaction, + }; + + if (sentryEvent.Message is { } message) + { + ev.Message = message.ToSentryMessage(); + } + + foreach (var (key, value) in sentryEvent.Tags.ToStringDictionary(logger)) + { + ev.SetTag(key, value); + } + + foreach (var (key, value) in sentryEvent.Extra.ToObjectDictionary(logger)) + { + ev.SetExtra(key, value); + } + + if (sentryEvent.Breadcrumbs is { } breadcrumbs) + { + foreach (var breadcrumb in breadcrumbs) + { + ev.AddBreadcrumb(breadcrumb.ToBreadcrumb(logger)); + } + } + + if (sentryEvent.User is { } user) + { + ev.User = user.ToUser(logger); + } - using var json = JsonDocument.Parse(stream); - var exception = sentryEvent.Error == null ? null : new NSErrorException(sentryEvent.Error); - var ev = SentryEvent.FromJson(json.RootElement, exception); return ev; } + public static SentryMessage ToSentryMessage(this CocoaSdk.SentryObjCMessage message) => + new() + { + Formatted = message.Formatted, + Message = message.Message, + Params = message.Params, + }; + public static CocoaSdk.SentryObjCMessage ToCocoaSentryMessage(this SentryMessage msg) { var native = new CocoaSdk.SentryObjCMessage(msg.Formatted ?? string.Empty); diff --git a/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs b/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs index d60bdabacb..0cc7416ea4 100644 --- a/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs +++ b/src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs @@ -5,6 +5,19 @@ internal static class EnumExtensions // These align, so we can just cast public static SentryLevel ToSentryLevel(this CocoaSdk.SentryObjCLevel level) => (SentryLevel)level; + // SentryObjCLevel has a leading `None = 0` member that managed SentryLevel does not, so map by name + // (a direct cast would be off by one). `None` has no managed equivalent and maps to null. + public static SentryLevel? ToSentryLevelOrNull(this CocoaSdk.SentryObjCLevel level) => + level switch + { + CocoaSdk.SentryObjCLevel.Debug => SentryLevel.Debug, + CocoaSdk.SentryObjCLevel.Info => SentryLevel.Info, + CocoaSdk.SentryObjCLevel.Warning => SentryLevel.Warning, + CocoaSdk.SentryObjCLevel.Error => SentryLevel.Error, + CocoaSdk.SentryObjCLevel.Fatal => SentryLevel.Fatal, + _ => null + }; + public static CocoaSdk.SentryObjCLevel ToCocoaSentryLevel(this SentryLevel level) => level switch { SentryLevel.Debug => CocoaSdk.SentryObjCLevel.Debug,