Exemplo n.º 1
0
        AppBuildServiceAgentPoolResource IOperationSource <AppBuildServiceAgentPoolResource> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = AppBuildServiceAgentPoolResourceData.DeserializeAppBuildServiceAgentPoolResourceData(document.RootElement);

            return(new AppBuildServiceAgentPoolResource(_client, data));
        }
Exemplo n.º 2
0
 internal AppBuildServiceAgentPoolResource(ArmClient client, AppBuildServiceAgentPoolResourceData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }
Exemplo n.º 3
0
        public virtual ArmOperation <AppBuildServiceAgentPoolResource> Update(WaitUntil waitUntil, AppBuildServiceAgentPoolResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _appBuildServiceAgentPoolResourceBuildServiceAgentPoolClientDiagnostics.CreateScope("AppBuildServiceAgentPoolResource.Update");
            scope.Start();
            try
            {
                var response  = _appBuildServiceAgentPoolResourceBuildServiceAgentPoolRestClient.UpdatePut(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
                var operation = new AppPlatformArmOperation <AppBuildServiceAgentPoolResource>(new AppBuildServiceAgentPoolResourceOperationSource(Client), _appBuildServiceAgentPoolResourceBuildServiceAgentPoolClientDiagnostics, Pipeline, _appBuildServiceAgentPoolResourceBuildServiceAgentPoolRestClient.CreateUpdatePutRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }