Files
sdk/lib/model/post_event_request.dart

802 lines
30 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of hanzoai.cloud;
class PostEventRequest {
/// Returns a new [PostEventRequest] instance.
PostEventRequest({
this.anonymousId,
this.channel,
this.clip,
this.currency,
this.distinctId,
this.environment,
this.error,
this.event,
this.groupId,
this.groupType,
this.kind,
this.level,
this.library_,
this.libraryVersion,
this.log,
this.messageId,
this.metric,
this.path,
this.personId,
this.product,
this.productId,
this.properties = const {},
this.quantity,
this.refCode,
this.referrer,
this.release,
this.resource,
this.revenue,
this.service,
this.sessionId,
this.signupWeek,
this.site,
this.span,
this.spanId,
this.timestamp,
this.traceId,
this.type,
this.url,
this.utm,
this.batch = const [],
this.events = const [],
this.distinctIdLegacy,
this.uuid,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? anonymousId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? channel;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ClipBody? clip;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? currency;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? distinctId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? environment;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ErrorBody? error;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? event;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? groupId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? groupType;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? kind;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? level;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? library_;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? libraryVersion;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
LogBody? log;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? messageId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
MetricBody? metric;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? path;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? personId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? product;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? productId;
Map<String, Object> properties;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? quantity;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? refCode;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? referrer;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? release;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? resource;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? revenue;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? service;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? sessionId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? signupWeek;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? site;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
SpanBody? span;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? spanId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? timestamp;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? traceId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? type;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? url;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
UTM? utm;
List<InsightsEvent> batch;
List<CaptureEvent> events;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? distinctIdLegacy;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? uuid;
@override
bool operator ==(Object other) => identical(this, other) || other is PostEventRequest &&
other.anonymousId == anonymousId &&
other.channel == channel &&
other.clip == clip &&
other.currency == currency &&
other.distinctId == distinctId &&
other.environment == environment &&
other.error == error &&
other.event == event &&
other.groupId == groupId &&
other.groupType == groupType &&
other.kind == kind &&
other.level == level &&
other.library_ == library_ &&
other.libraryVersion == libraryVersion &&
other.log == log &&
other.messageId == messageId &&
other.metric == metric &&
other.path == path &&
other.personId == personId &&
other.product == product &&
other.productId == productId &&
_deepEquality.equals(other.properties, properties) &&
other.quantity == quantity &&
other.refCode == refCode &&
other.referrer == referrer &&
other.release == release &&
other.resource == resource &&
other.revenue == revenue &&
other.service == service &&
other.sessionId == sessionId &&
other.signupWeek == signupWeek &&
other.site == site &&
other.span == span &&
other.spanId == spanId &&
other.timestamp == timestamp &&
other.traceId == traceId &&
other.type == type &&
other.url == url &&
other.utm == utm &&
_deepEquality.equals(other.batch, batch) &&
_deepEquality.equals(other.events, events) &&
other.distinctIdLegacy == distinctIdLegacy &&
other.uuid == uuid;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(anonymousId == null ? 0 : anonymousId!.hashCode) +
(channel == null ? 0 : channel!.hashCode) +
(clip == null ? 0 : clip!.hashCode) +
(currency == null ? 0 : currency!.hashCode) +
(distinctId == null ? 0 : distinctId!.hashCode) +
(environment == null ? 0 : environment!.hashCode) +
(error == null ? 0 : error!.hashCode) +
(event == null ? 0 : event!.hashCode) +
(groupId == null ? 0 : groupId!.hashCode) +
(groupType == null ? 0 : groupType!.hashCode) +
(kind == null ? 0 : kind!.hashCode) +
(level == null ? 0 : level!.hashCode) +
(library_ == null ? 0 : library_!.hashCode) +
(libraryVersion == null ? 0 : libraryVersion!.hashCode) +
(log == null ? 0 : log!.hashCode) +
(messageId == null ? 0 : messageId!.hashCode) +
(metric == null ? 0 : metric!.hashCode) +
(path == null ? 0 : path!.hashCode) +
(personId == null ? 0 : personId!.hashCode) +
(product == null ? 0 : product!.hashCode) +
(productId == null ? 0 : productId!.hashCode) +
(properties.hashCode) +
(quantity == null ? 0 : quantity!.hashCode) +
(refCode == null ? 0 : refCode!.hashCode) +
(referrer == null ? 0 : referrer!.hashCode) +
(release == null ? 0 : release!.hashCode) +
(resource == null ? 0 : resource!.hashCode) +
(revenue == null ? 0 : revenue!.hashCode) +
(service == null ? 0 : service!.hashCode) +
(sessionId == null ? 0 : sessionId!.hashCode) +
(signupWeek == null ? 0 : signupWeek!.hashCode) +
(site == null ? 0 : site!.hashCode) +
(span == null ? 0 : span!.hashCode) +
(spanId == null ? 0 : spanId!.hashCode) +
(timestamp == null ? 0 : timestamp!.hashCode) +
(traceId == null ? 0 : traceId!.hashCode) +
(type == null ? 0 : type!.hashCode) +
(url == null ? 0 : url!.hashCode) +
(utm == null ? 0 : utm!.hashCode) +
(batch.hashCode) +
(events.hashCode) +
(distinctIdLegacy == null ? 0 : distinctIdLegacy!.hashCode) +
(uuid == null ? 0 : uuid!.hashCode);
@override
String toString() => 'PostEventRequest[anonymousId=$anonymousId, channel=$channel, clip=$clip, currency=$currency, distinctId=$distinctId, environment=$environment, error=$error, event=$event, groupId=$groupId, groupType=$groupType, kind=$kind, level=$level, library_=$library_, libraryVersion=$libraryVersion, log=$log, messageId=$messageId, metric=$metric, path=$path, personId=$personId, product=$product, productId=$productId, properties=$properties, quantity=$quantity, refCode=$refCode, referrer=$referrer, release=$release, resource=$resource, revenue=$revenue, service=$service, sessionId=$sessionId, signupWeek=$signupWeek, site=$site, span=$span, spanId=$spanId, timestamp=$timestamp, traceId=$traceId, type=$type, url=$url, utm=$utm, batch=$batch, events=$events, distinctIdLegacy=$distinctIdLegacy, uuid=$uuid]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.anonymousId != null) {
json[r'anonymousId'] = this.anonymousId;
} else {
json[r'anonymousId'] = null;
}
if (this.channel != null) {
json[r'channel'] = this.channel;
} else {
json[r'channel'] = null;
}
if (this.clip != null) {
json[r'clip'] = this.clip;
} else {
json[r'clip'] = null;
}
if (this.currency != null) {
json[r'currency'] = this.currency;
} else {
json[r'currency'] = null;
}
if (this.distinctId != null) {
json[r'distinctId'] = this.distinctId;
} else {
json[r'distinctId'] = null;
}
if (this.environment != null) {
json[r'environment'] = this.environment;
} else {
json[r'environment'] = null;
}
if (this.error != null) {
json[r'error'] = this.error;
} else {
json[r'error'] = null;
}
if (this.event != null) {
json[r'event'] = this.event;
} else {
json[r'event'] = null;
}
if (this.groupId != null) {
json[r'groupId'] = this.groupId;
} else {
json[r'groupId'] = null;
}
if (this.groupType != null) {
json[r'groupType'] = this.groupType;
} else {
json[r'groupType'] = null;
}
if (this.kind != null) {
json[r'kind'] = this.kind;
} else {
json[r'kind'] = null;
}
if (this.level != null) {
json[r'level'] = this.level;
} else {
json[r'level'] = null;
}
if (this.library_ != null) {
json[r'library'] = this.library_;
} else {
json[r'library'] = null;
}
if (this.libraryVersion != null) {
json[r'libraryVersion'] = this.libraryVersion;
} else {
json[r'libraryVersion'] = null;
}
if (this.log != null) {
json[r'log'] = this.log;
} else {
json[r'log'] = null;
}
if (this.messageId != null) {
json[r'messageId'] = this.messageId;
} else {
json[r'messageId'] = null;
}
if (this.metric != null) {
json[r'metric'] = this.metric;
} else {
json[r'metric'] = null;
}
if (this.path != null) {
json[r'path'] = this.path;
} else {
json[r'path'] = null;
}
if (this.personId != null) {
json[r'personId'] = this.personId;
} else {
json[r'personId'] = null;
}
if (this.product != null) {
json[r'product'] = this.product;
} else {
json[r'product'] = null;
}
if (this.productId != null) {
json[r'productId'] = this.productId;
} else {
json[r'productId'] = null;
}
json[r'properties'] = this.properties;
if (this.quantity != null) {
json[r'quantity'] = this.quantity;
} else {
json[r'quantity'] = null;
}
if (this.refCode != null) {
json[r'refCode'] = this.refCode;
} else {
json[r'refCode'] = null;
}
if (this.referrer != null) {
json[r'referrer'] = this.referrer;
} else {
json[r'referrer'] = null;
}
if (this.release != null) {
json[r'release'] = this.release;
} else {
json[r'release'] = null;
}
if (this.resource != null) {
json[r'resource'] = this.resource;
} else {
json[r'resource'] = null;
}
if (this.revenue != null) {
json[r'revenue'] = this.revenue;
} else {
json[r'revenue'] = null;
}
if (this.service != null) {
json[r'service'] = this.service;
} else {
json[r'service'] = null;
}
if (this.sessionId != null) {
json[r'sessionId'] = this.sessionId;
} else {
json[r'sessionId'] = null;
}
if (this.signupWeek != null) {
json[r'signupWeek'] = this.signupWeek;
} else {
json[r'signupWeek'] = null;
}
if (this.site != null) {
json[r'site'] = this.site;
} else {
json[r'site'] = null;
}
if (this.span != null) {
json[r'span'] = this.span;
} else {
json[r'span'] = null;
}
if (this.spanId != null) {
json[r'spanId'] = this.spanId;
} else {
json[r'spanId'] = null;
}
if (this.timestamp != null) {
json[r'timestamp'] = this.timestamp;
} else {
json[r'timestamp'] = null;
}
if (this.traceId != null) {
json[r'traceId'] = this.traceId;
} else {
json[r'traceId'] = null;
}
if (this.type != null) {
json[r'type'] = this.type;
} else {
json[r'type'] = null;
}
if (this.url != null) {
json[r'url'] = this.url;
} else {
json[r'url'] = null;
}
if (this.utm != null) {
json[r'utm'] = this.utm;
} else {
json[r'utm'] = null;
}
json[r'batch'] = this.batch;
json[r'events'] = this.events;
if (this.distinctIdLegacy != null) {
json[r'distinct_id'] = this.distinctIdLegacy;
} else {
json[r'distinct_id'] = null;
}
if (this.uuid != null) {
json[r'uuid'] = this.uuid;
} else {
json[r'uuid'] = null;
}
return json;
}
/// Returns a new [PostEventRequest] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PostEventRequest? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "PostEventRequest[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "PostEventRequest[$key]" has a null value in JSON.');
});
return true;
}());
return PostEventRequest(
anonymousId: mapValueOfType<String>(json, r'anonymousId'),
channel: mapValueOfType<String>(json, r'channel'),
clip: ClipBody.fromJson(json[r'clip']),
currency: mapValueOfType<String>(json, r'currency'),
distinctId: mapValueOfType<String>(json, r'distinctId'),
environment: mapValueOfType<String>(json, r'environment'),
error: ErrorBody.fromJson(json[r'error']),
event: mapValueOfType<String>(json, r'event'),
groupId: mapValueOfType<String>(json, r'groupId'),
groupType: mapValueOfType<String>(json, r'groupType'),
kind: mapValueOfType<String>(json, r'kind'),
level: mapValueOfType<String>(json, r'level'),
library_: mapValueOfType<String>(json, r'library'),
libraryVersion: mapValueOfType<String>(json, r'libraryVersion'),
log: LogBody.fromJson(json[r'log']),
messageId: mapValueOfType<String>(json, r'messageId'),
metric: MetricBody.fromJson(json[r'metric']),
path: mapValueOfType<String>(json, r'path'),
personId: mapValueOfType<String>(json, r'personId'),
product: mapValueOfType<String>(json, r'product'),
productId: mapValueOfType<String>(json, r'productId'),
properties: mapCastOfType<String, Object>(json, r'properties') ?? const {},
quantity: mapValueOfType<int>(json, r'quantity'),
refCode: mapValueOfType<String>(json, r'refCode'),
referrer: mapValueOfType<String>(json, r'referrer'),
release: mapValueOfType<String>(json, r'release'),
resource: mapValueOfType<String>(json, r'resource'),
revenue: num.parse('${json[r'revenue']}'),
service: mapValueOfType<String>(json, r'service'),
sessionId: mapValueOfType<String>(json, r'sessionId'),
signupWeek: mapValueOfType<String>(json, r'signupWeek'),
site: mapValueOfType<String>(json, r'site'),
span: SpanBody.fromJson(json[r'span']),
spanId: mapValueOfType<String>(json, r'spanId'),
timestamp: mapValueOfType<String>(json, r'timestamp'),
traceId: mapValueOfType<String>(json, r'traceId'),
type: mapValueOfType<String>(json, r'type'),
url: mapValueOfType<String>(json, r'url'),
utm: UTM.fromJson(json[r'utm']),
batch: InsightsEvent.listFromJson(json[r'batch']),
events: CaptureEvent.listFromJson(json[r'events']),
distinctIdLegacy: mapValueOfType<String>(json, r'distinct_id'),
uuid: mapValueOfType<String>(json, r'uuid'),
);
}
return null;
}
static List<PostEventRequest> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PostEventRequest>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PostEventRequest.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PostEventRequest> mapFromJson(dynamic json) {
final map = <String, PostEventRequest>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PostEventRequest.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PostEventRequest-objects as value to a dart map
static Map<String, List<PostEventRequest>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PostEventRequest>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PostEventRequest.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}