-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
LocationMetadata.cs
53 lines (44 loc) · 1.88 KB
/
LocationMetadata.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#nullable disable
using System.Runtime.CompilerServices;
using System.Text.Json;
using Azure.Core;
namespace Azure.ResourceManager.Resources.Models
{
[CodeGenSerialization(nameof(Longitude), SerializationValueHook = nameof(WriteLongitude), DeserializationValueHook = nameof(ReadLongitude))]
[CodeGenSerialization(nameof(Latitude), SerializationValueHook = nameof(WriteLatitude), DeserializationValueHook = nameof(ReadLatitude))]
public partial class LocationMetadata
{
/// <summary> The longitude of the location. </summary>
public double? Longitude { get; }
/// <summary> The latitude of the location. </summary>
public double? Latitude { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void WriteLongitude(Utf8JsonWriter writer)
{
if (Longitude != null)
writer.WriteStringValue(Longitude.ToString());
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ReadLongitude(JsonProperty property, ref double? longitude)
{
if (property.Value.ValueKind == JsonValueKind.Null)
return;
longitude = double.Parse(property.Value.GetString());
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void WriteLatitude(Utf8JsonWriter writer)
{
if (Latitude != null)
writer.WriteStringValue(Latitude.ToString());
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ReadLatitude(JsonProperty property, ref double? latitude)
{
if (property.Value.ValueKind == JsonValueKind.Null)
return;
latitude = double.Parse(property.Value.GetString());
}
}
}