-
Notifications
You must be signed in to change notification settings - Fork 325
Response abstraction #4438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Response abstraction #4438
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
40ecf45
init
live1206 7da2225
Merge branch 'main' into response-abstraction
live1206 d170d95
cleanup
live1206 88a4620
clean up
live1206 0c8c172
Merge branch 'main' into response-abstraction
live1206 634c06a
wip
live1206 5bbcd8a
update FromValue expression
live1206 93932af
rename
live1206 f1a9a3d
restructure
live1206 1169baf
revert type change
live1206 9752376
Merge branch 'main' into response-abstraction
live1206 f062d77
make static methods abstract
live1206 d1889c2
Merge branch 'response-abstraction' of https://github.com/live1206/ty…
live1206 9eb3b66
update Type to CSharpType
live1206 56e0f8a
make ErrorResultDefinition public
live1206 8f6e642
update
live1206 47a6427
Merge branch 'main' into response-abstraction
live1206 4a94206
Add more abstraction to make Azure plugin work
live1206 37295c0
regen tests
live1206 49ee47d
Merge branch 'main' into response-abstraction
live1206 eb32597
fix typo
live1206 c29e8c0
update
live1206 eb98948
Merge branch 'main' into response-abstraction
live1206 fcf7ee5
add interfaces
live1206 109e93e
revert changes for serialization
live1206 f8c7bbb
revert test change
live1206 b0d4fca
Merge branch 'main' into response-abstraction
live1206 a038db4
fix
live1206 f83dd0b
cleanup
live1206 a5a379f
make test pass
live1206 aa27a8d
Merge branch 'main' into response-abstraction
live1206 100328f
minor
live1206 14f87d0
Merge branch 'main' into response-abstraction
live1206 48449f4
Merge branch 'main' into response-abstraction
live1206 456f13a
resolve comments
live1206 71bf272
Merge branch 'main' into response-abstraction
live1206 0cfe54f
Add IExpressionApi<T>
live1206 1189b18
add constraint
live1206 cb6c50e
Add ParameterName to IHttpRequestOptionsApi
live1206 486104c
Add tests for abstraction and simplify the implementation
live1206 aba79be
Merge branch 'main' into response-abstraction
live1206 c8a8735
fix typo
live1206 e3c067a
more typo
live1206 55637ee
fix typo in test data file name
live1206 5f192fb
Merge branch 'main' into response-abstraction
live1206 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
7 changes: 1 addition & 6 deletions
7
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientResponseApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...rator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IExpressionApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
live1206 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| T ToExpression(); | ||
| } | ||
| } | ||
7 changes: 2 additions & 5 deletions
7
...ator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpMessageApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
13 changes: 0 additions & 13 deletions
13
...ator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpRequestApi.cs
This file was deleted.
Oops, something went wrong.
7 changes: 2 additions & 5 deletions
7
...crosoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpRequestOptionsApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; } | ||
live1206 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| HttpRequestOptionsApi FromExpression(ValueExpression original); | ||
| HttpRequestOptionsApi ToExpression(); | ||
| } | ||
| } | ||
9 changes: 2 additions & 7 deletions
9
...tor/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpResponseApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
7 changes: 2 additions & 5 deletions
7
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IRequestContentApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
7 changes: 2 additions & 5 deletions
7
...osoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IStatusCodeClassifierApi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.