ACA has the following operation:
model GetSandboxesCountResult {
/** HTTP response status code. */
@statusCode statusCode: 200;
/** Response body. */
@body body: int32;
}
/** Gets the total count of sandboxes. */
@summary("Gets the total count of sandboxes.")
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/sandboxGroups/{sandboxGroupName}/sandboxes/count")
@get
getSandboxesCount is Foundations.Operation<
{
...AzureResourceScope;
},
GetSandboxesCountResult,
DataPlaneStandardTraits,
GetSandboxesCountErrors
>;
which simply returns an integer with the count. The generated operation is generated, but is not AOT compatible:
public virtual async Task<Response<int>> GetSnapshotsCountAsync(string subscriptionId, string resourceGroupName, string sandboxGroupName, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
Argument.AssertNotNullOrEmpty(sandboxGroupName, nameof(sandboxGroupName));
Response result = await GetSnapshotsCountAsync(subscriptionId, resourceGroupName, sandboxGroupName, cancellationToken.ToRequestContext()).ConfigureAwait(false);
return Response.FromValue(result.Content.ToObjectFromJson<int>(), result);
}
this can simply be generated as:
public virtual async Task<Response<int>> GetSnapshotsCountAsync(
string subscriptionId,
string resourceGroupName,
string sandboxGroupName,
CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
Argument.AssertNotNullOrEmpty(sandboxGroupName, nameof(sandboxGroupName));
Response result = await GetSnapshotsCountAsync(
subscriptionId,
resourceGroupName,
sandboxGroupName,
cancellationToken.ToRequestContext()).ConfigureAwait(false);
using JsonDocument document = JsonDocument.Parse(result.Content);
int count = document.RootElement.GetInt32();
return Response.FromValue(count, result);
}
ACA has the following operation:
which simply returns an integer with the count. The generated operation is generated, but is not AOT compatible:
this can simply be generated as: