Skip to content

Commit 7f83727

Browse files
authored
Move GeoJson types to Azure.Core (Azure#21208)
1 parent 864ef54 commit 7f83727

29 files changed

+889
-238
lines changed

sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -192,163 +192,3 @@ public partial class ProtocolClientOptions : Azure.Core.ClientOptions
192192
public ProtocolClientOptions() { }
193193
}
194194
}
195-
namespace Azure.Core.GeoJson
196-
{
197-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
198-
public readonly partial struct GeoArray<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
199-
{
200-
private readonly object _dummy;
201-
private readonly int _dummyPrimitive;
202-
public int Count { get { throw null; } }
203-
public T this[int index] { get { throw null; } }
204-
public Azure.Core.GeoJson.GeoArray<T>.Enumerator GetEnumerator() { throw null; }
205-
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
206-
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
207-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
208-
public partial struct Enumerator : System.Collections.Generic.IEnumerator<T>, System.Collections.IEnumerator, System.IDisposable
209-
{
210-
private object _dummy;
211-
private int _dummyPrimitive;
212-
public T Current { get { throw null; } }
213-
object System.Collections.IEnumerator.Current { get { throw null; } }
214-
public void Dispose() { }
215-
public bool MoveNext() { throw null; }
216-
public void Reset() { }
217-
}
218-
}
219-
public sealed partial class GeoBoundingBox : System.IEquatable<Azure.Core.GeoJson.GeoBoundingBox>
220-
{
221-
public GeoBoundingBox(double west, double south, double east, double north) { }
222-
public GeoBoundingBox(double west, double south, double east, double north, double? minAltitude, double? maxAltitude) { }
223-
public double East { get { throw null; } }
224-
public double this[int index] { get { throw null; } }
225-
public double? MaxAltitude { get { throw null; } }
226-
public double? MinAltitude { get { throw null; } }
227-
public double North { get { throw null; } }
228-
public double South { get { throw null; } }
229-
public double West { get { throw null; } }
230-
public bool Equals(Azure.Core.GeoJson.GeoBoundingBox other) { throw null; }
231-
public override bool Equals(object? obj) { throw null; }
232-
public override int GetHashCode() { throw null; }
233-
public override string ToString() { throw null; }
234-
}
235-
public sealed partial class GeoCollection : Azure.Core.GeoJson.GeoObject, System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoObject>, System.Collections.Generic.IReadOnlyCollection<Azure.Core.GeoJson.GeoObject>, System.Collections.Generic.IReadOnlyList<Azure.Core.GeoJson.GeoObject>, System.Collections.IEnumerable
236-
{
237-
public GeoCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoObject> geometries) { }
238-
public GeoCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoObject> geometries, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
239-
public int Count { get { throw null; } }
240-
public Azure.Core.GeoJson.GeoObject this[int index] { get { throw null; } }
241-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
242-
public System.Collections.Generic.IEnumerator<Azure.Core.GeoJson.GeoObject> GetEnumerator() { throw null; }
243-
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
244-
}
245-
public sealed partial class GeoJsonConverter : System.Text.Json.Serialization.JsonConverter<Azure.Core.GeoJson.GeoObject>
246-
{
247-
public GeoJsonConverter() { }
248-
public override bool CanConvert(System.Type typeToConvert) { throw null; }
249-
public override Azure.Core.GeoJson.GeoObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; }
250-
public override void Write(System.Text.Json.Utf8JsonWriter writer, Azure.Core.GeoJson.GeoObject value, System.Text.Json.JsonSerializerOptions options) { }
251-
}
252-
public sealed partial class GeoLinearRing
253-
{
254-
public GeoLinearRing(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPosition> coordinates) { }
255-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition> Coordinates { get { throw null; } }
256-
}
257-
public sealed partial class GeoLineString : Azure.Core.GeoJson.GeoObject
258-
{
259-
public GeoLineString(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPosition> coordinates) { }
260-
public GeoLineString(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPosition> coordinates, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
261-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition> Coordinates { get { throw null; } }
262-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
263-
}
264-
public sealed partial class GeoLineStringCollection : Azure.Core.GeoJson.GeoObject, System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoLineString>, System.Collections.Generic.IReadOnlyCollection<Azure.Core.GeoJson.GeoLineString>, System.Collections.Generic.IReadOnlyList<Azure.Core.GeoJson.GeoLineString>, System.Collections.IEnumerable
265-
{
266-
public GeoLineStringCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoLineString> lines) { }
267-
public GeoLineStringCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoLineString> lines, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
268-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition>> Coordinates { get { throw null; } }
269-
public int Count { get { throw null; } }
270-
public Azure.Core.GeoJson.GeoLineString this[int index] { get { throw null; } }
271-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
272-
public System.Collections.Generic.IEnumerator<Azure.Core.GeoJson.GeoLineString> GetEnumerator() { throw null; }
273-
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
274-
}
275-
public abstract partial class GeoObject
276-
{
277-
internal GeoObject() { }
278-
public Azure.Core.GeoJson.GeoBoundingBox? BoundingBox { get { throw null; } }
279-
public abstract Azure.Core.GeoJson.GeoObjectType Type { get; }
280-
public static Azure.Core.GeoJson.GeoObject Parse(string json) { throw null; }
281-
public override string ToString() { throw null; }
282-
public bool TryGetCustomProperty(string name, out object? value) { throw null; }
283-
public void WriteTo(System.Text.Json.Utf8JsonWriter writer) { }
284-
}
285-
public enum GeoObjectType
286-
{
287-
Point = 0,
288-
MultiPoint = 1,
289-
Polygon = 2,
290-
MultiPolygon = 3,
291-
LineString = 4,
292-
MultiLineString = 5,
293-
GeometryCollection = 6,
294-
}
295-
public sealed partial class GeoPoint : Azure.Core.GeoJson.GeoObject
296-
{
297-
public GeoPoint(Azure.Core.GeoJson.GeoPosition position) { }
298-
public GeoPoint(Azure.Core.GeoJson.GeoPosition position, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
299-
public GeoPoint(double longitude, double latitude) { }
300-
public GeoPoint(double longitude, double latitude, double? altitude) { }
301-
public Azure.Core.GeoJson.GeoPosition Coordinates { get { throw null; } }
302-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
303-
}
304-
public sealed partial class GeoPointCollection : Azure.Core.GeoJson.GeoObject, System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPoint>, System.Collections.Generic.IReadOnlyCollection<Azure.Core.GeoJson.GeoPoint>, System.Collections.Generic.IReadOnlyList<Azure.Core.GeoJson.GeoPoint>, System.Collections.IEnumerable
305-
{
306-
public GeoPointCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPoint> points) { }
307-
public GeoPointCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPoint> points, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
308-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition> Coordinates { get { throw null; } }
309-
public int Count { get { throw null; } }
310-
public Azure.Core.GeoJson.GeoPoint this[int index] { get { throw null; } }
311-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
312-
public System.Collections.Generic.IEnumerator<Azure.Core.GeoJson.GeoPoint> GetEnumerator() { throw null; }
313-
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
314-
}
315-
public sealed partial class GeoPolygon : Azure.Core.GeoJson.GeoObject
316-
{
317-
public GeoPolygon(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoLinearRing> rings) { }
318-
public GeoPolygon(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoLinearRing> rings, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
319-
public GeoPolygon(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPosition> positions) { }
320-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition>> Coordinates { get { throw null; } }
321-
public Azure.Core.GeoJson.GeoLinearRing OuterRing { get { throw null; } }
322-
public System.Collections.Generic.IReadOnlyList<Azure.Core.GeoJson.GeoLinearRing> Rings { get { throw null; } }
323-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
324-
}
325-
public sealed partial class GeoPolygonCollection : Azure.Core.GeoJson.GeoObject, System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPolygon>, System.Collections.Generic.IReadOnlyCollection<Azure.Core.GeoJson.GeoPolygon>, System.Collections.Generic.IReadOnlyList<Azure.Core.GeoJson.GeoPolygon>, System.Collections.IEnumerable
326-
{
327-
public GeoPolygonCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPolygon> polygons) { }
328-
public GeoPolygonCollection(System.Collections.Generic.IEnumerable<Azure.Core.GeoJson.GeoPolygon> polygons, Azure.Core.GeoJson.GeoBoundingBox? boundingBox, System.Collections.Generic.IReadOnlyDictionary<string, object?> customProperties) { }
329-
public Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoArray<Azure.Core.GeoJson.GeoPosition>>> Coordinates { get { throw null; } }
330-
public int Count { get { throw null; } }
331-
public Azure.Core.GeoJson.GeoPolygon this[int index] { get { throw null; } }
332-
public override Azure.Core.GeoJson.GeoObjectType Type { get { throw null; } }
333-
public System.Collections.Generic.IEnumerator<Azure.Core.GeoJson.GeoPolygon> GetEnumerator() { throw null; }
334-
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
335-
}
336-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
337-
public readonly partial struct GeoPosition : System.IEquatable<Azure.Core.GeoJson.GeoPosition>
338-
{
339-
private readonly int _dummyPrimitive;
340-
public GeoPosition(double longitude, double latitude) { throw null; }
341-
public GeoPosition(double longitude, double latitude, double? altitude) { throw null; }
342-
public double? Altitude { get { throw null; } }
343-
public int Count { get { throw null; } }
344-
public double this[int index] { get { throw null; } }
345-
public double Latitude { get { throw null; } }
346-
public double Longitude { get { throw null; } }
347-
public bool Equals(Azure.Core.GeoJson.GeoPosition other) { throw null; }
348-
public override bool Equals(object? obj) { throw null; }
349-
public override int GetHashCode() { throw null; }
350-
public static bool operator ==(Azure.Core.GeoJson.GeoPosition left, Azure.Core.GeoJson.GeoPosition right) { throw null; }
351-
public static bool operator !=(Azure.Core.GeoJson.GeoPosition left, Azure.Core.GeoJson.GeoPosition right) { throw null; }
352-
public override string ToString() { throw null; }
353-
}
354-
}

