public static CommunicationServiceResource GetCommunicationServiceResource(this ArmClient client, ResourceIdentifier id)
 {
     return(client.GetResourceClient(() =>
     {
         CommunicationServiceResource.ValidateResourceId(id);
         return new CommunicationServiceResource(client, id);
     }
                                     ));
 }
        public virtual CommunicationServiceCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string communicationServiceName, CommunicationServiceResource parameters = null, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (communicationServiceName == null)
            {
                throw new ArgumentNullException(nameof(communicationServiceName));
            }

            using var scope = _clientDiagnostics.CreateScope("CommunicationServiceOperations.StartCreateOrUpdate");
            scope.Start();
            try
            {
                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, communicationServiceName, parameters, cancellationToken);
                return(new CommunicationServiceCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, communicationServiceName, parameters).Request, originalResponse));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #3
0
 public virtual Response <CommunicationServiceResource> Update(string resourceGroupName, string communicationServiceName, CommunicationServiceResource parameters = null, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("CommunicationServiceOperations.Update");
     scope.Start();
     try
     {
         return(RestClient.Update(resourceGroupName, communicationServiceName, parameters, cancellationToken));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }