Esempio n. 1
0
        public async Task CheckNameAvailability()
        {
            var rq = new ManagementGroupNameAvailabilityContent();

            rq.Name = "this-should-not-exist";
            var rs = await Client.GetManagementGroups().CheckNameAvailabilityAsync(rq);

            Assert.IsTrue(rs.Value.NameAvailable);
        }
        public virtual Response <ManagementGroupNameAvailabilityResult> CheckNameAvailability(ManagementGroupNameAvailabilityContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            using var scope = _managementGroupClientDiagnostics.CreateScope("ManagementGroupCollection.CheckNameAvailability");
            scope.Start();
            try
            {
                var response = _managementGroupRestClient.CheckNameAvailability(content, cancellationToken);
                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }