Exemple #1
0
        public async Task <Response <CommunityGalleryImageVersionData> > GetAsync(string subscriptionId, AzureLocation location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(publicGalleryName, nameof(publicGalleryName));
            Argument.AssertNotNullOrEmpty(galleryImageName, nameof(galleryImageName));
            Argument.AssertNotNullOrEmpty(galleryImageVersionName, nameof(galleryImageVersionName));

            using var message = CreateGetRequest(subscriptionId, location, publicGalleryName, galleryImageName, galleryImageVersionName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = CommunityGalleryImageVersionData.DeserializeCommunityGalleryImageVersionData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
Exemple #2
0
 internal CommunityGalleryImageVersionResource(ArmClient client, CommunityGalleryImageVersionData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }