public async Task <Response <IpGroupData> > GetAsync(string subscriptionId, string resourceGroupName, string ipGroupsName, string expand = null, CancellationToken cancellationToken = default) { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (ipGroupsName == null) { throw new ArgumentNullException(nameof(ipGroupsName)); } using var message = CreateGetRequest(subscriptionId, resourceGroupName, ipGroupsName, expand); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { IpGroupData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = IpGroupData.DeserializeIpGroupData(document.RootElement); return(Response.FromValue(value, message.Response)); }
IpGroup IOperationSource <IpGroup> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = IpGroupData.DeserializeIpGroupData(document.RootElement); return(new IpGroup(_client, data)); }