-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into AddSpecSummary
- Loading branch information
Showing
70 changed files
with
1,424 additions
and
546 deletions.
There are no files selected for viewing
This file contains 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
35 changes: 35 additions & 0 deletions
35
...or/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientPipelineApi.cs
This file contains 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,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record ClientPipelineApi : ScopedApi, IClientPipelineApi | ||
{ | ||
public abstract CSharpType ClientPipelineType { get; } | ||
public abstract CSharpType ClientPipelineOptionsType { get; } | ||
public abstract CSharpType PipelinePolicyType { get; } | ||
|
||
protected ClientPipelineApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract HttpMessageApi CreateMessage(); | ||
|
||
public abstract ValueExpression CreateMessage(HttpRequestOptionsApi requestOptions, ValueExpression responseClassifier); | ||
|
||
public abstract InvokeMethodExpression Send(HttpMessageApi message); | ||
|
||
public abstract InvokeMethodExpression SendAsync(HttpMessageApi message); | ||
|
||
public abstract ValueExpression Create(ValueExpression options, ValueExpression perRetryPolicies); | ||
|
||
public abstract ValueExpression PerRetryPolicy(params ValueExpression[] arguments); | ||
public abstract ClientPipelineApi FromExpression(ValueExpression expression); | ||
public abstract ClientPipelineApi ToExpression(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...or/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientResponseApi.cs
This file contains 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,37 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record ClientResponseApi : ScopedApi, IClientResponseApi | ||
{ | ||
protected ClientResponseApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract HttpResponseApi GetRawResponse(); | ||
|
||
public abstract ValueExpression FromValue(ValueExpression valueExpression, HttpResponseApi response); | ||
|
||
public abstract ValueExpression FromValue<ValueType>(ValueExpression valueExpression, HttpResponseApi response); | ||
|
||
public abstract ValueExpression FromResponse(ValueExpression valueExpression); | ||
|
||
public abstract ValueExpression CreateAsync(HttpResponseApi response); | ||
|
||
public abstract ClientResponseApi FromExpression(ValueExpression original); | ||
|
||
public abstract ClientResponseApi ToExpression(); | ||
|
||
public abstract CSharpType ClientResponseType { get; } | ||
|
||
public abstract CSharpType ClientResponseOfTType { get; } | ||
|
||
public abstract CSharpType ClientResponseExceptionType { get; } | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...rator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/HttpMessageApi.cs
This file contains 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,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
using Microsoft.Generator.CSharp.Statements; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record HttpMessageApi : ScopedApi, IHttpMessageApi | ||
{ | ||
protected HttpMessageApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract HttpRequestApi Request(); | ||
|
||
public abstract HttpResponseApi Response(); | ||
|
||
public abstract ValueExpression BufferResponse(); | ||
|
||
public abstract ValueExpression ResponseClassifier(); | ||
|
||
public abstract MethodBodyStatement Apply(ValueExpression options); | ||
|
||
public abstract MethodBodyStatement[] ExtractResponse(); | ||
|
||
public abstract HttpMessageApi FromExpression(ValueExpression original); | ||
|
||
public abstract HttpMessageApi ToExpression(); | ||
|
||
public abstract CSharpType HttpMessageType { get; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...rator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/HttpRequestApi.cs
This file contains 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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record HttpRequestApi : ScopedApi, IExpressionApi<HttpRequestApi> | ||
{ | ||
protected HttpRequestApi(CSharpType type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract AssignmentExpression SetMethod(string httpMethod); | ||
|
||
public abstract AssignmentExpression SetUri(ValueExpression uri); | ||
|
||
public abstract InvokeMethodExpression SetHeaders(IReadOnlyList<ValueExpression> arguments); | ||
|
||
public abstract ValueExpression Content(); | ||
public abstract HttpRequestApi FromExpression(ValueExpression original); | ||
public abstract HttpRequestApi ToExpression(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...icrosoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/HttpRequestOptionsApi.cs
This file contains 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,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record HttpRequestOptionsApi : ScopedApi, IHttpRequestOptionsApi | ||
{ | ||
public HttpRequestOptionsApi(CSharpType type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract ValueExpression ErrorOptions(); | ||
|
||
public abstract HttpRequestOptionsApi FromExpression(ValueExpression original); | ||
|
||
public abstract ValueExpression NoThrow(); | ||
|
||
public abstract HttpRequestOptionsApi ToExpression(); | ||
|
||
public abstract CSharpType HttpRequestOptionsType { get; } | ||
public abstract string ParameterName { get; } | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/HttpResponseApi.cs
This file contains 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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.IO; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record HttpResponseApi : ScopedApi, IHttpResponseApi | ||
{ | ||
protected HttpResponseApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract ScopedApi<Stream> ContentStream(); | ||
|
||
public abstract ScopedApi<BinaryData> Content(); | ||
|
||
public abstract ScopedApi<bool> IsError(); | ||
|
||
public abstract CSharpType HttpResponseType { get; } | ||
|
||
public abstract HttpResponseApi FromExpression(ValueExpression original); | ||
|
||
public abstract HttpResponseApi ToExpression(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs
This file contains 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.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IClientPipelineApi : IExpressionApi<ClientPipelineApi> | ||
{ | ||
CSharpType ClientPipelineType { get; } | ||
CSharpType ClientPipelineOptionsType { get; } | ||
CSharpType PipelinePolicyType { get; } | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientResponseApi.cs
This file contains 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,16 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IClientResponseApi : IExpressionApi<ClientResponseApi> | ||
{ | ||
CSharpType ClientResponseExceptionType { get; } | ||
|
||
CSharpType ClientResponseType { get; } | ||
|
||
CSharpType ClientResponseOfTType { get; } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...rator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IExpressionApi.cs
This file contains 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,15 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IExpressionApi<T> where T : ScopedApi | ||
{ | ||
T FromExpression(ValueExpression original); | ||
|
||
T ToExpression(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpMessageApi.cs
This file contains 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,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IHttpMessageApi : IExpressionApi<HttpMessageApi> | ||
{ | ||
CSharpType HttpMessageType { get; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...crosoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpRequestOptionsApi.cs
This file contains 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.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IHttpRequestOptionsApi : IExpressionApi<HttpRequestOptionsApi> | ||
{ | ||
CSharpType HttpRequestOptionsType { get; } | ||
|
||
string ParameterName { get; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...tor/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IHttpResponseApi.cs
This file contains 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,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IHttpResponseApi : IExpressionApi<HttpResponseApi> | ||
{ | ||
CSharpType HttpResponseType { get; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...r/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IRequestContentApi.cs
This file contains 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,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IRequestContentApi : IExpressionApi<RequestContentApi> | ||
{ | ||
CSharpType RequestContentType { get; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...osoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IStatusCodeClassifierApi.cs
This file contains 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,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Generator.CSharp.Primitives; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public interface IStatusCodeClassifierApi : IExpressionApi<StatusCodeClassifierApi> | ||
{ | ||
CSharpType ResponseClassifierType { get; } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...or/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/RequestContentApi.cs
This file contains 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,24 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
using Microsoft.Generator.CSharp.Statements; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record RequestContentApi : ScopedApi, IRequestContentApi | ||
{ | ||
protected RequestContentApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract CSharpType RequestContentType { get; } | ||
|
||
public abstract RequestContentApi FromExpression(ValueExpression original); | ||
public abstract RequestContentApi ToExpression(); | ||
public abstract MethodBodyStatement[] Create(ValueExpression argument); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...rosoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/StatusCodeClassifierApi.cs
This file contains 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,23 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Primitives; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Providers | ||
{ | ||
public abstract record StatusCodeClassifierApi : ScopedApi, IStatusCodeClassifierApi | ||
{ | ||
public StatusCodeClassifierApi(Type type, ValueExpression original) : base(type, original) | ||
{ | ||
} | ||
|
||
public abstract CSharpType ResponseClassifierType { get; } | ||
|
||
public abstract ValueExpression Create(int code); | ||
public abstract StatusCodeClassifierApi FromExpression(ValueExpression original); | ||
public abstract StatusCodeClassifierApi ToExpression(); | ||
} | ||
} |
Oops, something went wrong.