// ignore_for_file: avoid_init_to_null

import 'package:json_annotation/json_annotation.dart';

part 'jira_data.g.dart';

//Jira Issue Response
@JsonSerializable()
class DataJiraIssue {
  late String? id = null;
  late String? self = null;
  late String? key = null;
  DataJiraIssueField? fields;

  DataJiraIssue();

  factory DataJiraIssue.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssueFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssueToJson(this);
}

//Jira Issue Field
@JsonSerializable()
class DataJiraIssueField {
  late String? summary = null;
  late DataJiraIssuePriority? priority = null;
  late DataJiraIssueStatus? status = null;
  late DataJiraUser? assignee = null;
  late DataJiraUser? creator = null;
  late DataJiraUser? reporter = null;
  late DataJiraIssueDesc? description = null;

  DataJiraIssueField();  

  factory DataJiraIssueField.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssueFieldFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssueFieldToJson(this);
}

//Jira Issue Priority
@JsonSerializable()
class DataJiraIssuePriority {
  late String? self = null;
  late String? iconUrl = null;
  late String? name = null;
  late String? id = null;

  DataJiraIssuePriority();  

  factory DataJiraIssuePriority.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssuePriorityFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssuePriorityToJson(this);
}

// Jira Issue Status
@JsonSerializable()
class DataJiraIssueStatus {
  late String? self = null;
  late String? description = null;
  late String? iconUrl = null;
  late String? name = null;
  late String? id = null;
  late DataJiraIssueStatusCategory? statusCategory = null;

  DataJiraIssueStatus();  

  factory DataJiraIssueStatus.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssueStatusFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssueStatusToJson(this);
}

// Jira Issue Status Category
@JsonSerializable()
class DataJiraIssueStatusCategory {
  late String? self = null;
  late int? id = null;
  late String? key = null;
  late String? colorName = null;
  late String? name = null;

  DataJiraIssueStatusCategory();  

  factory DataJiraIssueStatusCategory.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssueStatusCategoryFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssueStatusCategoryToJson(this);
}

//Jira Issue User
@JsonSerializable()
class DataJiraUser {
  late String? self = null;
  late String? accountId = null;
  late String? emailAddress = null;
  late Map<String, String> avatarUrls;
  late String? displayName = null;
  late bool? activate = null;
  late String? timeZone = null;
  late String? accountType = null;

  DataJiraUser();  

  factory DataJiraUser.fromJson(Map<String, dynamic> json) =>
      _$DataJiraUserFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraUserToJson(this);
}

// Jira Issue Desc
@JsonSerializable()
class DataJiraIssueDesc {
  late int? version = null;
  late String? doc = null;
  late List<DataJiraContent>? content = null;

  DataJiraIssueDesc();  

  factory DataJiraIssueDesc.fromJson(Map<String, dynamic> json) =>
      _$DataJiraIssueDescFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraIssueDescToJson(this);
}

// Jira Issue Content
@JsonSerializable()
class DataJiraContent {
  late String? type = null;
  late String? text = null;
  late List<DataJiraContent>? content = null;

  DataJiraContent();  

  factory DataJiraContent.fromJson(Map<String, dynamic> json) =>
      _$DataJiraContentFromJson(json);
  Map<String, dynamic> toJson() => _$DataJiraContentToJson(this);
}


// // Jira Issue
// @JsonSerializable()
// class DataJira {

//   DataJira();  

//   factory DataJira.fromJson(Map<String, dynamic> json) =>
//       _$DataJiraFromJson(json);
//   Map<String, dynamic> toJson() => _$DataJiraToJson(this);
// }