Пример #1
0
        public async Task <Response <CloudServiceOSVersionData> > GetOSVersionAsync(string subscriptionId, AzureLocation location, string osVersionName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(osVersionName, nameof(osVersionName));

            using var message = CreateGetOSVersionRequest(subscriptionId, location, osVersionName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                CloudServiceOSVersionData value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = CloudServiceOSVersionData.DeserializeCloudServiceOSVersionData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
Пример #2
0
 internal CloudServiceOSVersionResource(ArmClient client, CloudServiceOSVersionData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }