public virtual void deleteIdentityLink(IdentityLinkDto identityLink) { TaskService taskService = engine.TaskService; identityLink.validate(); if (!string.ReferenceEquals(identityLink.UserId, null)) { taskService.deleteUserIdentityLink(taskId, identityLink.UserId, identityLink.Type); } else if (!string.ReferenceEquals(identityLink.GroupId, null)) { taskService.deleteGroupIdentityLink(taskId, identityLink.GroupId, identityLink.Type); } }
public virtual IList <IdentityLinkDto> getIdentityLinks(string type) { TaskService taskService = engine.TaskService; IList <IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId); IList <IdentityLinkDto> result = new List <IdentityLinkDto>(); foreach (IdentityLink link in identityLinks) { if (string.ReferenceEquals(type, null) || type.Equals(link.Type)) { result.Add(IdentityLinkDto.fromIdentityLink(link)); } } return(result); }
/// <summary> /// Removes an identity link from a task by id /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The id of the task to remove a link from.</param> /// <param name="identityLinkDto"> (optional)</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <ApiResponse <Object> > DeleteIdentityLinkAsyncWithHttpInfo(string id, IdentityLinkDto identityLinkDto = default(IdentityLinkDto)) { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling TaskIdentityLinkApi->DeleteIdentityLink"); } var localVarPath = "/task/{id}/identity-links/delete"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (id != null) { localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter } if (identityLinkDto != null && identityLinkDto.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(identityLinkDto); // http body (model) parameter } else { localVarPostBody = identityLinkDto; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("DeleteIdentityLink", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <Object>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null)); }
/// <summary> /// Removes an identity link from a task by id /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The id of the task to remove a link from.</param> /// <param name="identityLinkDto"> (optional)</param> /// <returns>Task of void</returns> public async System.Threading.Tasks.Task DeleteIdentityLinkAsync(string id, IdentityLinkDto identityLinkDto = default(IdentityLinkDto)) { await DeleteIdentityLinkAsyncWithHttpInfo(id, identityLinkDto); }
/// <summary> /// Removes an identity link from a task by id /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The id of the task to remove a link from.</param> /// <param name="identityLinkDto"> (optional)</param> /// <returns></returns> public void DeleteIdentityLink(string id, IdentityLinkDto identityLinkDto = default(IdentityLinkDto)) { DeleteIdentityLinkWithHttpInfo(id, identityLinkDto); }
/// <summary> /// Removes an identity link from a task by id /// </summary> /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The id of the task to remove a link from.</param> /// <param name="identityLinkDto"> (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <Camunda.OpenApi.Client.Client.ApiResponse <Object> > DeleteIdentityLinkWithHttpInfoAsync(string id, IdentityLinkDto identityLinkDto = default(IdentityLinkDto), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'id' is set if (id == null) { throw new Camunda.OpenApi.Client.Client.ApiException(400, "Missing required parameter 'id' when calling TaskIdentityLinkApi->DeleteIdentityLink"); } Camunda.OpenApi.Client.Client.RequestOptions localVarRequestOptions = new Camunda.OpenApi.Client.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("id", Camunda.OpenApi.Client.Client.ClientUtils.ParameterToString(id)); // path parameter localVarRequestOptions.Data = identityLinkDto; // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/task/{id}/identity-links/delete", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteIdentityLink", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Removes an identity link from a task by id /// </summary> /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The id of the task to remove a link from.</param> /// <param name="identityLinkDto"> (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of void</returns> public async System.Threading.Tasks.Task DeleteIdentityLinkAsync(string id, IdentityLinkDto identityLinkDto = default(IdentityLinkDto), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await DeleteIdentityLinkWithHttpInfoAsync(id, identityLinkDto, cancellationToken).ConfigureAwait(false); }