public async Task <Response <RuleListResult> > ListByRuleSetAsync(string subscriptionId, string resourceGroupName, string profileName, string ruleSetName, CancellationToken cancellationToken = default)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (profileName == null)
            {
                throw new ArgumentNullException(nameof(profileName));
            }
            if (ruleSetName == null)
            {
                throw new ArgumentNullException(nameof(ruleSetName));
            }

            using var message = CreateListByRuleSetRequest(subscriptionId, resourceGroupName, profileName, ruleSetName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = RuleListResult.DeserializeRuleListResult(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
Beispiel #2
0
        public async Task <Response <RuleListResult> > ListBySubscriptionsAsync(string subscriptionId, string resourceGroupName, string namespaceName, string topicName, string subscriptionName, int?skip = null, int?top = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName));
            Argument.AssertNotNullOrEmpty(topicName, nameof(topicName));
            Argument.AssertNotNullOrEmpty(subscriptionName, nameof(subscriptionName));

            using var message = CreateListBySubscriptionsRequest(subscriptionId, resourceGroupName, namespaceName, topicName, subscriptionName, skip, top);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = RuleListResult.DeserializeRuleListResult(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }