-
Notifications
You must be signed in to change notification settings - Fork 16
/
WeatherApiResponse.cs
130 lines (121 loc) · 10.2 KB
/
WeatherApiResponse.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace openmeteo_sdk
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct WeatherApiResponse : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static WeatherApiResponse GetRootAsWeatherApiResponse(ByteBuffer _bb) { return GetRootAsWeatherApiResponse(_bb, new WeatherApiResponse()); }
public static WeatherApiResponse GetRootAsWeatherApiResponse(ByteBuffer _bb, WeatherApiResponse obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool VerifyWeatherApiResponse(ByteBuffer _bb) {Google.FlatBuffers.Verifier verifier = new Google.FlatBuffers.Verifier(_bb); return verifier.VerifyBuffer("", false, WeatherApiResponseVerify.Verify); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public WeatherApiResponse __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public float Latitude { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public float Longitude { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public float Elevation { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public float GenerationTimeMilliseconds { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public long LocationId { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public openmeteo_sdk.Model Model { get { int o = __p.__offset(14); return o != 0 ? (openmeteo_sdk.Model)__p.bb.Get(o + __p.bb_pos) : openmeteo_sdk.Model.undefined; } }
public int UtcOffsetSeconds { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public string Timezone { get { int o = __p.__offset(18); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span<byte> GetTimezoneBytes() { return __p.__vector_as_span<byte>(18, 1); }
#else
public ArraySegment<byte>? GetTimezoneBytes() { return __p.__vector_as_arraysegment(18); }
#endif
public byte[] GetTimezoneArray() { return __p.__vector_as_array<byte>(18); }
public string TimezoneAbbreviation { get { int o = __p.__offset(20); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span<byte> GetTimezoneAbbreviationBytes() { return __p.__vector_as_span<byte>(20, 1); }
#else
public ArraySegment<byte>? GetTimezoneAbbreviationBytes() { return __p.__vector_as_arraysegment(20); }
#endif
public byte[] GetTimezoneAbbreviationArray() { return __p.__vector_as_array<byte>(20); }
public openmeteo_sdk.VariablesWithTime? Current { get { int o = __p.__offset(22); return o != 0 ? (openmeteo_sdk.VariablesWithTime?)(new openmeteo_sdk.VariablesWithTime()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public openmeteo_sdk.VariablesWithTime? Daily { get { int o = __p.__offset(24); return o != 0 ? (openmeteo_sdk.VariablesWithTime?)(new openmeteo_sdk.VariablesWithTime()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public openmeteo_sdk.VariablesWithTime? Hourly { get { int o = __p.__offset(26); return o != 0 ? (openmeteo_sdk.VariablesWithTime?)(new openmeteo_sdk.VariablesWithTime()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public openmeteo_sdk.VariablesWithTime? Minutely15 { get { int o = __p.__offset(28); return o != 0 ? (openmeteo_sdk.VariablesWithTime?)(new openmeteo_sdk.VariablesWithTime()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public openmeteo_sdk.VariablesWithTime? SixHourly { get { int o = __p.__offset(30); return o != 0 ? (openmeteo_sdk.VariablesWithTime?)(new openmeteo_sdk.VariablesWithTime()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public static Offset<openmeteo_sdk.WeatherApiResponse> CreateWeatherApiResponse(FlatBufferBuilder builder,
float latitude = 0.0f,
float longitude = 0.0f,
float elevation = 0.0f,
float generation_time_milliseconds = 0.0f,
long location_id = 0,
openmeteo_sdk.Model model = openmeteo_sdk.Model.undefined,
int utc_offset_seconds = 0,
StringOffset timezoneOffset = default(StringOffset),
StringOffset timezone_abbreviationOffset = default(StringOffset),
Offset<openmeteo_sdk.VariablesWithTime> currentOffset = default(Offset<openmeteo_sdk.VariablesWithTime>),
Offset<openmeteo_sdk.VariablesWithTime> dailyOffset = default(Offset<openmeteo_sdk.VariablesWithTime>),
Offset<openmeteo_sdk.VariablesWithTime> hourlyOffset = default(Offset<openmeteo_sdk.VariablesWithTime>),
Offset<openmeteo_sdk.VariablesWithTime> minutely_15Offset = default(Offset<openmeteo_sdk.VariablesWithTime>),
Offset<openmeteo_sdk.VariablesWithTime> six_hourlyOffset = default(Offset<openmeteo_sdk.VariablesWithTime>)) {
builder.StartTable(14);
WeatherApiResponse.AddLocationId(builder, location_id);
WeatherApiResponse.AddSixHourly(builder, six_hourlyOffset);
WeatherApiResponse.AddMinutely15(builder, minutely_15Offset);
WeatherApiResponse.AddHourly(builder, hourlyOffset);
WeatherApiResponse.AddDaily(builder, dailyOffset);
WeatherApiResponse.AddCurrent(builder, currentOffset);
WeatherApiResponse.AddTimezoneAbbreviation(builder, timezone_abbreviationOffset);
WeatherApiResponse.AddTimezone(builder, timezoneOffset);
WeatherApiResponse.AddUtcOffsetSeconds(builder, utc_offset_seconds);
WeatherApiResponse.AddGenerationTimeMilliseconds(builder, generation_time_milliseconds);
WeatherApiResponse.AddElevation(builder, elevation);
WeatherApiResponse.AddLongitude(builder, longitude);
WeatherApiResponse.AddLatitude(builder, latitude);
WeatherApiResponse.AddModel(builder, model);
return WeatherApiResponse.EndWeatherApiResponse(builder);
}
public static void StartWeatherApiResponse(FlatBufferBuilder builder) { builder.StartTable(14); }
public static void AddLatitude(FlatBufferBuilder builder, float latitude) { builder.AddFloat(0, latitude, 0.0f); }
public static void AddLongitude(FlatBufferBuilder builder, float longitude) { builder.AddFloat(1, longitude, 0.0f); }
public static void AddElevation(FlatBufferBuilder builder, float elevation) { builder.AddFloat(2, elevation, 0.0f); }
public static void AddGenerationTimeMilliseconds(FlatBufferBuilder builder, float generationTimeMilliseconds) { builder.AddFloat(3, generationTimeMilliseconds, 0.0f); }
public static void AddLocationId(FlatBufferBuilder builder, long locationId) { builder.AddLong(4, locationId, 0); }
public static void AddModel(FlatBufferBuilder builder, openmeteo_sdk.Model model) { builder.AddByte(5, (byte)model, 0); }
public static void AddUtcOffsetSeconds(FlatBufferBuilder builder, int utcOffsetSeconds) { builder.AddInt(6, utcOffsetSeconds, 0); }
public static void AddTimezone(FlatBufferBuilder builder, StringOffset timezoneOffset) { builder.AddOffset(7, timezoneOffset.Value, 0); }
public static void AddTimezoneAbbreviation(FlatBufferBuilder builder, StringOffset timezoneAbbreviationOffset) { builder.AddOffset(8, timezoneAbbreviationOffset.Value, 0); }
public static void AddCurrent(FlatBufferBuilder builder, Offset<openmeteo_sdk.VariablesWithTime> currentOffset) { builder.AddOffset(9, currentOffset.Value, 0); }
public static void AddDaily(FlatBufferBuilder builder, Offset<openmeteo_sdk.VariablesWithTime> dailyOffset) { builder.AddOffset(10, dailyOffset.Value, 0); }
public static void AddHourly(FlatBufferBuilder builder, Offset<openmeteo_sdk.VariablesWithTime> hourlyOffset) { builder.AddOffset(11, hourlyOffset.Value, 0); }
public static void AddMinutely15(FlatBufferBuilder builder, Offset<openmeteo_sdk.VariablesWithTime> minutely15Offset) { builder.AddOffset(12, minutely15Offset.Value, 0); }
public static void AddSixHourly(FlatBufferBuilder builder, Offset<openmeteo_sdk.VariablesWithTime> sixHourlyOffset) { builder.AddOffset(13, sixHourlyOffset.Value, 0); }
public static Offset<openmeteo_sdk.WeatherApiResponse> EndWeatherApiResponse(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<openmeteo_sdk.WeatherApiResponse>(o);
}
public static void FinishWeatherApiResponseBuffer(FlatBufferBuilder builder, Offset<openmeteo_sdk.WeatherApiResponse> offset) { builder.Finish(offset.Value); }
public static void FinishSizePrefixedWeatherApiResponseBuffer(FlatBufferBuilder builder, Offset<openmeteo_sdk.WeatherApiResponse> offset) { builder.FinishSizePrefixed(offset.Value); }
}
static public class WeatherApiResponseVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*Latitude*/, 4 /*float*/, 4, false)
&& verifier.VerifyField(tablePos, 6 /*Longitude*/, 4 /*float*/, 4, false)
&& verifier.VerifyField(tablePos, 8 /*Elevation*/, 4 /*float*/, 4, false)
&& verifier.VerifyField(tablePos, 10 /*GenerationTimeMilliseconds*/, 4 /*float*/, 4, false)
&& verifier.VerifyField(tablePos, 12 /*LocationId*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 14 /*Model*/, 1 /*openmeteo_sdk.Model*/, 1, false)
&& verifier.VerifyField(tablePos, 16 /*UtcOffsetSeconds*/, 4 /*int*/, 4, false)
&& verifier.VerifyString(tablePos, 18 /*Timezone*/, false)
&& verifier.VerifyString(tablePos, 20 /*TimezoneAbbreviation*/, false)
&& verifier.VerifyTable(tablePos, 22 /*Current*/, openmeteo_sdk.VariablesWithTimeVerify.Verify, false)
&& verifier.VerifyTable(tablePos, 24 /*Daily*/, openmeteo_sdk.VariablesWithTimeVerify.Verify, false)
&& verifier.VerifyTable(tablePos, 26 /*Hourly*/, openmeteo_sdk.VariablesWithTimeVerify.Verify, false)
&& verifier.VerifyTable(tablePos, 28 /*Minutely15*/, openmeteo_sdk.VariablesWithTimeVerify.Verify, false)
&& verifier.VerifyTable(tablePos, 30 /*SixHourly*/, openmeteo_sdk.VariablesWithTimeVerify.Verify, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}