WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 87461f8

Browse files
Merge pull request #59 from Brixel/feature/api-compatibility-is-no-longer-0x
feat!: api_compatibility is no longer 0.x
2 parents 2b0cea6 + 3536353 commit 87461f8

File tree

3 files changed

+116
-120
lines changed

3 files changed

+116
-120
lines changed

BrixelAPI.SpaceAPI/Domain/SpaceStateAggregate/SpaceState.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System.Collections.Generic;
2+
using Schema;
3+
using Schema.v14;
24

35

46
namespace BrixelAPI.SpaceState.Domain.SpaceStateAggregate;
@@ -18,7 +20,6 @@ public static SpaceState GetConfiguredSpaceAPI()
1820
{
1921
return new SpaceState()
2022
{
21-
ApiCompatibility = ["0.14"],
2223
Space = "Brixel",
2324
Logo = "https://www.brixel.be/wp-content/uploads/2015/09/Logo_small_transparant.png",
2425
Url = "http://brixel.be",

BrixelAPI.SpaceAPI/Features/GetFullStatus/GetFullStatusResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System.Linq;
2+
using Schema.v14;
23

34
namespace BrixelAPI.SpaceState.Features.GetFullStatus
45
{
56
public class GetFullStatusResponse : SpaceApi
67
{
78
public GetFullStatusResponse(Domain.SpaceStateAggregate.SpaceState spaceState)
89
{
9-
ApiCompatibility = spaceState.ApiCompatibility;
1010
Space = spaceState.Space;
1111
Logo = spaceState.Logo;
1212
Url = spaceState.Url;
Lines changed: 113 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,125 @@
1-
// <auto-generated />
2-
//
3-
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
4-
//
5-
// using SpaceApi;
6-
//
7-
// var coordinate = Coordinate.FromJson(jsonString);
1+
using System;
82

9-
using System;
10-
using System.Collections.Generic;
113

124
using System.Text.Json;
135
using System.Text.Json.Serialization;
146
using System.Globalization;
157

16-
/// <summary>
17-
/// SpaceAPI v14
18-
/// </summary>
19-
public partial class SpaceApi
8+
namespace Schema.v14
209
{
2110
/// <summary>
22-
/// The versions your SpaceAPI endpoint supports
23-
/// </summary>
24-
[JsonPropertyName("api_compatibility")]
25-
public string[] ApiCompatibility { get; set; }
26-
27-
/// <summary>
28-
/// URL(s) of webcams in your space
29-
/// </summary>
30-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
31-
[JsonPropertyName("cam")]
32-
public string[] Cam { get; set; }
33-
34-
/// <summary>
35-
/// Contact information about your space
36-
/// </summary>
37-
[JsonPropertyName("contact")]
38-
public Contact Contact { get; set; }
39-
40-
/// <summary>
41-
/// Events which happened recently in your space and which could be interesting to the
42-
/// public, like 'User X has entered/triggered/did something at timestamp Z'
43-
/// </summary>
44-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
45-
[JsonPropertyName("events")]
46-
public Event[] Events { get; set; }
47-
48-
/// <summary>
49-
/// Feeds where users can get updates of your space
50-
/// </summary>
51-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
52-
[JsonPropertyName("feeds")]
53-
public Feeds Feeds { get; set; }
54-
55-
/// <summary>
56-
/// Arbitrary links that you'd like to share
57-
/// </summary>
58-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
59-
[JsonPropertyName("links")]
60-
public Link[] Links { get; set; }
61-
62-
/// <summary>
63-
/// Position data such as a postal address or geographic coordinates
64-
/// </summary>
65-
[JsonPropertyName("location")]
66-
public Location Location { get; set; }
67-
68-
/// <summary>
69-
/// URL to your space logo
70-
/// </summary>
71-
[JsonPropertyName("logo")]
72-
public string Logo { get; set; }
73-
74-
/// <summary>
75-
/// A list of the different membership plans your hackerspace might have. Set the value
76-
/// according to your billing process. For example, if your membership fee is 10€ per month,
77-
/// but you bill it yearly (aka. the member pays the fee once per year), set the amount to
78-
/// 120 an the billing_interval to yearly.
79-
/// </summary>
80-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
81-
[JsonPropertyName("membership_plans")]
82-
public MembershipPlan[] MembershipPlans { get; set; }
83-
84-
/// <summary>
85-
/// Your project sites (links to GitHub, wikis or wherever your projects are hosted)
11+
/// SpaceAPI v14
8612
/// </summary>
87-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
88-
[JsonPropertyName("projects")]
89-
public string[] Projects { get; set; }
90-
91-
/// <summary>
92-
/// Data of various sensors in your space (e.g. temperature, humidity, amount of Club-Mate
93-
/// left, …). The only canonical property is the <em>temp</em> property, additional sensor
94-
/// types may be defined by you. In this case, you are requested to share your definition for
95-
/// inclusion in this specification.
96-
/// </summary>
97-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
98-
[JsonPropertyName("sensors")]
99-
public Sensors Sensors { get; set; }
100-
101-
/// <summary>
102-
/// The name of your space
103-
/// </summary>
104-
[JsonPropertyName("space")]
105-
public string Space { get; set; }
106-
107-
/// <summary>
108-
/// A flag indicating if the hackerspace uses SpaceFED, a federated login scheme so that
109-
/// visiting hackers can use the space WiFi with their home space credentials.
110-
/// </summary>
111-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
112-
[JsonPropertyName("spacefed")]
113-
public Spacefed Spacefed { get; set; }
114-
115-
/// <summary>
116-
/// A collection of status-related data: actual open/closed status, icons, last change
117-
/// timestamp etc.
118-
/// </summary>
119-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
120-
[JsonPropertyName("state")]
121-
public State State { get; set; }
122-
123-
/// <summary>
124-
/// URL to your space website
125-
/// </summary>
126-
[JsonPropertyName("url")]
127-
public string Url { get; set; }
13+
public class SpaceApi
14+
{
15+
/// <summary>
16+
/// The versions your SpaceAPI endpoint supports
17+
/// </summary>
18+
[JsonPropertyName("api_compatibility")]
19+
public string[] ApiCompatibility => ["14"];
20+
21+
/// <summary>
22+
/// URL(s) of webcams in your space
23+
/// </summary>
24+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
25+
[JsonPropertyName("cam")]
26+
public string[] Cam { get; set; }
27+
28+
/// <summary>
29+
/// Contact information about your space
30+
/// </summary>
31+
[JsonPropertyName("contact")]
32+
public Contact Contact { get; set; }
33+
34+
/// <summary>
35+
/// Events which happened recently in your space and which could be interesting to the
36+
/// public, like 'User X has entered/triggered/did something at timestamp Z'
37+
/// </summary>
38+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
39+
[JsonPropertyName("events")]
40+
public Event[] Events { get; set; }
41+
42+
/// <summary>
43+
/// Feeds where users can get updates of your space
44+
/// </summary>
45+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
46+
[JsonPropertyName("feeds")]
47+
public Feeds Feeds { get; set; }
48+
49+
/// <summary>
50+
/// Arbitrary links that you'd like to share
51+
/// </summary>
52+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
53+
[JsonPropertyName("links")]
54+
public Link[] Links { get; set; }
55+
56+
/// <summary>
57+
/// Position data such as a postal address or geographic coordinates
58+
/// </summary>
59+
[JsonPropertyName("location")]
60+
public Location Location { get; set; }
61+
62+
/// <summary>
63+
/// URL to your space logo
64+
/// </summary>
65+
[JsonPropertyName("logo")]
66+
public string Logo { get; set; }
67+
68+
/// <summary>
69+
/// A list of the different membership plans your hackerspace might have. Set the value
70+
/// according to your billing process. For example, if your membership fee is 10€ per month,
71+
/// but you bill it yearly (aka. the member pays the fee once per year), set the amount to
72+
/// 120 an the billing_interval to yearly.
73+
/// </summary>
74+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
75+
[JsonPropertyName("membership_plans")]
76+
public MembershipPlan[] MembershipPlans { get; set; }
77+
78+
/// <summary>
79+
/// Your project sites (links to GitHub, wikis or wherever your projects are hosted)
80+
/// </summary>
81+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
82+
[JsonPropertyName("projects")]
83+
public string[] Projects { get; set; }
84+
85+
/// <summary>
86+
/// Data of various sensors in your space (e.g. temperature, humidity, amount of Club-Mate
87+
/// left, …). The only canonical property is the <em>temp</em> property, additional sensor
88+
/// types may be defined by you. In this case, you are requested to share your definition for
89+
/// inclusion in this specification.
90+
/// </summary>
91+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
92+
[JsonPropertyName("sensors")]
93+
public Sensors Sensors { get; set; }
94+
95+
/// <summary>
96+
/// The name of your space
97+
/// </summary>
98+
[JsonPropertyName("space")]
99+
public string Space { get; set; }
100+
101+
/// <summary>
102+
/// A flag indicating if the hackerspace uses SpaceFED, a federated login scheme so that
103+
/// visiting hackers can use the space WiFi with their home space credentials.
104+
/// </summary>
105+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
106+
[JsonPropertyName("spacefed")]
107+
public Spacefed Spacefed { get; set; }
108+
109+
/// <summary>
110+
/// A collection of status-related data: actual open/closed status, icons, last change
111+
/// timestamp etc.
112+
/// </summary>
113+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
114+
[JsonPropertyName("state")]
115+
public State State { get; set; }
116+
117+
/// <summary>
118+
/// URL to your space website
119+
/// </summary>
120+
[JsonPropertyName("url")]
121+
public string Url { get; set; }
122+
}
128123
}
129124

130125
/// <summary>

0 commit comments

Comments
 (0)