Skip to content

Instantly share code, notes, and snippets.

@AbhiPrasad
Created August 6, 2020 17:29
Show Gist options
  • Save AbhiPrasad/fe02f5f2262aef22fd79fc608f632844 to your computer and use it in GitHub Desktop.
Save AbhiPrasad/fe02f5f2262aef22fd79fc608f632844 to your computer and use it in GitHub Desktop.
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using QuickType;
//
// var coordinate = Coordinate.FromJson(jsonString);
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// The sentry v7 event structure.
/// </summary>
public partial class Coordinate
{
/// <summary>
/// List of breadcrumbs recorded before this event.
/// </summary>
[JsonProperty("breadcrumbs")]
public Breadcrumbs Breadcrumbs { get; set; }
/// <summary>
/// Contexts describing the environment (e.g. device, os or browser).
/// </summary>
[JsonProperty("contexts")]
public Dictionary<string, Context> Contexts { get; set; }
/// <summary>
/// Custom culprit of the event.
/// </summary>
[JsonProperty("culprit")]
public string Culprit { get; set; }
/// <summary>
/// Meta data for event processing and debugging.
/// </summary>
[JsonProperty("debug_meta")]
public DebugMeta DebugMeta { get; set; }
/// <summary>
/// Program's distribution identifier.
///
/// The distribution of the application.
///
/// Distributions are used to disambiguate build or deployment variants of the same release
/// of
/// an application. For example, the dist can be the build number of an XCode build or the
/// version code of an Android build.
/// </summary>
[JsonProperty("dist")]
public string Dist { get; set; }
/// <summary>
/// The environment name, such as `production` or `staging`.
/// </summary>
[JsonProperty("environment")]
public string Environment { get; set; }
/// <summary>
/// Errors encountered during processing. Intended to be phased out in favor of
/// annotation/metadata system.
/// </summary>
[JsonProperty("errors")]
public EventProcessingError[] Errors { get; set; }
/// <summary>
/// Unique identifier of this event.
///
/// Hexadecimal string representing a uuid4 value. The length is exactly 32 characters.
/// Dashes
/// are not allowed. Has to be lowercase.
///
/// Even though this field is backfilled on the server with a new uuid4, it is strongly
/// recommended to generate that uuid4 clientside. There are some features like user
/// feedback
/// which are easier to implement that way, and debugging in case events get lost in your
/// Sentry installation is also easier.
///
/// Example:
///
/// ```json
/// {
/// "event_id": "fc6d8c0c43fc4630ad850ee518f1b9d0"
/// }
/// ```
/// </summary>
[JsonProperty("event_id")]
public Guid? EventId { get; set; }
/// <summary>
/// One or multiple chained (nested) exceptions.
/// </summary>
[JsonProperty("exception")]
public CoordinateException Exception { get; set; }
/// <summary>
/// Arbitrary extra information set by the user.
/// </summary>
[JsonProperty("extra")]
public Dictionary<string, object> Extra { get; set; }
/// <summary>
/// Manual fingerprint override.
///
/// A list of strings used to dictate how this event is supposed to be grouped with other
/// events into issues. For more information about overriding grouping see [Customize
/// Grouping
/// with Fingerprints](https://docs.sentry.io/data-management/event-grouping/).
/// </summary>
[JsonProperty("fingerprint")]
public string[] Fingerprint { get; set; }
/// <summary>
/// Project key which sent this event.
/// </summary>
[JsonProperty("key_id")]
public string KeyId { get; set; }
/// <summary>
/// Severity level of the event. Defaults to `error`.
/// </summary>
[JsonProperty("level")]
public Level? Level { get; set; }
/// <summary>
/// Custom parameterized message for this event.
/// </summary>
[JsonProperty("logentry")]
public LogEntry Logentry { get; set; }
/// <summary>
/// Logger that created the event.
/// </summary>
[JsonProperty("logger")]
public string Logger { get; set; }
/// <summary>
/// Name and versions of all installed modules/packages/dependencies in the current
/// environment/application.
///
/// ```json
/// { "django": "3.0.0", "celery": "4.2.1" }
/// ```
///
/// In Python this is a list of installed packages as reported by `pkg_resources` together
/// with
/// their reported version string.
///
/// This is primarily used for suggesting to enable certain SDK integrations from within the
/// UI
/// and for making informed decisions on which frameworks to support in future development
/// efforts.
/// </summary>
[JsonProperty("modules")]
public Dictionary<string, string> Modules { get; set; }
/// <summary>
/// Platform identifier of this event (defaults to "other").
///
/// A string representing the platform the SDK is submitting from. This will be used by the
/// Sentry interface to customize various components in the interface, but also to enter or
/// skip stacktrace processing.
///
/// Acceptable values are: `as3`, `c`, `cfml`, `cocoa`, `csharp`, `elixir`, `haskell`, `go`,
/// `groovy`, `java`, `javascript`, `native`, `node`, `objc`, `other`, `perl`, `php`,
/// `python`,
/// `ruby`
/// </summary>
[JsonProperty("platform")]
public string Platform { get; set; }
/// <summary>
/// Project which sent this event.
/// </summary>
[JsonProperty("project")]
public long? Project { get; set; }
/// <summary>
/// Timestamp when the event has been received by Sentry.
/// </summary>
[JsonProperty("received")]
public Timestamp? Received { get; set; }
/// <summary>
/// The release version of the application.
///
/// **Release versions must be unique across all projects in your organization.** This value
/// can be the git SHA for the given project, or a product identifier with a semantic version.
/// </summary>
[JsonProperty("release")]
public string Release { get; set; }
/// <summary>
/// Information about a web request that occurred during the event.
/// </summary>
[JsonProperty("request")]
public Request Request { get; set; }
/// <summary>
/// Information about the Sentry SDK that generated this event.
/// </summary>
[JsonProperty("sdk")]
public ClientSdkInfo Sdk { get; set; }
/// <summary>
/// Server or device name the event was generated on.
///
/// This is supposed to be a hostname.
/// </summary>
[JsonProperty("server_name")]
public string ServerName { get; set; }
/// <summary>
/// Deprecated in favor of tags.
/// </summary>
[JsonProperty("site")]
public string Site { get; set; }
/// <summary>
/// Spans for tracing.
/// </summary>
[JsonProperty("spans")]
public Span[] Spans { get; set; }
/// <summary>
/// Event stacktrace.
///
/// DEPRECATED: Prefer `threads` or `exception` depending on which is more appropriate.
/// </summary>
[JsonProperty("stacktrace")]
public Stacktrace Stacktrace { get; set; }
/// <summary>
/// Timestamp when the event has started (relevant for event type = "transaction")
/// </summary>
[JsonProperty("start_timestamp")]
public Timestamp? StartTimestamp { get; set; }
/// <summary>
/// Custom tags for this event.
///
/// A map or list of tags for this event. Each tag must be less than 200 characters.
/// </summary>
[JsonProperty("tags")]
public Cookies? Tags { get; set; }
/// <summary>
/// Threads that were active when the event occurred.
/// </summary>
[JsonProperty("threads")]
public Threads Threads { get; set; }
/// <summary>
/// Time since the start of the transaction until the error occurred.
/// </summary>
[JsonProperty("time_spent")]
public long? TimeSpent { get; set; }
/// <summary>
/// Timestamp when the event was created.
///
/// Indicates when the event was created in the Sentry SDK. The format is either a string as
/// defined in [RFC 3339](https://tools.ietf.org/html/rfc3339) or a numeric (integer or
/// float)
/// value representing the number of seconds that have elapsed since the [Unix
/// epoch](https://en.wikipedia.org/wiki/Unix_time).
///
/// Sub-microsecond precision is not preserved with numeric values due to precision
/// limitations with floats (at least in our systems). With that caveat in mind, just send
/// whatever is easiest to produce.
///
/// All timestamps in the event protocol are formatted this way.
///
/// ```json
/// { "timestamp": "2011-05-02T17:41:36Z" }
/// { "timestamp": 1304358096.0 }
/// ```
/// </summary>
[JsonProperty("timestamp")]
public Timestamp? Timestamp { get; set; }
/// <summary>
/// Transaction name of the event.
///
/// For example, in a web app, this might be the route name (`"/users/<username>/"` or
/// `UserView`), in a task queue it might be the function + module name.
/// </summary>
[JsonProperty("transaction")]
public string Transaction { get; set; }
/// <summary>
/// Type of event: error, csp, default
/// </summary>
[JsonProperty("type")]
public EventType? Type { get; set; }
/// <summary>
/// Information about the user who triggered this event.
/// </summary>
[JsonProperty("user")]
public User User { get; set; }
/// <summary>
/// Version
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
}
public partial class Breadcrumbs
{
[JsonProperty("values", Required = Required.Always)]
public Breadcrumb[] Values { get; set; }
}
/// <summary>
/// The Breadcrumbs Interface specifies a series of application events, or "breadcrumbs",
/// that
/// occurred before an event.
///
/// An event may contain one or more breadcrumbs in an attribute named `breadcrumbs`. The
/// entries
/// are ordered from oldest to newest. Consequently, the last entry in the list should be the
/// last
/// entry before the event occurred.
///
/// While breadcrumb attributes are not strictly validated in Sentry, a breadcrumb is most
/// useful
/// when it includes at least a `timestamp` and `type`, `category` or `message`. The
/// rendering of
/// breadcrumbs in Sentry depends on what is provided.
///
/// The following example illustrates the breadcrumbs part of the event payload and omits
/// other
/// attributes for simplicity.
///
/// ```json
/// {
/// "breadcrumbs": {
/// "values": [
/// {
/// "timestamp": "2016-04-20T20:55:53.845Z",
/// "message": "Something happened",
/// "category": "log",
/// "data": {
/// "foo": "bar",
/// "blub": "blah"
/// }
/// },
/// {
/// "timestamp": "2016-04-20T20:55:53.847Z",
/// "type": "navigation",
/// "data": {
/// "from": "/login",
/// "to": "/dashboard"
/// }
/// }
/// ]
/// }
/// }
/// ```
/// </summary>
public partial class Breadcrumb
{
/// <summary>
/// A dotted string indicating what the crumb is or from where it comes. _Optional._
///
/// Typically it is a module name or a descriptive string. For instance, _ui.click_ could be
/// used to indicate that a click happened in the UI or _flask_ could be used to indicate
/// that
/// the event originated in the Flask framework.
/// </summary>
[JsonProperty("category")]
public string Category { get; set; }
/// <summary>
/// Arbitrary data associated with this breadcrumb.
///
/// Contains a dictionary whose contents depend on the breadcrumb `type`. Additional
/// parameters
/// that are unsupported by the type are rendered as a key/value table.
/// </summary>
[JsonProperty("data")]
public Dictionary<string, object> Data { get; set; }
/// <summary>
/// Severity level of the breadcrumb. _Optional._
///
/// Allowed values are, from highest to lowest: `fatal`, `error`, `warning`, `info`, and
/// `debug`. Levels are used in the UI to emphasize and deemphasize the crumb. Defaults to
/// `info`.
/// </summary>
[JsonProperty("level")]
public Level? Level { get; set; }
/// <summary>
/// Human readable message for the breadcrumb.
///
/// If a message is provided, it is rendered as text with all whitespace preserved. Very
/// long
/// text might be truncated in the UI.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// The timestamp of the breadcrumb. Recommended.
///
/// A timestamp representing when the breadcrumb occurred. The format is either a string as
/// defined in [RFC 3339](https://tools.ietf.org/html/rfc3339) or a numeric (integer or
/// float)
/// value representing the number of seconds that have elapsed since the [Unix
/// epoch](https://en.wikipedia.org/wiki/Unix_time).
///
/// Breadcrumbs are most useful when they include a timestamp, as it creates a timeline
/// leading
/// up to an event.
/// </summary>
[JsonProperty("timestamp")]
public Timestamp? Timestamp { get; set; }
/// <summary>
/// The type of the breadcrumb. _Optional_, defaults to `default`.
///
/// - `default`: Describes a generic breadcrumb. This is typically a log message or
/// user-generated breadcrumb. The `data` field is entirely undefined and as such,
/// completely
/// rendered as a key/value table.
///
/// - `navigation`: Describes a navigation breadcrumb. A navigation event can be a URL
/// change
/// in a web application, or a UI transition in a mobile or desktop application, etc.
///
/// Such a breadcrumb's `data` object has the required fields `from` and `to`, which
/// represent an application route/url each.
///
/// - `http`: Describes an HTTP request breadcrumb. This represents an HTTP request
/// transmitted
/// from your application. This could be an AJAX request from a web application, or a
/// server-to-server HTTP request to an API service provider, etc.
///
/// Such a breadcrumb's `data` property has the fields `url`, `method`, `status_code`
/// (integer) and `reason` (string).
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
/// <summary>
/// Device information.
///
/// Device context describes the device that caused the event. This is most appropriate for
/// mobile
/// applications.
///
/// Operating system information.
///
/// OS context describes the operating system on which the event was created. In web
/// contexts, this
/// is the operating system of the browser (generally pulled from the User-Agent string).
///
/// Runtime information.
///
/// Runtime context describes a runtime in more detail. Typically, this context is present
/// in
/// `contexts` multiple times if multiple runtimes are involved (for instance, if you have a
/// JavaScript application running on top of JVM).
///
/// Application information.
///
/// App context describes the application. As opposed to the runtime, this is the actual
/// application that was running and carries metadata about the current session.
///
/// Web browser information.
///
/// GPU information.
///
/// Example:
///
/// ```json
/// "gpu": {
/// "name": "AMD Radeon Pro 560",
/// "vendor_name": "Apple",
/// "memory_size": 4096,
/// "api_type": "Metal",
/// "multi_threaded_rendering": true,
/// "version": "Metal",
/// "npot_support": "Full"
/// }
/// ```
///
/// Trace context
///
/// Monitor information.
/// </summary>
public partial class Context
{
/// <summary>
/// Native cpu architecture of the device.
/// </summary>
[JsonProperty("arch")]
public string Arch { get; set; }
/// <summary>
/// Current battery level in %.
///
/// If the device has a battery, this can be a floating point value defining the battery
/// level
/// (in the range 0-100).
/// </summary>
[JsonProperty("battery_level")]
public double? BatteryLevel { get; set; }
/// <summary>
/// Indicator when the device was booted.
/// </summary>
[JsonProperty("boot_time")]
public string BootTime { get; set; }
/// <summary>
/// Brand of the device.
/// </summary>
[JsonProperty("brand")]
public string Brand { get; set; }
/// <summary>
/// Whether the device was charging or not.
/// </summary>
[JsonProperty("charging")]
public bool? Charging { get; set; }
/// <summary>
/// Free size of the attached external storage in bytes (eg: android SDK card).
/// </summary>
[JsonProperty("external_free_storage")]
public long? ExternalFreeStorage { get; set; }
/// <summary>
/// Total size of the attached external storage in bytes (eg: android SDK card).
/// </summary>
[JsonProperty("external_storage_size")]
public long? ExternalStorageSize { get; set; }
/// <summary>
/// Family of the device model.
///
/// This is usually the common part of model names across generations. For instance,
/// `iPhone`
/// would be a reasonable family, so would be `Samsung Galaxy`.
/// </summary>
[JsonProperty("family")]
public string Family { get; set; }
/// <summary>
/// How much memory is still available in bytes.
/// </summary>
[JsonProperty("free_memory")]
public long? FreeMemory { get; set; }
/// <summary>
/// How much storage is free in bytes.
/// </summary>
[JsonProperty("free_storage")]
public long? FreeStorage { get; set; }
/// <summary>
/// Whether the device was low on memory.
/// </summary>
[JsonProperty("low_memory")]
public bool? LowMemory { get; set; }
/// <summary>
/// Manufacturer of the device.
/// </summary>
[JsonProperty("manufacturer")]
public string Manufacturer { get; set; }
/// <summary>
/// Total memory available in bytes.
///
/// The total GPU memory available in Megabytes.
/// </summary>
[JsonProperty("memory_size")]
public long? MemorySize { get; set; }
/// <summary>
/// Device model.
///
/// This, for example, can be `Samsung Galaxy S3`.
/// </summary>
[JsonProperty("model")]
public string Model { get; set; }
/// <summary>
/// Device model (internal identifier).
///
/// An internal hardware revision to identify the device exactly.
/// </summary>
[JsonProperty("model_id")]
public string ModelId { get; set; }
/// <summary>
/// Name of the device.
///
/// Name of the operating system.
///
/// Runtime name.
///
/// Display name of the browser application.
///
/// The name of the graphics device.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Whether the device was online or not.
/// </summary>
[JsonProperty("online")]
public bool? Online { get; set; }
/// <summary>
/// Current screen orientation.
///
/// This can be a string `portrait` or `landscape` to define the orientation of a device.
/// </summary>
[JsonProperty("orientation")]
public string Orientation { get; set; }
/// <summary>
/// Device screen density.
/// </summary>
[JsonProperty("screen_density")]
public double? ScreenDensity { get; set; }
/// <summary>
/// Screen density as dots-per-inch.
/// </summary>
[JsonProperty("screen_dpi")]
public long? ScreenDpi { get; set; }
/// <summary>
/// Device screen resolution.
///
/// (e.g.: 800x600, 3040x1444)
/// </summary>
[JsonProperty("screen_resolution")]
public string ScreenResolution { get; set; }
/// <summary>
/// Simulator/prod indicator.
/// </summary>
[JsonProperty("simulator")]
public bool? Simulator { get; set; }
/// <summary>
/// Total storage size of the device in bytes.
/// </summary>
[JsonProperty("storage_size")]
public long? StorageSize { get; set; }
/// <summary>
/// Timezone of the device.
/// </summary>
[JsonProperty("timezone")]
public string Timezone { get; set; }
/// <summary>
/// How much memory is usable for the app in bytes.
/// </summary>
[JsonProperty("usable_memory")]
public long? UsableMemory { get; set; }
/// <summary>
/// Internal build number of the operating system.
///
/// Application build string, if it is separate from the version.
/// </summary>
[JsonProperty("build")]
public string Build { get; set; }
/// <summary>
/// Current kernel version.
///
/// This is typically the entire output of the `uname` syscall.
/// </summary>
[JsonProperty("kernel_version")]
public string KernelVersion { get; set; }
/// <summary>
/// Unprocessed operating system info.
///
/// An unprocessed description string obtained by the operating system. For some well-known
/// runtimes, Sentry will attempt to parse `name` and `version` from this string, if they
/// are
/// not explicitly given.
///
/// Unprocessed runtime info.
///
/// An unprocessed description string obtained by the runtime. For some well-known runtimes,
/// Sentry will attempt to parse `name` and `version` from this string, if they are not
/// explicitly given.
/// </summary>
[JsonProperty("raw_description")]
public string RawDescription { get; set; }
/// <summary>
/// Indicator if the OS is rooted (mobile mostly).
/// </summary>
[JsonProperty("rooted")]
public bool? Rooted { get; set; }
/// <summary>
/// Version of the operating system.
///
/// Runtime version string.
///
/// Version string of the browser.
///
/// The Version of the graphics device.
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
/// <summary>
/// Internal build ID as it appears on the platform.
/// </summary>
[JsonProperty("app_build")]
public string AppBuild { get; set; }
/// <summary>
/// Version-independent application identifier, often a dotted bundle ID.
/// </summary>
[JsonProperty("app_identifier")]
public string AppIdentifier { get; set; }
/// <summary>
/// Application name as it appears on the platform.
/// </summary>
[JsonProperty("app_name")]
public string AppName { get; set; }
/// <summary>
/// Start time of the app.
///
/// Formatted UTC timestamp when the user started the application.
/// </summary>
[JsonProperty("app_start_time")]
public string AppStartTime { get; set; }
/// <summary>
/// Application version as it appears on the platform.
/// </summary>
[JsonProperty("app_version")]
public string AppVersion { get; set; }
/// <summary>
/// String identifying the kind of build. For example, `testflight`.
/// </summary>
[JsonProperty("build_type")]
public string BuildType { get; set; }
/// <summary>
/// Application-specific device identifier.
/// </summary>
[JsonProperty("device_app_hash")]
public string DeviceAppHash { get; set; }
/// <summary>
/// The device low-level API type.
///
/// Examples: `"Apple Metal"` or `"Direct3D11"`
/// </summary>
[JsonProperty("api_type")]
public string ApiType { get; set; }
/// <summary>
/// The PCI identifier of the graphics device.
/// </summary>
[JsonProperty("id")]
public object Id { get; set; }
/// <summary>
/// Whether the GPU has multi-threaded rendering or not.
/// </summary>
[JsonProperty("multi_threaded_rendering")]
public bool? MultiThreadedRendering { get; set; }
/// <summary>
/// The Non-Power-Of-Two support.
/// </summary>
[JsonProperty("npot_support")]
public string NpotSupport { get; set; }
/// <summary>
/// The PCI vendor identifier of the graphics device.
/// </summary>
[JsonProperty("vendor_id")]
public string VendorId { get; set; }
/// <summary>
/// The vendor name as reported by the graphics device.
/// </summary>
[JsonProperty("vendor_name")]
public string VendorName { get; set; }
/// <summary>
/// Span type (see `OperationType` docs).
/// </summary>
[JsonProperty("op")]
public string Op { get; set; }
/// <summary>
/// The ID of the span enclosing this span.
/// </summary>
[JsonProperty("parent_span_id")]
public string ParentSpanId { get; set; }
/// <summary>
/// The ID of the span.
/// </summary>
[JsonProperty("span_id")]
public string SpanId { get; set; }
/// <summary>
/// Whether the trace failed or succeeded. Currently only used to indicate status of
/// individual
/// transactions.
/// </summary>
[JsonProperty("status")]
public SpanStatus? Status { get; set; }
/// <summary>
/// The trace ID.
/// </summary>
[JsonProperty("trace_id")]
public string TraceId { get; set; }
}
/// <summary>
/// Debugging and processing meta information.
///
/// The debug meta interface carries debug information for processing errors and crash
/// reports.
/// Sentry amends the information in this interface.
///
/// Example (look at field types to see more detail):
///
/// ```json
/// {
/// "debug_meta": {
/// "images": [],
/// "sdk_info": {
/// "sdk_name": "iOS",
/// "version_major": 10,
/// "version_minor": 3,
/// "version_patchlevel": 0
/// }
/// }
/// }
/// ```
/// </summary>
public partial class DebugMeta
{
/// <summary>
/// List of debug information files (debug images).
/// </summary>
[JsonProperty("images")]
public DebugImage[] Images { get; set; }
/// <summary>
/// Information about the system SDK (e.g. iOS SDK).
/// </summary>
[JsonProperty("sdk_info")]
public SystemSdkInfo SdkInfo { get; set; }
}
/// <summary>
/// Legacy apple debug images (MachO).
///
/// This was also used for non-apple platforms with similar debug setups.
///
/// A generic (new-style) native platform debug information file.
///
/// The `type` key must be one of:
///
/// - `macho`
/// - `elf`: ELF images are used on Linux platforms. Their structure is identical to other
/// native images.
/// - `pe`
///
/// Examples:
///
/// ```json
/// {
/// "type": "elf",
/// "code_id": "68220ae2c65d65c1b6aaa12fa6765a6ec2f5f434",
/// "code_file": "/lib/x86_64-linux-gnu/libgcc_s.so.1",
/// "debug_id": "e20a2268-5dc6-c165-b6aa-a12fa6765a6e",
/// "image_addr": "0x7f5140527000",
/// "image_size": 90112,
/// "image_vmaddr": "0x40000",
/// "arch": "x86_64"
/// }
/// ```
///
/// ```json
/// {
/// "type": "pe",
/// "code_id": "57898e12145000",
/// "code_file": "C:\\Windows\\System32\\dbghelp.dll",
/// "debug_id": "9c2a902b-6fdf-40ad-8308-588a41d572a0-1",
/// "debug_file": "dbghelp.pdb",
/// "image_addr": "0x70850000",
/// "image_size": "1331200",
/// "image_vmaddr": "0x40000",
/// "arch": "x86"
/// }
/// ```
///
/// ```json
/// {
/// "type": "macho",
/// "debug_id": "84a04d24-0e60-3810-a8c0-90a65e2df61a",
/// "debug_file": "libDiagnosticMessagesClient.dylib",
/// "code_file": "/usr/lib/libDiagnosticMessagesClient.dylib",
/// "image_addr": "0x7fffe668e000",
/// "image_size": 8192,
/// "image_vmaddr": "0x40000",
/// "arch": "x86_64",
/// }
/// ```
///
/// Proguard mapping file.
///
/// Proguard images refer to `mapping.txt` files generated when Proguard obfuscates function
/// names. The Java SDK integrations assign this file a unique identifier, which has to be
/// included in the list of images.
/// </summary>
public partial class DebugImage
{
/// <summary>
/// CPU architecture target.
///
/// CPU architecture target.
///
/// Architecture of the module. If missing, this will be backfilled by Sentry.
/// </summary>
[JsonProperty("arch")]
public string Arch { get; set; }
/// <summary>
/// MachO CPU subtype identifier.
/// </summary>
[JsonProperty("cpu_subtype")]
public long? CpuSubtype { get; set; }
/// <summary>
/// MachO CPU type identifier.
/// </summary>
[JsonProperty("cpu_type")]
public long? CpuType { get; set; }
/// <summary>
/// Starting memory address of the image (required).
///
/// Starting memory address of the image (required).
///
/// Memory address, at which the image is mounted in the virtual address space of the
/// process. Should be a string in hex representation prefixed with `"0x"`.
/// </summary>
[JsonProperty("image_addr")]
public string ImageAddr { get; set; }
/// <summary>
/// Size of the image in bytes (required).
///
/// Size of the image in bytes (required).
///
/// The size of the image in virtual memory. If missing, Sentry will assume that the image
/// spans up to the next image, which might lead to invalid stack traces.
/// </summary>
[JsonProperty("image_size")]
public long? ImageSize { get; set; }
/// <summary>
/// Loading address in virtual memory.
///
/// Loading address in virtual memory.
///
/// Preferred load address of the image in virtual memory, as declared in the headers of the
/// image. When loading an image, the operating system may still choose to place it at a
/// different address.
///
/// Symbols and addresses in the native image are always relative to the start of the image
/// and do not consider the preferred load address. It is merely a hint to the loader.
///
/// - `elf`/`macho`: If this value is non-zero, all symbols and addresses declared in the
/// native image start at this address, rather than 0. By contrast, Sentry deals with
/// addresses relative to the start of the image. For example, with `image_vmaddr: 0x40000`,
/// a symbol located at `0x401000` has a relative address of `0x1000`.
///
/// Relative addresses used in Apple Crash Reports and `addr2line` are usually in the
/// preferred address space, and not relative address space.
/// </summary>
[JsonProperty("image_vmaddr")]
public string ImageVmaddr { get; set; }
/// <summary>
/// Path and name of the debug image (required).
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// The unique UUID of the image.
///
/// UUID computed from the file contents, assigned by the Java SDK.
/// </summary>
[JsonProperty("uuid")]
public Guid? Uuid { get; set; }
/// <summary>
/// Path and name of the image file (required).
///
/// The absolute path to the dynamic library or executable. This helps to locate the file if
/// it is missing on Sentry.
///
/// - `pe`: The code file should be provided to allow server-side stack walking of binary
/// crash reports, such as Minidumps.
/// </summary>
[JsonProperty("code_file")]
public string CodeFile { get; set; }
/// <summary>
/// Optional identifier of the code file.
///
/// - `elf`: If the program was compiled with a relatively recent compiler, this should be
/// the hex representation of the `NT_GNU_BUILD_ID` program header (type `PT_NOTE`), or the
/// value of the `.note.gnu.build-id` note section (type `SHT_NOTE`). Otherwise, leave this
/// value empty.
///
/// Certain symbol servers use the code identifier to locate debug information for ELF
/// images, in which case this field should be included if possible.
///
/// - `pe`: Identifier of the executable or DLL. It contains the values of the
/// `time_date_stamp` from the COFF header and `size_of_image` from the optional header
/// formatted together into a hex string using `%08x%X` (note that the second value is not
/// padded):
///
/// ```text
/// time_date_stamp: 0x5ab38077
/// size_of_image: 0x9000
/// code_id: 5ab380779000
/// ```
///
/// The code identifier should be provided to allow server-side stack walking of binary crash
/// reports, such as Minidumps.
///
///
/// - `macho`: Identifier of the dynamic library or executable. It is the value of the
/// `LC_UUID` load command in the Mach header, formatted as UUID. Can be empty for Mach
/// images, as it is equivalent to the debug identifier.
/// </summary>
[JsonProperty("code_id")]
public string CodeId { get; set; }
/// <summary>
/// Path and name of the debug companion file.
///
/// - `elf`: Name or absolute path to the file containing stripped debug information for this
/// image. This value might be _required_ to retrieve debug files from certain symbol
/// servers.
///
/// - `pe`: Name of the PDB file containing debug information for this image. This value is
/// often required to retrieve debug files from specific symbol servers.
///
/// - `macho`: Name or absolute path to the dSYM file containing debug information for this
/// image. This value might be required to retrieve debug files from certain symbol servers.
/// </summary>
[JsonProperty("debug_file")]
public string DebugFile { get; set; }
/// <summary>
/// Unique debug identifier of the image.
///
/// - `elf`: Debug identifier of the dynamic library or executable. If a code identifier is
/// available, the debug identifier is the little-endian UUID representation of the first
/// 16-bytes of that
/// identifier. Spaces are inserted for readability, note the byte order of the first
/// fields:
///
/// ```text
/// code id: f1c3bcc0 2798 65fe 3058 404b2831d9e6 4135386c
/// debug id: c0bcc3f1-9827-fe65-3058-404b2831d9e6
/// ```
///
/// If no code id is available, the debug id should be computed by XORing the first 4096
/// bytes of the `.text` section in 16-byte chunks, and representing it as a little-endian
/// UUID (again swapping the byte order).
///
/// - `pe`: `signature` and `age` of the PDB file. Both values can be read from the CodeView
/// PDB70 debug information header in the PE. The value should be represented as
/// little-endian UUID, with the age appended at the end. Note that the byte order of the
/// UUID fields must be swapped (spaces inserted for readability):
///
/// ```text
/// signature: f1c3bcc0 2798 65fe 3058 404b2831d9e6
/// age: 1
/// debug_id: c0bcc3f1-9827-fe65-3058-404b2831d9e6-1
/// ```
///
/// - `macho`: Identifier of the dynamic library or executable. It is the value of the
/// `LC_UUID` load command in the Mach header, formatted as UUID.
/// </summary>
[JsonProperty("debug_id")]
public string DebugId { get; set; }
}
/// <summary>
/// Holds information about the system SDK.
///
/// This is relevant for iOS and other platforms that have a system
/// SDK. Not to be confused with the client SDK.
/// </summary>
public partial class SystemSdkInfo
{
/// <summary>
/// The internal name of the SDK.
/// </summary>
[JsonProperty("sdk_name")]
public string SdkName { get; set; }
/// <summary>
/// The major version of the SDK as integer or 0.
/// </summary>
[JsonProperty("version_major")]
public long? VersionMajor { get; set; }
/// <summary>
/// The minor version of the SDK as integer or 0.
/// </summary>
[JsonProperty("version_minor")]
public long? VersionMinor { get; set; }
/// <summary>
/// The patch version of the SDK as integer or 0.
/// </summary>
[JsonProperty("version_patchlevel")]
public long? VersionPatchlevel { get; set; }
}
/// <summary>
/// An event processing error.
/// </summary>
public partial class EventProcessingError
{
/// <summary>
/// Affected key or deep path.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// The error kind.
/// </summary>
[JsonProperty("type", Required = Required.AllowNull)]
public string Type { get; set; }
/// <summary>
/// The original value causing this error.
/// </summary>
[JsonProperty("value")]
public object Value { get; set; }
}
public partial class CoordinateException
{
[JsonProperty("values", Required = Required.Always)]
public ExceptionClass[] Values { get; set; }
}
/// <summary>
/// A single exception.
///
/// Multiple values inside of an [event](#Event) represent chained exceptions and should be
/// sorted oldest to newest. For example, consider this Python code snippet:
///
/// ```python
/// try:
/// raise Exception("random boring invariant was not met!")
/// except Exception as e:
/// raise ValueError("something went wrong, help!") from e
/// ```
///
/// `Exception` would be described first in the values list, followed by a description of
/// `ValueError`:
///
/// ```json
/// {
/// "exception": {
/// "values": [
/// {"type": "Exception": "value": "random boring invariant was not met!"},
/// {"type": "ValueError", "value": "something went wrong, help!"},
/// ]
/// }
/// }
/// ```
/// </summary>
public partial class ExceptionClass
{
/// <summary>
/// Mechanism by which this exception was generated and handled.
/// </summary>
[JsonProperty("mechanism")]
public Mechanism Mechanism { get; set; }
/// <summary>
/// The optional module, or package which the exception type lives in.
/// </summary>
[JsonProperty("module")]
public string Module { get; set; }
/// <summary>
/// Stack trace containing frames of this exception.
/// </summary>
[JsonProperty("stacktrace")]
public Stacktrace Stacktrace { get; set; }
/// <summary>
/// An optional value which refers to a [thread](#Thread).
/// </summary>
[JsonProperty("thread_id")]
public ThreadId? ThreadId { get; set; }
/// <summary>
/// Exception type, e.g. `ValueError`.
///
/// At least one of `type` or `value` is required, otherwise the exception is discarded.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
/// <summary>
/// Human readable display value.
///
/// At least one of `type` or `value` is required, otherwise the exception is discarded.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
/// <summary>
/// The mechanism by which an exception was generated and handled.
///
/// The exception mechanism is an optional field residing in the [exception](#Exception). It
/// carries
/// additional information about the way the exception was created on the target system.
/// This
/// includes general exception values obtained from the operating system or runtime APIs, as
/// well
/// as mechanism-specific values.
/// </summary>
public partial class Mechanism
{
/// <summary>
/// Additional attributes depending on the mechanism type.
/// </summary>
[JsonProperty("data")]
public Dictionary<string, object> Data { get; set; }
/// <summary>
/// Optional human-readable description of the error mechanism.
///
/// May include a possible hint on how to solve this error.
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// Flag indicating whether this exception was handled.
///
/// This is a best-effort guess at whether the exception was handled by user code or not.
/// For
/// example:
///
/// - Exceptions leading to a 500 Internal Server Error or to a hard process crash are
/// `handled=false`, as the SDK typically has an integration that automatically captures
/// the
/// error.
///
/// - Exceptions captured using `capture_exception` (called from user code) are
/// `handled=true`
/// as the user explicitly captured the exception (and therefore kind of handled it)
/// </summary>
[JsonProperty("handled")]
public bool? Handled { get; set; }
/// <summary>
/// Link to online resources describing this error.
/// </summary>
[JsonProperty("help_link")]
public string HelpLink { get; set; }
/// <summary>
/// Operating system or runtime meta information.
/// </summary>
[JsonProperty("meta")]
public MechanismMeta Meta { get; set; }
/// <summary>
/// If this is set then the exception is not a real exception but some
/// form of synthetic error for instance from a signal handler, a hard
/// segfault or similar where type and value are not useful for grouping
/// or display purposes.
/// </summary>
[JsonProperty("synthetic")]
public bool? Synthetic { get; set; }
/// <summary>
/// Mechanism type (required).
///
/// Required unique identifier of this mechanism determining rendering and processing of the
/// mechanism data.
///
/// In the Python SDK this is merely the name of the framework integration that produced the
/// exception, while for native it is e.g. `"minidump"` or `"applecrashreport"`.
/// </summary>
[JsonProperty("type", Required = Required.AllowNull)]
public string Type { get; set; }
}
/// <summary>
/// Operating system or runtime meta information to an exception mechanism.
///
/// The mechanism metadata usually carries error codes reported by the runtime or operating
/// system,
/// along with a platform-dependent interpretation of these codes. SDKs can safely omit code
/// names
/// and descriptions for well-known error codes, as it will be filled out by Sentry. For
/// proprietary or vendor-specific error codes, adding these values will give additional
/// information to the user.
/// </summary>
public partial class MechanismMeta
{
/// <summary>
/// Optional ISO C standard error code.
/// </summary>
[JsonProperty("errno")]
public CError Errno { get; set; }
/// <summary>
/// A Mach Exception on Apple systems comprising a code triple and optional descriptions.
/// </summary>
[JsonProperty("mach_exception")]
public MachException MachException { get; set; }
/// <summary>
/// Information on the POSIX signal.
/// </summary>
[JsonProperty("signal")]
public PosixSignal Signal { get; set; }
}
/// <summary>
/// POSIX signal with optional extended data.
///
/// Error codes set by Linux system calls and some library functions as specified in ISO
/// C99,
/// POSIX.1-2001, and POSIX.1-2008. See
/// [`errno(3)`](https://man7.org/linux/man-pages/man3/errno.3.html) for more information.
/// </summary>
public partial class CError
{
/// <summary>
/// Optional name of the errno constant.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// The error code as specified by ISO C99, POSIX.1-2001 or POSIX.1-2008.
/// </summary>
[JsonProperty("number")]
public long? Number { get; set; }
}
/// <summary>
/// Mach exception information.
/// </summary>
public partial class MachException
{
/// <summary>
/// The mach exception code.
/// </summary>
[JsonProperty("code")]
public long? Code { get; set; }
/// <summary>
/// The mach exception type.
/// </summary>
[JsonProperty("exception")]
public long? Exception { get; set; }
/// <summary>
/// Optional name of the mach exception.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// The mach exception subcode.
/// </summary>
[JsonProperty("subcode")]
public long? Subcode { get; set; }
}
/// <summary>
/// POSIX signal with optional extended data.
///
/// On Apple systems, signals also carry a code in addition to the signal number describing
/// the
/// signal in more detail. On Linux, this code does not exist.
/// </summary>
public partial class PosixSignal
{
/// <summary>
/// An optional signal code present on Apple systems.
/// </summary>
[JsonProperty("code")]
public long? Code { get; set; }
/// <summary>
/// Optional name of the errno constant.
/// </summary>
[JsonProperty("code_name")]
public string CodeName { get; set; }
/// <summary>
/// Optional name of the errno constant.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// The POSIX signal number.
/// </summary>
[JsonProperty("number")]
public long? Number { get; set; }
}
/// <summary>
/// A stack trace of a single thread.
///
/// A stack trace contains a list of frames, each with various bits (most optional)
/// describing the context of that frame. Frames should be sorted from oldest to newest.
///
/// For the given example program written in Python:
///
/// ```python
/// def foo():
/// my_var = 'foo'
/// raise ValueError()
///
/// def main():
/// foo()
/// ```
///
/// A minimalistic stack trace for the above program in the correct order:
///
/// ```json
/// {
/// "frames": [
/// {"function": "main"},
/// {"function": "foo"}
/// ]
/// }
/// ```
///
/// The top frame fully symbolicated with five lines of source context:
///
/// ```json
/// {
/// "frames": [{
/// "in_app": true,
/// "function": "myfunction",
/// "abs_path": "/real/file/name.py",
/// "filename": "file/name.py",
/// "lineno": 3,
/// "vars": {
/// "my_var": "'value'"
/// },
/// "pre_context": [
/// "def foo():",
/// " my_var = 'foo'",
/// ],
/// "context_line": " raise ValueError()",
/// "post_context": [
/// "",
/// "def main():"
/// ],
/// }]
/// }
/// ```
///
/// A minimal native stack trace with register values. Note that the `package` event
/// attribute must be "native" for these frames to be symbolicated.
///
/// ```json
/// {
/// "frames": [
/// {"instruction_addr": "0x7fff5bf3456c"},
/// {"instruction_addr": "0x7fff5bf346c0"},
/// ],
/// "registers": {
/// "rip": "0x00007ff6eef54be2",
/// "rsp": "0x0000003b710cd9e0"
/// }
/// }
/// ```
/// </summary>
public partial class Stacktrace
{
/// <summary>
/// Required. A non-empty list of stack frames. The list is ordered from caller to callee, or
/// oldest to youngest. The last frame is the one creating the exception.
/// </summary>
[JsonProperty("frames", Required = Required.AllowNull)]
public Frame[] Frames { get; set; }
/// <summary>
/// The language of the stacktrace.
/// </summary>
[JsonProperty("lang")]
public string Lang { get; set; }
/// <summary>
/// Register values of the thread (top frame).
///
/// A map of register names and their values. The values should contain the actual register
/// values of the thread, thus mapping to the last frame in the list.
/// </summary>
[JsonProperty("registers")]
public Dictionary<string, string> Registers { get; set; }
}
/// <summary>
/// Holds information about a single stacktrace frame.
///
/// Each object should contain **at least** a `filename`, `function` or `instruction_addr`
/// attribute. All values are optional, but recommended.
/// </summary>
public partial class Frame
{
/// <summary>
/// Absolute path to the source file.
/// </summary>
[JsonProperty("abs_path")]
public string AbsPath { get; set; }
/// <summary>
/// Column number within the source file, starting at 1.
/// </summary>
[JsonProperty("colno")]
public long? Colno { get; set; }
/// <summary>
/// Source code of the current line (`lineno`).
/// </summary>
[JsonProperty("context_line")]
public string ContextLine { get; set; }
/// <summary>
/// The source file name (basename only).
/// </summary>
[JsonProperty("filename")]
public string Filename { get; set; }
/// <summary>
/// Name of the frame's function. This might include the name of a class.
///
/// This function name may be shortened or demangled. If not, Sentry will demangle and
/// shorten
/// it for some platforms. The original function name will be stored in `raw_function`.
/// </summary>
[JsonProperty("function")]
public string Function { get; set; }
/// <summary>
/// (C/C++/Native) Start address of the containing code module (image).
/// </summary>
[JsonProperty("image_addr")]
public string ImageAddr { get; set; }
/// <summary>
/// Override whether this frame should be considered part of application code, or part of
/// libraries/frameworks/dependencies.
///
/// Setting this attribute to `false` causes the frame to be hidden/collapsed by default and
/// mostly ignored during issue grouping.
/// </summary>
[JsonProperty("in_app")]
public bool? InApp { get; set; }
/// <summary>
/// (C/C++/Native) Absolute address of the frame's CPU instruction.
/// </summary>
[JsonProperty("instruction_addr")]
public string InstructionAddr { get; set; }
/// <summary>
/// Line number within the source file, starting at 1.
/// </summary>
[JsonProperty("lineno")]
public long? Lineno { get; set; }
/// <summary>
/// Name of the module the frame is contained in.
///
/// Note that this might also include a class name if that is something the
/// language natively considers to be part of the stack (for instance in Java).
/// </summary>
[JsonProperty("module")]
public string Module { get; set; }
/// <summary>
/// Name of the package that contains the frame.
///
/// For instance this can be a dylib for native languages, the name of the jar
/// or .NET assembly.
/// </summary>
[JsonProperty("package")]
public string Package { get; set; }
/// <summary>
/// Which platform this frame is from.
///
/// This can override the platform for a single frame. Otherwise, the platform of the event
/// is
/// assumed. This can be used for multi-platform stack traces, such as in React Native.
/// </summary>
[JsonProperty("platform")]
public string Platform { get; set; }
/// <summary>
/// Source code of the lines after `lineno`.
/// </summary>
[JsonProperty("post_context")]
public string[] PostContext { get; set; }
/// <summary>
/// Source code leading up to `lineno`.
/// </summary>
[JsonProperty("pre_context")]
public string[] PreContext { get; set; }
/// <summary>
/// A raw (but potentially truncated) function value.
///
/// The original function name, if the function name is shortened or demangled. Sentry shows
/// the raw function when clicking on the shortened one in the UI.
///
/// If this has the same value as `function` it's best to be omitted. This
/// exists because on many platforms the function itself contains additional
/// information like overload specifies or a lot of generics which can make
/// it exceed the maximum limit we provide for the field. In those cases
/// then we cannot reliably trim down the function any more at a later point
/// because the more valuable information has been removed.
///
/// The logic to be applied is that an intelligently trimmed function name
/// should be stored in `function` and the value before trimming is stored
/// in this field instead. However also this field will be capped at 256
/// characters at the moment which often means that not the entire original
/// value can be stored.
/// </summary>
[JsonProperty("raw_function")]
public string RawFunction { get; set; }
/// <summary>
/// Potentially mangled name of the symbol as it appears in an executable.
///
/// This is different from a function name by generally being the mangled
/// name that appears natively in the binary. This is relevant for languages
/// like Swift, C++ or Rust.
/// </summary>
[JsonProperty("symbol")]
public string Symbol { get; set; }
/// <summary>
/// (C/C++/Native) Start address of the frame's function.
/// </summary>
[JsonProperty("symbol_addr")]
public string SymbolAddr { get; set; }
/// <summary>
/// Mapping of local variables and expression names that were available in this frame.
/// </summary>
[JsonProperty("vars")]
public Dictionary<string, object> Vars { get; set; }
}
/// <summary>
/// A log entry message.
///
/// A log message is similar to the `message` attribute on the event itself but
/// can additionally hold optional parameters.
///
/// ```json
/// {
/// "message": {
/// "message": "My raw message with interpreted strings like %s",
/// "params": ["this"]
/// }
/// }
/// ```
///
/// ```json
/// {
/// "message": {
/// "message": "My raw message with interpreted strings like {foo}",
/// "params": {"foo": "this"}
/// }
/// }
/// ```
/// </summary>
public partial class LogEntry
{
/// <summary>
/// The formatted message. If `message` and `params` are given, Sentry
/// will attempt to backfill `formatted` if empty.
///
/// It must not exceed 8192 characters. Longer messages will be truncated.
/// </summary>
[JsonProperty("formatted")]
public string Formatted { get; set; }
/// <summary>
/// The log message with parameter placeholders.
///
/// This attribute is primarily used for grouping related events together into issues.
/// Therefore this really should just be a string template, i.e. `Sending %d requests`
/// instead
/// of `Sending 9999 requests`. The latter is much better at home in `formatted`.
///
/// It must not exceed 8192 characters. Longer messages will be truncated.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// Parameters to be interpolated into the log message. This can be an array of positional
/// parameters as well as a mapping of named arguments to their values.
/// </summary>
[JsonProperty("params")]
public object Params { get; set; }
}
/// <summary>
/// Http request information.
///
/// The Request interface contains information on a HTTP request related to the event. In
/// client
/// SDKs, this can be an outgoing request, or the request that rendered the current web page.
/// On
/// server SDKs, this could be the incoming web request that is being handled.
///
/// The data variable should only contain the request body (not the query string). It can
/// either be
/// a dictionary (for standard HTTP requests) or a raw request body.
///
/// ### Ordered Maps
///
/// In the Request interface, several attributes can either be declared as string, object, or
/// list
/// of tuples. Sentry attempts to parse structured information from the string representation
/// in
/// such cases.
///
/// Sometimes, keys can be declared multiple times, or the order of elements matters. In
/// such
/// cases, use the tuple representation over a plain object.
///
/// Example of request headers as object:
///
/// ```json
/// {
/// "content-type": "application/json",
/// "accept": "application/json, application/xml"
/// }
/// ```
///
/// Example of the same headers as list of tuples:
///
/// ```json
/// [
/// ["content-type", "application/json"],
/// ["accept", "application/json"],
/// ["accept", "application/xml"]
/// ]
/// ```
///
/// Example of a fully populated request object:
///
/// ```json
/// {
/// "request": {
/// "method": "POST",
/// "url": "http://absolute.uri/foo",
/// "query_string": "query=foobar&page=2",
/// "data": {
/// "foo": "bar"
/// },
/// "cookies": "PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;",
/// "headers": {
/// "content-type": "text/html"
/// },
/// "env": {
/// "REMOTE_ADDR": "192.168.0.1"
/// }
/// }
/// }
/// ```
/// </summary>
public partial class Request
{
/// <summary>
/// The cookie values.
///
/// Can be given unparsed as string, as dictionary, or as a list of tuples.
/// </summary>
[JsonProperty("cookies")]
public Cookies? Cookies { get; set; }
/// <summary>
/// Request data in any format that makes sense.
///
/// SDKs should discard large and binary bodies by default. Can be given as string or
/// structural data of any format.
/// </summary>
[JsonProperty("data")]
public object Data { get; set; }
/// <summary>
/// Server environment data, such as CGI/WSGI.
///
/// A dictionary containing environment information passed from the server. This is where
/// information such as CGI/WSGI/Rack keys go that are not HTTP headers.
///
/// Sentry will explicitly look for `REMOTE_ADDR` to extract an IP address.
/// </summary>
[JsonProperty("env")]
public Dictionary<string, object> Env { get; set; }
/// <summary>
/// The fragment of the request URL.
/// </summary>
[JsonProperty("fragment")]
public string Fragment { get; set; }
/// <summary>
/// A dictionary of submitted headers.
///
/// If a header appears multiple times it, needs to be merged according to the HTTP standard
/// for header merging. Header names are treated case-insensitively by Sentry.
/// </summary>
[JsonProperty("headers")]
public Cookies? Headers { get; set; }
/// <summary>
/// The inferred content type of the request payload.
/// </summary>
[JsonProperty("inferred_content_type")]
public string InferredContentType { get; set; }
/// <summary>
/// HTTP request method.
/// </summary>
[JsonProperty("method")]
public string Method { get; set; }
/// <summary>
/// The query string component of the URL.
///
/// Can be given as unparsed string, dictionary, or list of tuples.
///
/// If the query string is not declared and part of the `url`, Sentry moves it to the
/// query string.
/// </summary>
[JsonProperty("query_string")]
public Cookies? QueryString { get; set; }
/// <summary>
/// The URL of the request if available.
///
/// The query string can be declared either as part of the `url`, or separately in
/// `query_string`.
/// </summary>
[JsonProperty("url")]
public string Url { get; set; }
}
/// <summary>
/// The SDK Interface describes the Sentry SDK and its configuration used to capture and
/// transmit an event.
/// </summary>
public partial class ClientSdkInfo
{
/// <summary>
/// List of integrations that are enabled in the SDK. _Optional._
///
/// The list should have all enabled integrations, including default integrations. Default
/// integrations are included because different SDK releases may contain different default
/// integrations.
/// </summary>
[JsonProperty("integrations")]
public string[] Integrations { get; set; }
/// <summary>
/// Unique SDK name. _Required._
///
/// The name of the SDK. The format is `entity.ecosystem[.flavor]` where entity identifies
/// the
/// developer of the SDK, ecosystem refers to the programming language or platform where the
/// SDK is to be used and the optional flavor is used to identify standalone SDKs that are
/// part
/// of a major ecosystem.
///
/// Official Sentry SDKs use the entity `sentry`, as in `sentry.python` or
/// `sentry.javascript.react-native`. Please use a different entity for your own SDKs.
/// </summary>
[JsonProperty("name", Required = Required.AllowNull)]
public string Name { get; set; }
/// <summary>
/// List of installed and loaded SDK packages. _Optional._
///
/// A list of packages that were installed as part of this SDK or the activated
/// integrations.
/// Each package consists of a name in the format `source:identifier` and `version`. If the
/// source is a Git repository, the `source` should be `git`, the identifier should be a
/// checkout link and the version should be a Git reference (branch, tag or SHA).
/// </summary>
[JsonProperty("packages")]
public ClientSdkPackage[] Packages { get; set; }
/// <summary>
/// The version of the SDK. _Required._
///
/// It should have the [Semantic Versioning](https://semver.org/) format
/// `MAJOR.MINOR.PATCH`,
/// without any prefix (no `v` or anything else in front of the major version number).
///
/// Examples: `0.1.0`, `1.0.0`, `4.3.12`
/// </summary>
[JsonProperty("version", Required = Required.AllowNull)]
public string Version { get; set; }
}
/// <summary>
/// An installed and loaded package as part of the Sentry SDK.
/// </summary>
public partial class ClientSdkPackage
{
/// <summary>
/// Name of the package.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Version of the package.
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
}
public partial class Span
{
/// <summary>
/// Human readable description of a span (e.g. method URL).
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// Span type (see `OperationType` docs).
/// </summary>
[JsonProperty("op")]
public string Op { get; set; }
/// <summary>
/// The ID of the span enclosing this span.
/// </summary>
[JsonProperty("parent_span_id")]
public string ParentSpanId { get; set; }
/// <summary>
/// The Span id.
/// </summary>
[JsonProperty("span_id", Required = Required.AllowNull)]
public string SpanId { get; set; }
/// <summary>
/// Timestamp when the span started.
/// </summary>
[JsonProperty("start_timestamp", Required = Required.AllowNull)]
public Timestamp StartTimestamp { get; set; }
/// <summary>
/// The status of a span
/// </summary>
[JsonProperty("status")]
public SpanStatus? Status { get; set; }
/// <summary>
/// Timestamp when the span was ended.
/// </summary>
[JsonProperty("timestamp", Required = Required.AllowNull)]
public Timestamp Timestamp { get; set; }
/// <summary>
/// The ID of the trace the span belongs to.
/// </summary>
[JsonProperty("trace_id", Required = Required.AllowNull)]
public string TraceId { get; set; }
}
public partial class Threads
{
[JsonProperty("values", Required = Required.Always)]
public Thread[] Values { get; set; }
}
/// <summary>
/// A process thread of an event.
///
/// The Threads Interface specifies threads that were running at the time an event happened.
/// These threads can also contain stack traces.
///
/// An event may contain one or more threads in an attribute named `threads`.
///
/// The following example illustrates the threads part of the event payload and omits other
/// attributes for simplicity.
///
/// ```json
/// {
/// "threads": {
/// "values": [
/// {
/// "id": "0",
/// "name": "main",
/// "crashed": true,
/// "stacktrace": {}
/// }
/// ]
/// }
/// }
/// ```
/// </summary>
public partial class Thread
{
/// <summary>
/// A flag indicating whether the thread crashed. Defaults to `false`.
/// </summary>
[JsonProperty("crashed")]
public bool? Crashed { get; set; }
/// <summary>
/// A flag indicating whether the thread was in the foreground. Defaults to `false`.
/// </summary>
[JsonProperty("current")]
public bool? Current { get; set; }
/// <summary>
/// The ID of the thread. Typically a number or numeric string.
///
/// Needs to be unique among the threads. An exception can set the `thread_id` attribute to
/// cross-reference this thread.
/// </summary>
[JsonProperty("id")]
public ThreadId? Id { get; set; }
/// <summary>
/// Display name of this thread.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Stack trace containing frames of this exception.
///
/// The thread that crashed with an exception should not have a stack trace, but instead, the
/// `thread_id` attribute should be set on the exception and Sentry will connect the two.
/// </summary>
[JsonProperty("stacktrace")]
public Stacktrace Stacktrace { get; set; }
}
/// <summary>
/// Information about the user who triggered an event.
///
/// ```json
/// {
/// "user": {
/// "id": "unique_id",
/// "username": "my_user",
/// "email": "[email protected]",
/// "ip_address": "127.0.0.1",
/// "subscription": "basic"
/// }
/// }
/// ```
/// </summary>
public partial class User
{
/// <summary>
/// Additional arbitrary fields, as stored in the database (and sometimes as sent by
/// clients).
/// All data from `self.other` should end up here after store normalization.
/// </summary>
[JsonProperty("data")]
public Dictionary<string, object> Data { get; set; }
/// <summary>
/// Email address of the user.
/// </summary>
[JsonProperty("email")]
public string Email { get; set; }
/// <summary>
/// Approximate geographical location of the end user or device.
/// </summary>
[JsonProperty("geo")]
public Geo Geo { get; set; }
/// <summary>
/// Unique identifier of the user.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// Remote IP address of the user. Defaults to "{{auto}}".
/// </summary>
[JsonProperty("ip_address")]
public string IpAddress { get; set; }
/// <summary>
/// Human readable name of the user.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Username of the user.
/// </summary>
[JsonProperty("username")]
public string Username { get; set; }
}
/// <summary>
/// Geographical location of the end user or device.
/// </summary>
public partial class Geo
{
/// <summary>
/// Human readable city name.
/// </summary>
[JsonProperty("city")]
public string City { get; set; }
/// <summary>
/// Two-letter country code (ISO 3166-1 alpha-2).
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
/// <summary>
/// Human readable region name or code.
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
}
/// <summary>
/// Severity level of an event or breadcrumb.
/// </summary>
public enum Level { Debug, Error, Fatal, Info, Warning };
/// <summary>
/// Trace status.
///
/// Values from
/// https://github.com/open-telemetry/opentelemetry-specification/blob/8fb6c14e4709e75a9aaa64b0dbbdf02a6067682a/specification/api-tracing.md#status
/// Mapping to HTTP from
/// https://github.com/open-telemetry/opentelemetry-specification/blob/8fb6c14e4709e75a9aaa64b0dbbdf02a6067682a/specification/data-http.md#status
/// </summary>
public enum SpanStatus { Aborted, AlreadyExists, Cancelled, DataLoss, DeadlineExceeded, FailedPrecondition, InternalError, InvalidArgument, NotFound, Ok, OutOfRange, PermissionDenied, ResourceExhausted, Unauthenticated, Unavailable, Unimplemented, Unknown };
/// <summary>
/// The type of an event.
/// </summary>
public enum EventType { Csp, Default, Error, Expectct, Expectstaple, Hpkp, Transaction };
public partial struct Timestamp
{
public double? Double;
public string String;
public static implicit operator Timestamp(double Double) => new Timestamp { Double = Double };
public static implicit operator Timestamp(string String) => new Timestamp { String = String };
public bool IsNull => Double == null && String == null;
}
public partial struct ThreadId
{
public long? Integer;
public string String;
public static implicit operator ThreadId(long Integer) => new ThreadId { Integer = Integer };
public static implicit operator ThreadId(string String) => new ThreadId { String = String };
public bool IsNull => Integer == null && String == null;
}
/// <summary>
/// The cookie values.
///
/// Can be given unparsed as string, as dictionary, or as a list of tuples.
///
/// A dictionary of submitted headers.
///
/// If a header appears multiple times it, needs to be merged according to the HTTP standard
/// for header merging. Header names are treated case-insensitively by Sentry.
///
/// The query string component of the URL.
///
/// Can be given as unparsed string, dictionary, or list of tuples.
///
/// If the query string is not declared and part of the `url`, Sentry moves it to the
/// query string.
///
/// Custom tags for this event.
///
/// A map or list of tags for this event. Each tag must be less than 200 characters.
/// </summary>
public partial struct Cookies
{
public string[][] UnionArray;
public Dictionary<string, string> UnionMap;
public static implicit operator Cookies(string[][] UnionArray) => new Cookies { UnionArray = UnionArray };
public static implicit operator Cookies(Dictionary<string, string> UnionMap) => new Cookies { UnionMap = UnionMap };
public bool IsNull => UnionArray == null && UnionMap == null;
}
public partial class Coordinate
{
public static Coordinate FromJson(string json) => JsonConvert.DeserializeObject<Coordinate>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this Coordinate self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
LevelConverter.Singleton,
TimestampConverter.Singleton,
SpanStatusConverter.Singleton,
ThreadIdConverter.Singleton,
CookiesConverter.Singleton,
EventTypeConverter.Singleton,
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class LevelConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Level) || t == typeof(Level?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "debug":
return Level.Debug;
case "error":
return Level.Error;
case "fatal":
return Level.Fatal;
case "info":
return Level.Info;
case "warning":
return Level.Warning;
}
throw new Exception("Cannot unmarshal type Level");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Level)untypedValue;
switch (value)
{
case Level.Debug:
serializer.Serialize(writer, "debug");
return;
case Level.Error:
serializer.Serialize(writer, "error");
return;
case Level.Fatal:
serializer.Serialize(writer, "fatal");
return;
case Level.Info:
serializer.Serialize(writer, "info");
return;
case Level.Warning:
serializer.Serialize(writer, "warning");
return;
}
throw new Exception("Cannot marshal type Level");
}
public static readonly LevelConverter Singleton = new LevelConverter();
}
internal class TimestampConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Timestamp) || t == typeof(Timestamp?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new Timestamp { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize<double>(reader);
return new Timestamp { Double = doubleValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize<string>(reader);
return new Timestamp { String = stringValue };
}
throw new Exception("Cannot unmarshal type Timestamp");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (Timestamp)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
throw new Exception("Cannot marshal type Timestamp");
}
public static readonly TimestampConverter Singleton = new TimestampConverter();
}
internal class SpanStatusConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SpanStatus) || t == typeof(SpanStatus?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "aborted":
return SpanStatus.Aborted;
case "already_exists":
return SpanStatus.AlreadyExists;
case "cancelled":
return SpanStatus.Cancelled;
case "data_loss":
return SpanStatus.DataLoss;
case "deadline_exceeded":
return SpanStatus.DeadlineExceeded;
case "failed_precondition":
return SpanStatus.FailedPrecondition;
case "internal_error":
return SpanStatus.InternalError;
case "invalid_argument":
return SpanStatus.InvalidArgument;
case "not_found":
return SpanStatus.NotFound;
case "ok":
return SpanStatus.Ok;
case "out_of_range":
return SpanStatus.OutOfRange;
case "permission_denied":
return SpanStatus.PermissionDenied;
case "resource_exhausted":
return SpanStatus.ResourceExhausted;
case "unauthenticated":
return SpanStatus.Unauthenticated;
case "unavailable":
return SpanStatus.Unavailable;
case "unimplemented":
return SpanStatus.Unimplemented;
case "unknown":
return SpanStatus.Unknown;
}
throw new Exception("Cannot unmarshal type SpanStatus");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SpanStatus)untypedValue;
switch (value)
{
case SpanStatus.Aborted:
serializer.Serialize(writer, "aborted");
return;
case SpanStatus.AlreadyExists:
serializer.Serialize(writer, "already_exists");
return;
case SpanStatus.Cancelled:
serializer.Serialize(writer, "cancelled");
return;
case SpanStatus.DataLoss:
serializer.Serialize(writer, "data_loss");
return;
case SpanStatus.DeadlineExceeded:
serializer.Serialize(writer, "deadline_exceeded");
return;
case SpanStatus.FailedPrecondition:
serializer.Serialize(writer, "failed_precondition");
return;
case SpanStatus.InternalError:
serializer.Serialize(writer, "internal_error");
return;
case SpanStatus.InvalidArgument:
serializer.Serialize(writer, "invalid_argument");
return;
case SpanStatus.NotFound:
serializer.Serialize(writer, "not_found");
return;
case SpanStatus.Ok:
serializer.Serialize(writer, "ok");
return;
case SpanStatus.OutOfRange:
serializer.Serialize(writer, "out_of_range");
return;
case SpanStatus.PermissionDenied:
serializer.Serialize(writer, "permission_denied");
return;
case SpanStatus.ResourceExhausted:
serializer.Serialize(writer, "resource_exhausted");
return;
case SpanStatus.Unauthenticated:
serializer.Serialize(writer, "unauthenticated");
return;
case SpanStatus.Unavailable:
serializer.Serialize(writer, "unavailable");
return;
case SpanStatus.Unimplemented:
serializer.Serialize(writer, "unimplemented");
return;
case SpanStatus.Unknown:
serializer.Serialize(writer, "unknown");
return;
}
throw new Exception("Cannot marshal type SpanStatus");
}
public static readonly SpanStatusConverter Singleton = new SpanStatusConverter();
}
internal class ThreadIdConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ThreadId) || t == typeof(ThreadId?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new ThreadId { };
case JsonToken.Integer:
var integerValue = serializer.Deserialize<long>(reader);
return new ThreadId { Integer = integerValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize<string>(reader);
return new ThreadId { String = stringValue };
}
throw new Exception("Cannot unmarshal type ThreadId");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (ThreadId)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Integer != null)
{
serializer.Serialize(writer, value.Integer.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
throw new Exception("Cannot marshal type ThreadId");
}
public static readonly ThreadIdConverter Singleton = new ThreadIdConverter();
}
internal class CookiesConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Cookies) || t == typeof(Cookies?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new Cookies { };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize<Dictionary<string, string>>(reader);
return new Cookies { UnionMap = objectValue };
case JsonToken.StartArray:
var arrayValue = serializer.Deserialize<string[][]>(reader);
return new Cookies { UnionArray = arrayValue };
}
throw new Exception("Cannot unmarshal type Cookies");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (Cookies)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.UnionArray != null)
{
serializer.Serialize(writer, value.UnionArray);
return;
}
if (value.UnionMap != null)
{
serializer.Serialize(writer, value.UnionMap);
return;
}
throw new Exception("Cannot marshal type Cookies");
}
public static readonly CookiesConverter Singleton = new CookiesConverter();
}
internal class EventTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(EventType) || t == typeof(EventType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "csp":
return EventType.Csp;
case "default":
return EventType.Default;
case "error":
return EventType.Error;
case "expectct":
return EventType.Expectct;
case "expectstaple":
return EventType.Expectstaple;
case "hpkp":
return EventType.Hpkp;
case "transaction":
return EventType.Transaction;
}
throw new Exception("Cannot unmarshal type EventType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (EventType)untypedValue;
switch (value)
{
case EventType.Csp:
serializer.Serialize(writer, "csp");
return;
case EventType.Default:
serializer.Serialize(writer, "default");
return;
case EventType.Error:
serializer.Serialize(writer, "error");
return;
case EventType.Expectct:
serializer.Serialize(writer, "expectct");
return;
case EventType.Expectstaple:
serializer.Serialize(writer, "expectstaple");
return;
case EventType.Hpkp:
serializer.Serialize(writer, "hpkp");
return;
case EventType.Transaction:
serializer.Serialize(writer, "transaction");
return;
}
throw new Exception("Cannot marshal type EventType");
}
public static readonly EventTypeConverter Singleton = new EventTypeConverter();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment