diff --git a/README b/README deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 9e3d045..4a6795f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# RestEaseDemo -RestEase demo repo +# RestEase demo project +This repo is a simple application to practice [RestEase](https://github.com/canton7/RestEase) project possibilities. + +## How to run +Working in progress... \ No newline at end of file diff --git a/Swapi/Models/Film.cs b/Swapi/Models/Film.cs new file mode 100644 index 0000000..fac07de --- /dev/null +++ b/Swapi/Models/Film.cs @@ -0,0 +1,50 @@ +using Newtonsoft.Json; +using System; + +namespace Swapi.Models +{ + public class Film + { + [JsonProperty("characters")] + public Uri[] Characters { get; set; } + + [JsonProperty("created")] + public DateTimeOffset Created { get; set; } + + [JsonProperty("director")] + public string Director { get; set; } + + [JsonProperty("edited")] + public DateTimeOffset Edited { get; set; } + + [JsonProperty("episode_id")] + public long EpisodeId { get; set; } + + [JsonProperty("opening_crawl")] + public string OpeningCrawl { get; set; } + + [JsonProperty("planets")] + public Uri[] Planets { get; set; } + + [JsonProperty("producer")] + public string Producer { get; set; } + + [JsonProperty("release_date")] + public DateTimeOffset ReleaseDate { get; set; } + + [JsonProperty("species")] + public Uri[] Species { get; set; } + + [JsonProperty("starships")] + public Uri[] Starships { get; set; } + + [JsonProperty("title")] + public string Title { get; set; } + + [JsonProperty("url")] + public Uri Url { get; set; } + + [JsonProperty("vehicles")] + public Uri[] Vehicles { get; set; } + } +} diff --git a/Swapi/Models/People.cs b/Swapi/Models/People.cs new file mode 100644 index 0000000..32f4204 --- /dev/null +++ b/Swapi/Models/People.cs @@ -0,0 +1,59 @@ +using Newtonsoft.Json; +using Swapi.Converters; +using System; + +namespace Swapi.Models +{ + public class People + { + [JsonProperty("birth_year")] + public string BirthYear { get; set; } + + [JsonProperty("eye_color")] + public string EyeColor { get; set; } + + [JsonProperty("films")] + public Uri[] Films { get; set; } + + [JsonProperty("gender")] + public string Gender { get; set; } + + [JsonProperty("hair_color")] + public string HairColor { get; set; } + + [JsonProperty("height")] + [JsonConverter(typeof(ParseStringConverter))] + public long Height { get; set; } + + [JsonProperty("homeworld")] + public Uri Homeworld { get; set; } + + [JsonProperty("mass")] + [JsonConverter(typeof(ParseStringConverter))] + public long Mass { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("skin_color")] + public string SkinColor { get; set; } + + [JsonProperty("created")] + public DateTimeOffset Created { get; set; } + + [JsonProperty("edited")] + public DateTimeOffset Edited { get; set; } + + [JsonProperty("species")] + public Uri[] Species { get; set; } + + [JsonProperty("starships")] + public Uri[] Starships { get; set; } + + [JsonProperty("url")] + public Uri Url { get; set; } + + [JsonProperty("vehicles")] + public Uri[] Vehicles { get; set; } + } +} diff --git a/Swapi/Models/Specie.cs b/Swapi/Models/Specie.cs new file mode 100644 index 0000000..f4994a4 --- /dev/null +++ b/Swapi/Models/Specie.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; +using Swapi.Converters; +using System; + +namespace Swapi.Models +{ + public class Specie + { + [JsonProperty("average_height")] + public string AverageHeight { get; set; } + + [JsonProperty("average_lifespan")] + [JsonConverter(typeof(ParseStringConverter))] + public long AverageLifespan { get; set; } + + [JsonProperty("classification")] + public string Classification { get; set; } + + [JsonProperty("created")] + public DateTimeOffset Created { get; set; } + + [JsonProperty("designation")] + public string Designation { get; set; } + + [JsonProperty("edited")] + public DateTimeOffset Edited { get; set; } + + [JsonProperty("eye_colors")] + public string EyeColors { get; set; } + + [JsonProperty("hair_colors")] + public string HairColors { get; set; } + + [JsonProperty("homeworld")] + public Uri Homeworld { get; set; } + + [JsonProperty("language")] + public string Language { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("people")] + public Uri[] People { get; set; } + + [JsonProperty("films")] + public Uri[] Films { get; set; } + + [JsonProperty("skin_colors")] + public string SkinColors { get; set; } + + [JsonProperty("url")] + public Uri Url { get; set; } + } +} diff --git a/Swapi/Models/Starship.cs b/Swapi/Models/Starship.cs new file mode 100644 index 0000000..eb242b0 --- /dev/null +++ b/Swapi/Models/Starship.cs @@ -0,0 +1,66 @@ +using Newtonsoft.Json; +using Swapi.Converters; +using System; + +namespace Swapi.Models +{ + public class Starship + { + [JsonProperty("MGLT")] + public string Mglt { get; set; } + + [JsonProperty("cargo_capacity")] + public string CargoCapacity { get; set; } + + [JsonProperty("consumables")] + public string Consumables { get; set; } + + [JsonProperty("cost_in_credits")] + public string CostInCredits { get; set; } + + [JsonProperty("created")] + public DateTimeOffset Created { get; set; } + + [JsonProperty("crew")] + [JsonConverter(typeof(ParseStringConverter))] + public long Crew { get; set; } + + [JsonProperty("edited")] + public DateTimeOffset Edited { get; set; } + + [JsonProperty("hyperdrive_rating")] + public string HyperdriveRating { get; set; } + + [JsonProperty("length")] + [JsonConverter(typeof(ParseStringConverter))] + public long Length { get; set; } + + [JsonProperty("manufacturer")] + public string Manufacturer { get; set; } + + [JsonProperty("max_atmosphering_speed")] + public string MaxAtmospheringSpeed { get; set; } + + [JsonProperty("model")] + public string Model { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("passengers")] + [JsonConverter(typeof(ParseStringConverter))] + public long Passengers { get; set; } + + [JsonProperty("films")] + public Uri[] Films { get; set; } + + [JsonProperty("pilots")] + public object[] Pilots { get; set; } + + [JsonProperty("starship_class")] + public string StarshipClass { get; set; } + + [JsonProperty("url")] + public Uri Url { get; set; } + } +} diff --git a/Swapi/Models/Vehicle.cs b/Swapi/Models/Vehicle.cs new file mode 100644 index 0000000..5e30202 --- /dev/null +++ b/Swapi/Models/Vehicle.cs @@ -0,0 +1,62 @@ +using Newtonsoft.Json; +using Swapi.Converters; +using System; + +namespace Swapi.Models +{ + public class Vehicle + { + [JsonProperty("cargo_capacity")] + [JsonConverter(typeof(ParseStringConverter))] + public long CargoCapacity { get; set; } + + [JsonProperty("consumables")] + public string Consumables { get; set; } + + [JsonProperty("cost_in_credits")] + [JsonConverter(typeof(ParseStringConverter))] + public long CostInCredits { get; set; } + + [JsonProperty("created")] + public DateTimeOffset Created { get; set; } + + [JsonProperty("crew")] + [JsonConverter(typeof(ParseStringConverter))] + public long Crew { get; set; } + + [JsonProperty("edited")] + public DateTimeOffset Edited { get; set; } + + [JsonProperty("length")] + public string Length { get; set; } + + [JsonProperty("manufacturer")] + public string Manufacturer { get; set; } + + [JsonProperty("max_atmosphering_speed")] + [JsonConverter(typeof(ParseStringConverter))] + public long MaxAtmospheringSpeed { get; set; } + + [JsonProperty("model")] + public string Model { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("passengers")] + [JsonConverter(typeof(ParseStringConverter))] + public long Passengers { get; set; } + + [JsonProperty("pilots")] + public object[] Pilots { get; set; } + + [JsonProperty("films")] + public Uri[] Films { get; set; } + + [JsonProperty("url")] + public Uri Url { get; set; } + + [JsonProperty("vehicle_class")] + public string VehicleClass { get; set; } + } +}