public async Task <Response <ProximityPlacementGroupData> > CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroupData parameters, CancellationToken cancellationToken = default) { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (proximityPlacementGroupName == null) { throw new ArgumentNullException(nameof(proximityPlacementGroupName)); } if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, proximityPlacementGroupName, parameters); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 201: { ProximityPlacementGroupData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(document.RootElement); return(Response.FromValue(value, message.Response)); }
public async Task <Response <ProximityPlacementGroupData> > CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroupData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(proximityPlacementGroupName, nameof(proximityPlacementGroupName)); Argument.AssertNotNull(data, nameof(data)); using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, proximityPlacementGroupName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 201: { ProximityPlacementGroupData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(document.RootElement); return(Response.FromValue(value, message.Response)); }