2023-05-31 18:12:14 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
// <auto-generated />
|
|
|
|
|
//
|
|
|
|
|
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
|
|
|
|
|
//
|
|
|
|
|
// using QuickType;
|
|
|
|
|
//
|
|
|
|
|
// var welcome = Welcome.FromJson(jsonString);
|
|
|
|
|
|
|
|
|
|
namespace TyphoonApi
|
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Converters;
|
2024-08-06 13:31:59 +08:00
|
|
|
|
using RainApi;
|
2023-05-31 18:12:14 +08:00
|
|
|
|
|
|
|
|
|
public partial class Welcome
|
|
|
|
|
{
|
|
|
|
|
public Xml Xml { get; set; }
|
|
|
|
|
public Alert Alert { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Alert
|
|
|
|
|
{
|
|
|
|
|
public string Xmlns { get; set; }
|
|
|
|
|
public string Identifier { get; set; }
|
|
|
|
|
public string Sender { get; set; }
|
|
|
|
|
public DateTimeOffset Sent { get; set; }
|
|
|
|
|
public string Status { get; set; }
|
|
|
|
|
public string MsgType { get; set; }
|
|
|
|
|
public string Scope { get; set; }
|
|
|
|
|
public string References { get; set; }
|
2024-08-06 13:31:59 +08:00
|
|
|
|
|
|
|
|
|
//此標籤為將資料統一轉成陣列,因氣象局資料會根據狀況傳回單個物件或陣列,會導致解析失敗
|
|
|
|
|
[JsonConverter(typeof(SingleOrArrayConverter<Info>))]
|
|
|
|
|
public List<Info> Info { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Info
|
|
|
|
|
{
|
|
|
|
|
public string Language { get; set; }
|
|
|
|
|
public string Category { get; set; }
|
|
|
|
|
public string Event { get; set; }
|
|
|
|
|
public string Urgency { get; set; }
|
|
|
|
|
public string Severity { get; set; }
|
|
|
|
|
public string Certainty { get; set; }
|
|
|
|
|
public EventCode EventCode { get; set; }
|
|
|
|
|
public DateTimeOffset Effective { get; set; }
|
|
|
|
|
public DateTimeOffset Onset { get; set; }
|
|
|
|
|
public DateTimeOffset Expires { get; set; }
|
|
|
|
|
public string SenderName { get; set; }
|
|
|
|
|
public string Headline { get; set; }
|
|
|
|
|
public Description Description { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public object Instruction { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
public Uri Web { get; set; }
|
2024-08-06 13:31:59 +08:00
|
|
|
|
|
|
|
|
|
//此標籤為將資料統一轉成陣列,因氣象局資料會根據狀況傳回單個物件或陣列,會導致解析失敗
|
|
|
|
|
[JsonConverter(typeof(SingleOrArrayConverter<EventCode>))]
|
|
|
|
|
public List<EventCode> Parameter { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public List<Area> Area { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Area
|
|
|
|
|
{
|
|
|
|
|
public string AreaDesc { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public EventCode Geocode { get; set; }
|
|
|
|
|
}
|
2023-05-31 18:12:14 +08:00
|
|
|
|
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public partial class EventCode
|
|
|
|
|
{
|
|
|
|
|
public string ValueName { get; set; }
|
|
|
|
|
public string Value { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Description
|
|
|
|
|
{
|
|
|
|
|
public TyphoonInfo TyphoonInfo { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public List<DescriptionSection> Section { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class DescriptionSection
|
|
|
|
|
{
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
public string Text { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class TyphoonInfo
|
|
|
|
|
{
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public List<TyphoonInfoSection> Section { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class TyphoonInfoSection
|
|
|
|
|
{
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
public string Text { get; set; }
|
|
|
|
|
public string TyphoonName { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public string CwaTyphoonName { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
public Analysis Analysis { get; set; }
|
|
|
|
|
public Analysis Prediction { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Analysis
|
|
|
|
|
{
|
|
|
|
|
public DateTimeOffset Time { get; set; }
|
|
|
|
|
public string Position { get; set; }
|
|
|
|
|
public Gust MaxWinds { get; set; }
|
|
|
|
|
public Gust Gust { get; set; }
|
|
|
|
|
public Gust Pressure { get; set; }
|
|
|
|
|
public Gust RadiusOf15Mps { get; set; }
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public List<Scale> Scale { get; set; }
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Gust
|
|
|
|
|
{
|
|
|
|
|
public string Unit { get; set; }
|
|
|
|
|
public long Text { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Scale
|
|
|
|
|
{
|
|
|
|
|
public string Lang { get; set; }
|
|
|
|
|
public string Text { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class Xml
|
|
|
|
|
{
|
|
|
|
|
public string Version { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-16 17:00:10 +08:00
|
|
|
|
public enum ValueName { AlertTitle, ProfileCapTwpEvent10, TaiwanGeocode112 };
|
2023-05-31 18:12:14 +08:00
|
|
|
|
}
|