Move Response to its own file and Internal namespace

A class named "Response" could conflict with a lot of things.
This commit is contained in:
Haacked
2015-01-01 20:40:10 -08:00
parent 4c8bab20eb
commit be9f446df4
15 changed files with 37 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Internal;
using Octokit.Tests.Helpers;
using Xunit;

View File

@@ -2,6 +2,7 @@
using System.Net;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Internal;
using Xunit;
namespace Octokit.Tests.Clients

View File

@@ -4,6 +4,7 @@ using System.Globalization;
using System.IO;
using System.Net;
using System.Runtime.Serialization.Formatters.Binary;
using Octokit.Internal;
using Xunit;
namespace Octokit.Tests.Exceptions

View File

@@ -101,6 +101,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{01687D54-1D87-4562-A721-C57F1C94052C} = {CEC9D451-6291-4EDF-971A-D398144FBF96}
{B84274D7-BE51-4613-8DB1-58E7C0EC45A8} = {397C742D-291E-46BD-99A5-57BB6902FA7B}
EndGlobalSection
EndGlobal

View File

@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{

View File

@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{

View File

@@ -2,6 +2,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{

View File

@@ -25,20 +25,4 @@ namespace Octokit
HttpStatusCode StatusCode { get; set; }
string ContentType { get; set; }
}
public class Response : IResponse
{
public Response()
{
Headers = new Dictionary<string, string>();
}
public object BodyAsObject { get; set; }
public string Body { get; set; }
public Dictionary<string, string> Headers { get; private set; }
public Uri ResponseUri { get; set; }
public ApiInfo ApiInfo { get; set; }
public HttpStatusCode StatusCode { get; set; }
public string ContentType { get; set; }
}
}

22
Octokit/Http/Response.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Net;
namespace Octokit.Internal
{
public class Response : IResponse
{
public Response()
{
Headers = new Dictionary<string, string>();
}
public object BodyAsObject { get; set; }
public string Body { get; set; }
public Dictionary<string, string> Headers { get; private set; }
public Uri ResponseUri { get; set; }
public ApiInfo ApiInfo { get; set; }
public HttpStatusCode StatusCode { get; set; }
public string ContentType { get; set; }
}
}

View File

@@ -358,6 +358,7 @@
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Models\Response\SearchResult.cs" />
<Compile Include="Http\Response.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -370,6 +370,7 @@
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Models\Response\SearchResult.cs" />
<Compile Include="Http\Response.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
</Project>

View File

@@ -365,6 +365,7 @@
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Models\Response\SearchResult.cs" />
<Compile Include="Http\Response.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

View File

@@ -356,6 +356,7 @@
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Models\Response\SearchResult.cs" />
<Compile Include="Http\Response.cs" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">

View File

@@ -360,6 +360,7 @@
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Models\Response\SearchResult.cs" />
<Compile Include="Http\Response.cs" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">

View File

@@ -80,6 +80,7 @@
<Compile Include="Http\ProductHeaderValue.cs" />
<Compile Include="Models\Request\Signature.cs" />
<Compile Include="Models\Request\CreateFileRequest.cs" />
<Compile Include="Http\Response.cs" />
<Compile Include="Models\Request\MarkAsReadRequest.cs" />
<Compile Include="Models\Request\NewDeployKey.cs" />
<Compile Include="Models\Request\NewRelease.cs" />