sdk/core/Azure.Core.Experimental/src/Azure.Core.Experimental.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Azure.Core" />
13+
<ProjectReference Include="..\..\Azure.Core\src\Azure.Core.csproj" />
1414
<PackageReference Include="Microsoft.CSharp" />
1515
</ItemGroup>
1616

@@ -20,4 +20,5 @@
2020
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" />
2121
<Compile Include="$(AzureCoreSharedSources)NullableAttributes.cs" />
2222
</ItemGroup>
23+
2324
</Project>

sdk/core/Azure.Core.Experimental/src/GeoJson/GeoObjectType.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

sdk/core/Azure.Core.Experimental/tests/JsonDataDynamicMutableTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Collections.Generic;
55
using System.Text.Json;
6-
using Azure.Core.GeoJson;
6+
using Azure.GeoJson;
77
using NUnit.Framework;
88

99
namespace Azure.Core.Tests

sdk/core/Azure.Core/CHANGELOG.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
## 1.15.0-beta.1 (Unreleased)
44

5+
### Features Added
6+
7+
- Types to represent `GeoJson` primitives.
58

69
## 1.14.0 (2021-05-11)
710

8-
### Added
11+
### Features Added
912

1013
- Added additional methods to `BearerTokenAuthenticationPolicy`, which enables creation of authentication policies that can handle challenges.
1114

