Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
davetimmins committed Sep 27, 2020
1 parent 522b86b commit 6a2b330
Show file tree
Hide file tree
Showing 35 changed files with 110 additions and 110 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solution = "./Anywhere.ArcGIS.sln";

var version = "1.12.0";
var version = "2.0.0";
var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX");

//////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 3 additions & 2 deletions src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Dave Timmins</Authors>
<Company>Dave Timmins</Company>
Expand All @@ -15,7 +15,7 @@
<RepositoryUrl>https://github.com/davetimmins/Anywhere.ArcGIS</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>ArcGIS ArcGISServer ArcGISOnline Esri REST netstandard anywhere GIS Mapping Map Location GeoLocation OAuth</PackageTags>
<Version>1.12.0</Version>
<Version>2.0.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

Expand All @@ -33,6 +33,7 @@

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.3" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.3" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.3" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/AttachmentWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected async Task<T> Post<T, TRequest>(TRequest requestObject, CancellationTo
throw new InvalidOperationException(result.Error.ToString());
}

requestObject.AfterRequest?.Invoke();
requestObject.AfterRequest?.Invoke(resultString);

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/Common/IHttpOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public interface IHttpOperation

Action BeforeRequest { get; }

Action AfterRequest { get; }
Action<string> AfterRequest { get; }
}
}
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/Operation/Admin/PublicKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Anywhere.ArcGIS.Operation.Admin
[DataContract]
public class PublicKey : ArcGISServerOperation
{
public PublicKey(Action beforeRequest = null, Action afterRequest = null)
public PublicKey(Action beforeRequest = null, Action<string> afterRequest = null)
: base(new ArcGISServerAdminEndpoint(Operations.PublicKey), beforeRequest, afterRequest)
{ }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/Operation/Admin/ServiceReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public IEnumerable<ServiceReportResponse> ServiceReports

public class ServiceReport : ArcGISServerOperation
{
public ServiceReport(string path, Action beforeRequest = null, Action afterRequest = null)
public ServiceReport(string path, Action beforeRequest = null, Action<string> afterRequest = null)
: base(new ArcGISServerAdminEndpoint(string.Format(Operations.ServiceReport, path.Replace("/", "")).Replace("//", "/")), beforeRequest, afterRequest)
{ }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/Operation/Admin/ServiceStatistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Anywhere.ArcGIS.Operation.Admin
[DataContract]
public class ServiceStatistics : ArcGISServerOperation
{
public ServiceStatistics(ServiceDescription serviceDescription, Action beforeRequest = null, Action afterRequest = null)
public ServiceStatistics(ServiceDescription serviceDescription, Action beforeRequest = null, Action<string> afterRequest = null)
: base(new ArcGISServerAdminEndpoint(string.Format(Operations.ServiceStatistics, serviceDescription.Name, serviceDescription.Type)), beforeRequest, afterRequest)
{ }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Anywhere.ArcGIS/Operation/Admin/ServiceStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Anywhere.ArcGIS.Operation.Admin
[DataContract]
public class ServiceStatus : ArcGISServerOperation
{
public ServiceStatus(ServiceDescription serviceDescription, Action beforeRequest = null, Action afterRequest = null)
public ServiceStatus(ServiceDescription serviceDescription, Action beforeRequest = null, Action<string> afterRequest = null)
: base (new ArcGISServerAdminEndpoint(string.Format(Operations.ServiceStatus, serviceDescription.Name, serviceDescription.Type)), beforeRequest, afterRequest)
{ }
}
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/Admin/StartStop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace Anywhere.ArcGIS.Operation.Admin
[DataContract]
public class StartService : ArcGISServerOperation
{
public StartService(ServiceDescription serviceDescription, Action beforeRequest = null, Action afterRequest = null)
public StartService(ServiceDescription serviceDescription, Action beforeRequest = null, Action<string> afterRequest = null)
: base(new ArcGISServerAdminEndpoint(string.Format(Operations.StartService, serviceDescription.Name, serviceDescription.Type)), beforeRequest, afterRequest)
{ }
}

[DataContract]
public class StopService : ArcGISServerOperation
{
public StopService(ServiceDescription serviceDescription, Action beforeRequest = null, Action afterRequest = null)
public StopService(ServiceDescription serviceDescription, Action beforeRequest = null, Action<string> afterRequest = null)
: base(new ArcGISServerAdminEndpoint(string.Format(Operations.StopService, serviceDescription.Name, serviceDescription.Type)), beforeRequest, afterRequest)
{ }
}
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/ApplyEdits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ namespace Anywhere.ArcGIS.Operation
public class ApplyEdits<T> : ArcGISServerOperation
where T : IGeometry
{
public ApplyEdits(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public ApplyEdits(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public ApplyEdits(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public ApplyEdits(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.ApplyEdits, beforeRequest, afterRequest)
{
Adds = new List<Feature<T>>();
Expand Down
6 changes: 3 additions & 3 deletions src/Anywhere.ArcGIS/Operation/ArcGISServerOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ namespace Anywhere.ArcGIS.Operation
/// </summary>
public class ArcGISServerOperation : CommonParameters, IHttpOperation
{
public ArcGISServerOperation(IEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public ArcGISServerOperation(IEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
{
Endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
BeforeRequest = beforeRequest;
AfterRequest = afterRequest;
}

public ArcGISServerOperation(string endpoint, Action beforeRequest = null, Action afterRequest = null)
public ArcGISServerOperation(string endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: this(new ArcGISServerEndpoint(endpoint), beforeRequest, afterRequest)
{ }

[IgnoreDataMember]
public Action BeforeRequest { get; }

[IgnoreDataMember]
public Action AfterRequest { get; }
public Action<string> AfterRequest { get; }

[IgnoreDataMember]
public IEndpoint Endpoint { get; }
Expand Down
8 changes: 4 additions & 4 deletions src/Anywhere.ArcGIS/Operation/CreateReplica.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
[DataContract]
public class CreateReplica : ArcGISServerOperation
{
public CreateReplica(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public CreateReplica(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public CreateReplica(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public CreateReplica(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.CreateReplica, beforeRequest, afterRequest)
{
ReturnAttachments = false;
Expand Down Expand Up @@ -227,11 +227,11 @@ public LayerQuery()
[DataContract]
public class UnregisterReplica : ArcGISServerOperation
{
public UnregisterReplica(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public UnregisterReplica(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public UnregisterReplica(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public UnregisterReplica(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.UnregisterReplica, beforeRequest, afterRequest)
{ }

Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/CustomGeocode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class SingleInputCustomGeocode : ArcGISServerOperation
{
public SingleInputCustomGeocode(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public SingleInputCustomGeocode(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public SingleInputCustomGeocode(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public SingleInputCustomGeocode(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.SingleInputCustomGeocode, beforeRequest, afterRequest)
{ }

Expand Down
12 changes: 6 additions & 6 deletions src/Anywhere.ArcGIS/Operation/DeleteAttachments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class DeleteAttachments : ArcGISServerOperation
{
public DeleteAttachments(string relativeUrl, long objectID, Action beforeRequest = null, Action afterRequest = null)
public DeleteAttachments(string relativeUrl, long objectID, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), objectID, beforeRequest, afterRequest)
{ }

public DeleteAttachments(ArcGISServerEndpoint endpoint, long objectID, Action beforeRequest = null, Action afterRequest = null)
public DeleteAttachments(ArcGISServerEndpoint endpoint, long objectID, Action beforeRequest = null, Action<string> afterRequest = null)
: this((endpoint.RelativeUrl.Trim('/') + string.Format("/{0}", objectID)).AsEndpoint(), beforeRequest, afterRequest)
{
AttachmentIds = new List<long>();
}

public DeleteAttachments(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public DeleteAttachments(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public DeleteAttachments(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public DeleteAttachments(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.DeleteAttachments, beforeRequest, afterRequest)
{
AttachmentIds = new List<long>();
Expand Down Expand Up @@ -85,11 +85,11 @@ public AttachmentToPost(ArcGISServerEndpoint endpoint, long objectID, byte[] att
AttachmentBase64Encoded = Convert.ToBase64String(Attachment);
}

AttachmentToPost(string relativeUrl, long objectID, string fileName, string contentType, bool isUpdate = false, Action beforeRequest = null, Action afterRequest = null)
AttachmentToPost(string relativeUrl, long objectID, string fileName, string contentType, bool isUpdate = false, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), objectID, fileName, contentType, isUpdate, beforeRequest, afterRequest)
{ }

AttachmentToPost(ArcGISServerEndpoint endpoint, long objectID, string fileName, string contentType, bool isUpdate = false, Action beforeRequest = null, Action afterRequest = null)
AttachmentToPost(ArcGISServerEndpoint endpoint, long objectID, string fileName, string contentType, bool isUpdate = false, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + string.Format("/{0}/{1}", objectID, isUpdate ? "updateAttachment" : "addAttachment"), beforeRequest, afterRequest)
{
ObjectID = objectID;
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/DeleteFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class DeleteFeatures : ArcGISServerOperation
{
public DeleteFeatures(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public DeleteFeatures(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

public DeleteFeatures(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public DeleteFeatures(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.DeleteFeatures, beforeRequest, afterRequest)
{
SpatialRelationship = SpatialRelationshipTypes.Intersects;
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/ExportMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class ExportMap : ArcGISServerOperation
{
public ExportMap(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public ExportMap(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

/// <summary>
/// Requests an export of the map resources. Returns the image link in the response
/// </summary>
/// <param name="endpoint">Resource to apply the export against</param>
public ExportMap(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public ExportMap(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.ExportMap, beforeRequest, afterRequest)
{
Size = new List<int> { 400, 400 };
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/Find.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class Find : ArcGISServerOperation
{
public Find(string relativeUrl, Action beforeRequest = null, Action afterRequest = null)
public Find(string relativeUrl, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{ }

/// <summary>
/// Represents a request for a find against a service resource
/// </summary>
/// <param name="endpoint">Resource to apply the query against</param>
public Find(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action afterRequest = null)
public Find(ArcGISServerEndpoint endpoint, Action beforeRequest = null, Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.Find, beforeRequest, afterRequest)
{
FuzzySearch = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/GeometryServerOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class GeometryOperationResponse<T> : PortalResponse
public class SimplifyGeometry<T> : ArcGISServerOperation
where T : IGeometry
{
public SimplifyGeometry(IEndpoint endpoint, List<Feature<T>> features = null, SpatialReference spatialReference = null, Action beforeRequest = null, Action afterRequest = null)
public SimplifyGeometry(IEndpoint endpoint, List<Feature<T>> features = null, SpatialReference spatialReference = null, Action beforeRequest = null, Action<string> afterRequest = null)
: base((endpoint is AbsoluteEndpoint)
? (IEndpoint)new AbsoluteEndpoint(endpoint.RelativeUrl.Trim('/') + "/" + Operations.Simplify)
: (IEndpoint)new ArcGISServerEndpoint(endpoint.RelativeUrl.Trim('/') + "/" + Operations.Simplify),
Expand Down Expand Up @@ -150,7 +150,7 @@ public GeometryOperation(IEndpoint endpoint,
List<Feature<T>> features,
SpatialReference outputSpatialReference,
string operation,
Action beforeRequest = null, Action afterRequest = null)
Action beforeRequest = null, Action<string> afterRequest = null)
: base((endpoint is AbsoluteEndpoint)
? (IEndpoint)new AbsoluteEndpoint(endpoint.RelativeUrl.Trim('/') + "/" + operation)
: (IEndpoint)new ArcGISServerEndpoint(endpoint.RelativeUrl.Trim('/') + "/" + operation),
Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/LayerFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace Anywhere.ArcGIS.Operation
[DataContract]
public class LayerFeature : ArcGISServerOperation
{
public LayerFeature(string relativeUrl, long featureId, Action beforeRequest = null, Action afterRequest = null)
public LayerFeature(string relativeUrl, long featureId, Action beforeRequest = null, Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), featureId, beforeRequest, afterRequest)
{ }

public LayerFeature(ArcGISServerEndpoint endpoint, long featureId, Action beforeRequest = null, Action afterRequest = null)
public LayerFeature(ArcGISServerEndpoint endpoint, long featureId, Action beforeRequest = null, Action<string> afterRequest = null)
: base($"{endpoint.RelativeUrl.Trim('/')}/{featureId}", beforeRequest, afterRequest)
{ }

Expand Down
4 changes: 2 additions & 2 deletions src/Anywhere.ArcGIS/Operation/LegendsDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class LegendsDescription : ArcGISServerOperation
{
public LegendsDescription(string relativeUrl,
Action beforeRequest = null,
Action afterRequest = null)
Action<string> afterRequest = null)
: this(relativeUrl.AsEndpoint(), beforeRequest, afterRequest)
{
}
Expand All @@ -26,7 +26,7 @@ public LegendsDescription(string relativeUrl,
/// <param name="endpoint">Resource to apply the export against</param>
public LegendsDescription(IEndpoint endpoint,
Action beforeRequest = null,
Action afterRequest = null)
Action<string> afterRequest = null)
: base(endpoint.RelativeUrl.Trim('/') + "/" + Operations.Legend, beforeRequest, afterRequest)
{
}
Expand Down
Loading

0 comments on commit 6a2b330

Please sign in to comment.