Skip to content

Commit cb575a8

Browse files
authored
Return ScmMethodProvider when building operation methods (#54140)
* debug etag issue. * write console debug info * WIP * regen after rebase. * regen * regen * add doc for if-match parameter.
1 parent 985a084 commit cb575a8

File tree

5 files changed

+270
-210
lines changed

5 files changed

+270
-210
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,14 @@ protected virtual CSharpType BuildReturnType()
133133

134134
public static implicit operator MethodProvider(ResourceOperationMethodProvider resourceOperationMethodProvider)
135135
{
136-
var methodProvider = new MethodProvider(
136+
var methodProvider = new ScmMethodProvider(
137137
resourceOperationMethodProvider._signature,
138138
resourceOperationMethodProvider._bodyStatements,
139-
resourceOperationMethodProvider._enclosingType);
139+
resourceOperationMethodProvider._enclosingType,
140+
ScmMethodKind.Convenience,
141+
null,
142+
null,
143+
resourceOperationMethodProvider._serviceMethod);
140144

141145
// Add enhanced XML documentation with structured tags
142146
ResourceHelpers.BuildEnhancedXmlDocs(

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/databox.tsp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ interface JobResources {
4646
update is ArmCustomPatchAsync<
4747
JobResource,
4848
PatchModel = JobResourceUpdateParameter,
49+
Parameters = {
50+
/**
51+
* Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value.
52+
*/
53+
@header("If-Match")
54+
`If-Match`?: string;
55+
}
4956
>;
5057
}
5158

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/JobResource.cs

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/JobResourcesRestOperations.cs

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)