Remove IHttpClient examples + rerun tests to generate files

This commit is contained in:
Stef Heyenrath
2024-04-23 10:59:26 +02:00
parent 6b6e5d04a0
commit 4490925655
15 changed files with 40 additions and 403 deletions
@@ -33,10 +33,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerForAk
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerViaNuGet", "src-examples\ProxyInterfaceConsumerViaNuGet\ProxyInterfaceConsumerViaNuGet.csproj", "{1EA000E4-6103-4577-8D98-BDDA3BE458A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IHttpClient", "src\IHttpClient\IHttpClient.csproj", "{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAppIHttpClient", "src-examples\ConsoleAppIHttpClient\ConsoleAppIHttpClient.csproj", "{3E93C092-0E42-4200-B71A-5EEE410FE1F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -79,18 +75,6 @@ Global
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.DebugAttach|Any CPU.Build.0 = Debug|Any CPU
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Release|Any CPU.Build.0 = Release|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.DebugAttach|Any CPU.ActiveCfg = Debug|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.DebugAttach|Any CPU.Build.0 = Debug|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}.Release|Any CPU.Build.0 = Release|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.DebugAttach|Any CPU.ActiveCfg = Debug|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.DebugAttach|Any CPU.Build.0 = Debug|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E93C092-0E42-4200-B71A-5EEE410FE1F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -102,8 +86,6 @@ Global
{5F7DA2C5-B908-4B57-9F5F-BADF1216D89C} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
{590908DF-A813-467A-94E4-3500020D0D54} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
{1EA000E4-6103-4577-8D98-BDDA3BE458A2} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3} = {ED3DA9DD-1E07-444B-A2D7-2DBA280F96D4}
{3E93C092-0E42-4200-B71A-5EEE410FE1F5} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {585F071D-051D-441C-9C6B-226D9E15A1F5}
@@ -1,13 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IHttpClient" Version="0.0.1" />
</ItemGroup>
</Project>
@@ -1,13 +0,0 @@
using System.Net.Http;
using System.Net.Http.Json;
var httpClient = new HttpClient();
var httpClientProxy = new HttpClientProxy(httpClient);
var result = await httpClientProxy.GetAsync("https://www.google.nl");
var todo = await httpClientProxy.GetFromJsonAsync<Todo>("https://jsonplaceholder.typicode.com/todos/1");
var postResult = await httpClientProxy.PostAsJsonAsync("https://jsonplaceholder.typicode.com/todos", new Todo { Id = 123 });
var patchResult = await httpClientProxy.PatchAsJsonAsync("https://jsonplaceholder.typicode.com/todos/1", new Todo { Id = 400 });
var putResult = await httpClientProxy.PutAsJsonAsync("https://jsonplaceholder.typicode.com/todos/1", new Todo { Id = 444 });
int x = 0;
@@ -1,4 +0,0 @@
public class Todo
{
public int Id { get; set; }
}
-7
View File
@@ -1,7 +0,0 @@
// ReSharper disable once CheckNamespace
namespace System.Net.Http;
[ProxyInterfaceGenerator.Proxy(typeof(HttpClient), true)]
public partial interface IHttpClient : IHttpMessageInvoker
{
}
-58
View File
@@ -1,58 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>0.0.1</Version>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<ProjectGuid>{38C2BB6E-EE23-4C4F-B8D5-A2AD592DE5E3}</ProjectGuid>
<Authors>Stef Heyenrath</Authors>
<Description></Description>
<Title>IHttpClient</Title>
<PackageId>IHttpClient</PackageId>
<Description>This project uses source generation to generate an IHttpClient interface and HttpClientProxy from the HttpClient to make it injectable and unit-testable.</Description>
<PackageTags>HttpClient;interface;IHttpClient;Proxy;HttpClientProxy</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!--<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../../PackageReleaseNotes.txt"))</PackageReleaseNotes>-->
<PackageProjectUrl>https://github.com/StefH/ProxyInterfaceSourceGenerator/src/IHttpClient</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/StefH/ProxyInterfaceSourceGenerator/src/IHttpClient</RepositoryUrl>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<PackageIcon>ihttpclient-icon.png</PackageIcon>
<!--<IncludeBuildOutput>false</IncludeBuildOutput>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>
<DevelopmentDependency>true</DevelopmentDependency>
<ImplicitUsings>enable</ImplicitUsings>
<Configurations>Debug;Release</Configurations>-->
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<None Include="../../resources/ihttpclient-icon.png" Pack="true" PackagePath="" />
<None Include="Readme.md" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="StringSyntaxPolyfill" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ProxyInterfaceGenerator" Version="0.0.37">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!--<ItemGroup>
<ProjectReference Include="..\ProxyInterfaceSourceGenerator\ProxyInterfaceSourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>-->
</Project>
@@ -1,173 +0,0 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using System.Threading;
using System.Threading.Tasks;
// ReSharper disable once CheckNamespace
namespace System.Net.Http.Json;
/// <inheritdoc cref="HttpClientJsonExtensions"/>
public static class IHttpClientJsonExtensions
{
#region PostAsJsonAsync
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PostAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PostAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PostAsJsonAsync(requestUri, value, options: null, cancellationToken);
}
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PostAsJsonAsync(requestUri, value, options: null, cancellationToken);
}
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PostAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PostAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
#endregion
#if NET7_0_OR_GREATER
#region PatchAsJsonAsync
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, cancellationToken);
}
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, cancellationToken);
}
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PatchAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
#endregion
#endif
#region PutAsJsonAsync
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PutAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
{
return client._Instance.PutAsJsonAsync(requestUri, value, options, cancellationToken);
}
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PutAsJsonAsync(requestUri, value, cancellationToken);
}
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
{
return client._Instance.PutAsJsonAsync(requestUri, value, cancellationToken);
}
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PutAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.PutAsJsonAsync(requestUri, value, jsonTypeInfo, cancellationToken);
}
#endregion
#region GetFromJsonAsync
public static Task<object?> GetFromJsonAsync(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, options, cancellationToken);
}
public static Task<object?> GetFromJsonAsync(this IHttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, options, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync<TValue>(requestUri, options, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync<TValue>(requestUri, options, cancellationToken);
}
public static Task<object?> GetFromJsonAsync(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, context, cancellationToken);
}
public static Task<object?> GetFromJsonAsync(this IHttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, context, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, jsonTypeInfo, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, jsonTypeInfo, cancellationToken);
}
public static Task<object?> GetFromJsonAsync(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, options: null, cancellationToken);
}
public static Task<object?> GetFromJsonAsync(this IHttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync(requestUri, type, options: null, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync<TValue>(requestUri, cancellationToken);
}
public static Task<TValue?> GetFromJsonAsync<TValue>(this IHttpClient client, Uri? requestUri, CancellationToken cancellationToken = default)
{
return client._Instance.GetFromJsonAsync<TValue>(requestUri, cancellationToken);
}
#endregion
}
-7
View File
@@ -1,7 +0,0 @@
// ReSharper disable once CheckNamespace
namespace System.Net.Http;
[ProxyInterfaceGenerator.Proxy(typeof(HttpMessageInvoker))]
public partial interface IHttpMessageInvoker
{
}
-16
View File
@@ -1,16 +0,0 @@
## Info
This project uses source generation to generate an `IHttpClient` interface and `HttpClientProxy` from the `HttpClient` to make it injectable and unit-testable.
All the methods and properties from the `HttpClient` are replicated to `IHttpClient`.
## Usage
``` c#
HttpClient httpClient = new HttpClient();
IHttpClient httpClientProxy = new HttpClientProxy(httpClient);
var result = await httpClientProxy.GetAsync("https://www.google.nl");
var todo = await httpClientProxy.GetFromJsonAsync<Todo>("https://jsonplaceholder.typicode.com/todos/1");
var postResult = await httpClientProxy.PostAsJsonAsync("https://jsonplaceholder.typicode.com/todos", new Todo { Id = 123 });
var patchResult = await httpClientProxy.PatchAsJsonAsync("https://jsonplaceholder.typicode.com/todos/1", new Todo { Id = 400 });
var putResult = await httpClientProxy.PutAsJsonAsync("https://jsonplaceholder.typicode.com/todos/1", new Todo { Id = 444 });
```
@@ -12,62 +12,18 @@ using System;
namespace ProxyInterfaceSourceGeneratorTests.Source.AkkaActor
{
public partial interface ILocalActorRefProvider
public partial interface ILocalActorRefProvider : global::Akka.Actor.IActorRefProvider
{
Akka.Actor.LocalActorRefProvider _Instance { get; }
Akka.Actor.IActorRef DeadLetters { get; }
Akka.Actor.IActorRef IgnoreRef { get; }
Akka.Actor.Deployer Deployer { get; }
Akka.Actor.IInternalActorRef RootGuardian { get; }
Akka.Actor.ActorPath RootPath { get; }
Akka.Actor.Settings Settings { get; }
Akka.Actor.LocalActorRef SystemGuardian { get; }
Akka.Actor.IInternalActorRef TempContainer { get; }
System.Threading.Tasks.Task TerminationTask { get; }
Akka.Actor.LocalActorRef Guardian { get; }
Akka.Event.EventStream EventStream { get; }
Akka.Actor.Address DefaultAddress { get; }
Akka.Serialization.Information SerializationInformation { get; }
Akka.Event.ILoggingAdapter Log { get; }
Akka.Actor.ActorPath TempPath();
void RegisterExtraName(string name, Akka.Actor.IInternalActorRef actor);
Akka.Actor.IActorRef RootGuardianAt(Akka.Actor.Address address);
void RegisterTempActor(Akka.Actor.IInternalActorRef actorRef, Akka.Actor.ActorPath path);
void UnregisterTempActor(Akka.Actor.ActorPath path);
Akka.Actor.FutureActorRef<T> CreateFutureRef<T>(System.Threading.Tasks.TaskCompletionSource<T> tcs);
void Init(Akka.Actor.Internal.ActorSystemImpl system);
Akka.Actor.IActorRef ResolveActorRef(string path);
Akka.Actor.IActorRef ResolveActorRef(Akka.Actor.ActorPath path);
Akka.Actor.IInternalActorRef ActorOf(Akka.Actor.Internal.ActorSystemImpl system, Akka.Actor.Props props, Akka.Actor.IInternalActorRef supervisor, Akka.Actor.ActorPath path, bool systemService, Akka.Actor.Deploy deploy, bool lookupDeploy, bool @async);
Akka.Actor.Address GetExternalAddressFor(Akka.Actor.Address address);
@@ -32,75 +32,75 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
System.Threading.Tasks.Task<string> GetStringAsync(string? requestUri);
System.Threading.Tasks.Task<string> GetStringAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri);
System.Threading.Tasks.Task<string> GetStringAsync(System.Uri? requestUri);
System.Threading.Tasks.Task<string> GetStringAsync(string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<string> GetStringAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<string> GetStringAsync(System.Uri? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(string? requestUri);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(System.Uri? requestUri);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(System.Uri? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(string? requestUri);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(System.Uri? requestUri);
System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(System.Uri? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(System.Uri? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Net.Http.HttpCompletionOption completionOption);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpCompletionOption completionOption);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(System.Uri? requestUri, System.Net.Http.HttpCompletionOption completionOption);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(System.Uri? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(System.Uri? requestUri, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(string? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(System.Uri? requestUri);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(System.Uri? requestUri, System.Threading.CancellationToken cancellationToken);
@@ -12,7 +12,7 @@ using System;
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IHttpMessageInvoker
public partial interface IHttpMessageInvoker : global::System.IDisposable
{
System.Net.Http.HttpMessageInvoker _Instance { get; }
@@ -23,8 +23,6 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);
void Dispose();
@@ -12,7 +12,7 @@ using System;
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IClientObject
public partial interface IClientObject : global::Microsoft.SharePoint.Client.IFromJson
{
Microsoft.SharePoint.Client.ClientObject _Instance { get; }
@@ -33,12 +33,6 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
void FromJson(Microsoft.SharePoint.Client.JsonReader reader);
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
bool CustomFromJson(Microsoft.SharePoint.Client.JsonReader reader);
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
void Retrieve();
@@ -12,7 +12,7 @@ using System;
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IClientRuntimeContext
public partial interface IClientRuntimeContext : global::System.IDisposable
{
Microsoft.SharePoint.Client.ClientRuntimeContext _Instance { get; }
@@ -77,8 +77,6 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
System.Collections.Generic.IEnumerable<T> LoadQuery<T>(System.Linq.IQueryable<T> clientObjects) where T : Microsoft.SharePoint.Client.ClientObject;
void Dispose();
event System.EventHandler<Microsoft.SharePoint.Client.WebRequestEventArgs> ExecutingWebRequest;
@@ -33,7 +33,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public System.Threading.Tasks.Task<string> GetStringAsync(string? requestUri)
public System.Threading.Tasks.Task<string> GetStringAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri)
{
string? requestUri_ = requestUri;
var result_1347886741 = _Instance.GetStringAsync(requestUri_);
@@ -47,7 +47,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1347886741;
}
public System.Threading.Tasks.Task<string> GetStringAsync(string? requestUri, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<string> GetStringAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Threading.CancellationToken cancellationToken_ = cancellationToken;
@@ -63,7 +63,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1347886741;
}
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(string? requestUri)
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri)
{
string? requestUri_ = requestUri;
var result__1359336953 = _Instance.GetByteArrayAsync(requestUri_);
@@ -77,7 +77,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result__1359336953;
}
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync(string? requestUri, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Threading.CancellationToken cancellationToken_ = cancellationToken;
@@ -93,14 +93,14 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result__1359336953;
}
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(string? requestUri)
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri)
{
string? requestUri_ = requestUri;
var result_355326142 = _Instance.GetStreamAsync(requestUri_);
return result_355326142;
}
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync(string? requestUri, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Threading.CancellationToken cancellationToken_ = cancellationToken;
@@ -123,7 +123,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_355326142;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri)
{
string? requestUri_ = requestUri;
var result_1805284658 = _Instance.GetAsync(requestUri_);
@@ -137,7 +137,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1805284658;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Net.Http.HttpCompletionOption completionOption)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpCompletionOption completionOption)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpCompletionOption completionOption_ = completionOption;
@@ -153,7 +153,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1805284658;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Threading.CancellationToken cancellationToken_ = cancellationToken;
@@ -169,7 +169,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1805284658;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync(string? requestUri, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> GetAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpCompletionOption completionOption_ = completionOption;
@@ -187,7 +187,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_1805284658;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(string? requestUri, System.Net.Http.HttpContent? content)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -203,7 +203,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result__1705712948;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -221,7 +221,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result__1705712948;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -237,7 +237,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_182918739;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -255,7 +255,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_182918739;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(string? requestUri, System.Net.Http.HttpContent? content)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -271,7 +271,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_910894592;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Net.Http.HttpContent? content_ = content;
@@ -289,7 +289,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_910894592;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(string? requestUri)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri)
{
string? requestUri_ = requestUri;
var result_534537427 = _Instance.DeleteAsync(requestUri_);
@@ -303,7 +303,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return result_534537427;
}
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync(string? requestUri, System.Threading.CancellationToken cancellationToken)
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("Uri")] string? requestUri, System.Threading.CancellationToken cancellationToken)
{
string? requestUri_ = requestUri;
System.Threading.CancellationToken cancellationToken_ = cancellationToken;