Skip to content

Commit

Permalink
Adding more models, fixing readme
Browse files Browse the repository at this point in the history
  • Loading branch information
felipematoz committed Jan 23, 2020
1 parent eb6f979 commit 7cd95be
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 2 deletions.
Empty file removed README
Empty file.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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...
50 changes: 50 additions & 0 deletions Swapi/Models/Film.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
59 changes: 59 additions & 0 deletions Swapi/Models/People.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
55 changes: 55 additions & 0 deletions Swapi/Models/Specie.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
66 changes: 66 additions & 0 deletions Swapi/Models/Starship.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
62 changes: 62 additions & 0 deletions Swapi/Models/Vehicle.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}

0 comments on commit 7cd95be

Please sign in to comment.