Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
40ecf45
init
live1206 Sep 13, 2024
7da2225
Merge branch 'main' into response-abstraction
live1206 Sep 13, 2024
d170d95
cleanup
live1206 Sep 13, 2024
88a4620
clean up
live1206 Sep 13, 2024
0c8c172
Merge branch 'main' into response-abstraction
live1206 Sep 14, 2024
634c06a
wip
live1206 Sep 18, 2024
5bbcd8a
update FromValue expression
live1206 Sep 18, 2024
93932af
rename
live1206 Sep 19, 2024
f1a9a3d
restructure
live1206 Sep 19, 2024
1169baf
revert type change
live1206 Sep 19, 2024
9752376
Merge branch 'main' into response-abstraction
live1206 Sep 19, 2024
f062d77
make static methods abstract
live1206 Sep 23, 2024
d1889c2
Merge branch 'response-abstraction' of https://github.com/live1206/ty…
live1206 Sep 23, 2024
9eb3b66
update Type to CSharpType
live1206 Sep 23, 2024
56e0f8a
make ErrorResultDefinition public
live1206 Sep 25, 2024
8f6e642
update
live1206 Sep 26, 2024
47a6427
Merge branch 'main' into response-abstraction
live1206 Sep 26, 2024
4a94206
Add more abstraction to make Azure plugin work
live1206 Sep 30, 2024
37295c0
regen tests
live1206 Sep 30, 2024
49ee47d
Merge branch 'main' into response-abstraction
live1206 Sep 30, 2024
eb32597
fix typo
live1206 Sep 30, 2024
c29e8c0
update
live1206 Sep 30, 2024
eb98948
Merge branch 'main' into response-abstraction
live1206 Oct 8, 2024
fcf7ee5
add interfaces
live1206 Oct 9, 2024
109e93e
revert changes for serialization
live1206 Oct 9, 2024
f8c7bbb
revert test change
live1206 Oct 9, 2024
b0d4fca
Merge branch 'main' into response-abstraction
live1206 Oct 9, 2024
a038db4
fix
live1206 Oct 9, 2024
f83dd0b
cleanup
live1206 Oct 9, 2024
a5a379f
make test pass
live1206 Oct 9, 2024
aa27a8d
Merge branch 'main' into response-abstraction
live1206 Oct 10, 2024
100328f
minor
live1206 Oct 10, 2024
14f87d0
Merge branch 'main' into response-abstraction
live1206 Oct 10, 2024
48449f4
Merge branch 'main' into response-abstraction
live1206 Oct 11, 2024
456f13a
resolve comments
live1206 Oct 11, 2024
71bf272
Merge branch 'main' into response-abstraction
live1206 Oct 11, 2024
0cfe54f
Add IExpressionApi<T>
live1206 Oct 14, 2024
1189b18
add constraint
live1206 Oct 14, 2024
cb6c50e
Add ParameterName to IHttpRequestOptionsApi
live1206 Oct 16, 2024
486104c
Add tests for abstraction and simplify the implementation
live1206 Oct 17, 2024
aba79be
Merge branch 'main' into response-abstraction
live1206 Oct 17, 2024
c8a8735
fix typo
live1206 Oct 17, 2024
e3c067a
more typo
live1206 Oct 17, 2024
55637ee
fix typo in test data file name
live1206 Oct 17, 2024
5f192fb
Merge branch 'main' into response-abstraction
live1206 Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public abstract record HttpRequestApi : ScopedApi, IHttpRequestApi
public abstract record HttpRequestApi : ScopedApi, IExpressionApi<HttpRequestApi>
{
protected HttpRequestApi(CSharpType type, ValueExpression original) : base(type, original)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IClientPipelineApi
public interface IClientPipelineApi : IExpressionApi<ClientPipelineApi>
{
CSharpType ClientPipelineType { get; }
CSharpType ClientPipelineOptionsType { get; }
CSharpType PipelinePolicyType { get; }
ClientPipelineApi FromExpression(ValueExpression expression);
ClientPipelineApi ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IClientResponseApi
public interface IClientResponseApi : IExpressionApi<ClientResponseApi>
{
CSharpType ClientResponseExceptionType { get; }

CSharpType ClientResponseType { get; }

CSharpType ClientResponseOfTType { get; }

ClientResponseApi FromExpression(ValueExpression original);

ClientResponseApi ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IExpressionApi<T>
{
T FromExpression(ValueExpression original);

T ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IHttpMessageApi
public interface IHttpMessageApi : IExpressionApi<HttpMessageApi>
{
CSharpType HttpMessageType { get; }
HttpMessageApi FromExpression(ValueExpression original);
HttpMessageApi ToExpression();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IHttpRequestOptionsApi
public interface IHttpRequestOptionsApi : IExpressionApi<HttpRequestOptionsApi>
{
CSharpType HttpRequestOptionsType { get; }
HttpRequestOptionsApi FromExpression(ValueExpression original);
HttpRequestOptionsApi ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IHttpResponseApi
public interface IHttpResponseApi : IExpressionApi<HttpResponseApi>
{
CSharpType HttpResponseType { get; }

HttpResponseApi FromExpression(ValueExpression original);

HttpResponseApi ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IRequestContentApi
public interface IRequestContentApi : IExpressionApi<RequestContentApi>
{
CSharpType RequestContentType { get; }
RequestContentApi FromExpression(ValueExpression original);
RequestContentApi ToExpression();
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Primitives;

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public interface IStatusCodeClassifierApi
public interface IStatusCodeClassifierApi : IExpressionApi<StatusCodeClassifierApi>
{
CSharpType ResponseClassifierType { get; }
StatusCodeClassifierApi FromExpression(ValueExpression original);
StatusCodeClassifierApi ToExpression();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ScmTypeFactory : TypeFactory

public virtual IHttpRequestOptionsApi HttpRequestOptionsApi => RequestOptionsProvider.Instance;

public virtual IHttpRequestApi HttpRequestApi => PipelineRequestProvider.Instance;
public virtual IExpressionApi<HttpRequestApi> HttpRequestApi => PipelineRequestProvider.Instance;

public virtual IClientPipelineApi ClientPipelineApi => ClientPipelineProvider.Instance;

Expand Down