示例#1
0
        public async Task <Response <ExtensionList> > ListByArcSettingAsync(string subscriptionId, string resourceGroupName, string clusterName, string arcSettingName, CancellationToken cancellationToken = default)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (clusterName == null)
            {
                throw new ArgumentNullException(nameof(clusterName));
            }
            if (arcSettingName == null)
            {
                throw new ArgumentNullException(nameof(arcSettingName));
            }

            using var message = CreateListByArcSettingRequest(subscriptionId, resourceGroupName, clusterName, arcSettingName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = ExtensionList.DeserializeExtensionList(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }