public virtual Response <IPGroupResource> Get(string expand = null, CancellationToken cancellationToken = default)
 {
     using var scope = _ipGroupIpGroupsClientDiagnostics.CreateScope("IPGroupResource.Get");
     scope.Start();
     try
     {
         var response = _ipGroupIpGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken);
         if (response.Value == null)
         {
             throw new RequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new IPGroupResource(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
        public virtual Response <IPGroup> Get(string ipGroupsName, string expand = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(ipGroupsName, nameof(ipGroupsName));

            using var scope = _ipGroupIpGroupsClientDiagnostics.CreateScope("IPGroupCollection.Get");
            scope.Start();
            try
            {
                var response = _ipGroupIpGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ipGroupsName, expand, cancellationToken);
                if (response.Value == null)
                {
                    throw _ipGroupIpGroupsClientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new IPGroup(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Beispiel #3
0
        public virtual Response <IpGroup> Get(string ipGroupsName, string expand = null, CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("IpGroupContainer.Get");
            scope.Start();
            try
            {
                if (ipGroupsName == null)
                {
                    throw new ArgumentNullException(nameof(ipGroupsName));
                }

                var response = _restClient.Get(Id.ResourceGroupName, ipGroupsName, expand, cancellationToken: cancellationToken);
                if (response.Value == null)
                {
                    throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new IpGroup(Parent, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }