public async Task <ISyntexModelPublicationResult> UnPublishModelAsync(SyntexModelUnPublishOptions unPublicationOptions) { return(ProcessModelPublishResponse(await UnPublishModelApiRequestAsync(UniqueId, unPublicationOptions.TargetSiteUrl, unPublicationOptions.TargetWebServerRelativeUrl, unPublicationOptions.TargetLibraryServerRelativeUrl).ConfigureAwait(false))); }
public IBatchSingleResult <ISyntexModelPublicationResult> UnPublishModelBatch(SyntexModelUnPublishOptions unPublicationOptions) { return(UnPublishModelBatchAsync(unPublicationOptions).GetAwaiter().GetResult()); }
public async Task <IBatchSingleResult <ISyntexModelPublicationResult> > UnPublishModelBatchAsync(SyntexModelUnPublishOptions unPublicationOptions) { return(await UnPublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, unPublicationOptions).ConfigureAwait(false)); }
public async Task <IBatchSingleResult <ISyntexModelPublicationResult> > UnPublishModelBatchAsync(Batch batch, SyntexModelUnPublishOptions unPublicationOptions) { System.Dynamic.ExpandoObject unPublishInfo = UnPublishModelApiRequestBody(UniqueId, unPublicationOptions.TargetSiteUrl, unPublicationOptions.TargetWebServerRelativeUrl, unPublicationOptions.TargetLibraryServerRelativeUrl); string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor); var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body) { RawSingleResult = new SyntexModelPublicationResult(), RawResultsHandler = (json, apiCall) => { List <SyntexModelPublicationResult> modelPublicationResults = ParseModelPublishResponse(json); var firstModelPublicationResult = modelPublicationResults.First(); (apiCall.RawSingleResult as SyntexModelPublicationResult).ErrorMessage = firstModelPublicationResult.ErrorMessage; (apiCall.RawSingleResult as SyntexModelPublicationResult).Publication = firstModelPublicationResult.Publication; (apiCall.RawSingleResult as SyntexModelPublicationResult).StatusCode = firstModelPublicationResult.StatusCode; } }; var batchRequest = await(ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false); return(new BatchSingleResult <ISyntexModelPublicationResult>(batch, batchRequest.Id, apiCall.RawSingleResult as ISyntexModelPublicationResult)); }
public ISyntexModelPublicationResult UnPublishModel(SyntexModelUnPublishOptions unPublicationOptions) { return(UnPublishModelAsync(unPublicationOptions).GetAwaiter().GetResult()); }