@@ -18,13 +21,13 @@
1821

1922
## 1.12.0 (2021-04-06)
2023

21-
### Added
24+
### Features Added
2225

2326
- Added `HttpPipeline.CreateHttpMessagePropertiesScope` that can be used to inject scoped properties into `HttpMessage`.
2427

2528
## 1.11.0 (2021-03-22)
2629

27-
### Added
30+
### Features Added
2831

2932
- `Operation` base class for operations that do not return a value.
3033
- Added `Content` property to `Response` which returns the body of the response as a `BinaryData` if the body is buffered.
@@ -38,13 +41,13 @@
3841

3942
## 1.10.0 (2021-03-09)
4043

41-
## Added
44+
## Features Added
4245

4346
- Added `CloudEvent` type based on the [CloudEvent spec](https://github.com/cloudevents/spec/blob/master/spec.md).
4447

4548
## 1.9.0 (2021-02-09)
4649

47-
## Added
50+
## Features Added
4851
- Added Serialize overloads on `ObjectSerializer` that serialize to `BinaryData`.
4952
- Added AzureCoreExtensions containing extensions methods for `BinaryData` that allow deserializing with an `ObjectSerializer`.
5053

@@ -61,7 +64,7 @@
6164

6265
## 1.8.0 (2021-01-06)
6366

64-
### Added
67+
### Features Added
6568
- `AzureSasCredential` and its respective policy.
6669

6770
### Key Bug Fixes
@@ -78,11 +81,11 @@
7881

7982
## 1.6.0 (2020-10-28)
8083

81-
### Added
84+
### Features Added
8285
- The `HttpClientTransport(HttpMessageHandler)` constructor overload.
8386
- The `JsonPatchDocument` type.
8487

85-
### Fixed
88+
### Key Bugs Fixed
8689
- The race condition in `AzureEventSourceListener` class that sometimes resulted in a `NullReferenceException` in the `EventSource`.
8790
- The overflow exception when content length is larger than `int.MaxValue`.
8891

@@ -97,7 +100,7 @@
97100
### Changed
98101
- `ETag` now supports weak ETags and implements an overload for `ToString` that accepts a format string.
99102

100-
### Added
103+
### Features Added
101104
- HttpWebRequest-based transport implementation. Enabled by-default on .NET Framework. Can be disabled using `AZURE_CORE_DISABLE_HTTPWEBREQUESTTRANSPORT` environment variable or `Azure.Core.Pipeline.DisableHttpWebRequestTransport` AppContext switch. To use the app context switch add the following snippet to your `.csproj`:
102105

103106
```xml
@@ -110,40 +113,40 @@ When the environment variable or the switch are set the `HttpClientTransport` wo
110113

111114
## 1.4.1 (2020-08-18)
112115

113-
### Fixed
116+
### Key Bugs Fixed
114117
- Bug in TaskExtensions.EnsureCompleted method that causes it to unconditionally throw an exception in the environments with synchronization context
115118

116119
## 1.4.0 (2020-08-06)
117120

118-
### Added
121+
### Features Added
119122
- Added `ObjectSerializer` base class for serialization.
120123
- Added `IMemberNameConverter` for converting member names to serialized property names.
121124
- Added `JsonObjectSerializer` that implements `ObjectSerializer` for `System.Text.Json`.
122125

123-
### Fixed
126+
### Key Bugs Fixed
124127
- Connection leak for retried non-buffered requests on .NET Framework.
125128

126129
## 1.3.0 (2020-07-02)
127130

128-
### Added
131+
### Features Added
129132
- `HttpPipeline.CreateClientRequestIdScope` method to allow setting client request id on outgoing requests.
130133

131134
## 1.2.2 (2020-06-04)
132135

133-
### Bugfix
136+
### Key Bugs Fixed
134137
- Retry server timeouts on .NET Framework.
135138

136139
## 1.2.1 (2020-04-30)
137140

138141
### Changed
139142
- Read client request ID value used for logging and tracing off the initial request object if available.
140143

141-
### Bugfix
144+
### Key Bugs Fixed
142145
- Fixed a bug when using Azure.Core based libraries in Blazor WebAssembly apps.
143146

144147
## 1.2.0 (2020-04-03)
145148

146-
### Added
149+
### Features Added
147150
- `AzureKeyCredential` and its respective policy.
148151

149152
### Changed

0 commit comments

Comments
 (0)