コード例 #1
0
        public async Task <Response <RoleAssignment> > DeleteAsync(string vaultBaseUrl, string scope, string roleAssignmentName, CancellationToken cancellationToken = default)
        {
            if (vaultBaseUrl == null)
            {
                throw new ArgumentNullException(nameof(vaultBaseUrl));
            }
            if (scope == null)
            {
                throw new ArgumentNullException(nameof(scope));
            }
            if (roleAssignmentName == null)
            {
                throw new ArgumentNullException(nameof(roleAssignmentName));
            }

            using var message = CreateDeleteRequest(vaultBaseUrl, scope, roleAssignmentName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }