Ejemplo n.º 1
0
 public virtual Response <IotCentralAppResource> Get(CancellationToken cancellationToken = default)
 {
     using var scope = _iotCentralAppAppsClientDiagnostics.CreateScope("IotCentralAppResource.Get");
     scope.Start();
     try
     {
         var response = _iotCentralAppAppsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         if (response.Value == null)
         {
             throw new RequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new IotCentralAppResource(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Ejemplo n.º 2
0
        public virtual Response <AppPlatformAppResource> Get(string appName, string syncStatus = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(appName, nameof(appName));

            using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResourceCollection.Get");
            scope.Start();
            try
            {
                var response = _appPlatformAppResourceAppsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, appName, syncStatus, cancellationToken);
                if (response.Value == null)
                {
                    throw new RequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new AppPlatformAppResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }