content: /*
   * VaultFileSystem
   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   *
   * The version of the OpenAPI document: 1.0.0
   * Contact: info@affinidi.com
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.affinidi.tdk.vault.data.manager.client.apis;
  
  import com.fasterxml.jackson.core.type.TypeReference;
  
  import com.affinidi.tdk.vault.data.manager.client.ApiException;
  import com.affinidi.tdk.vault.data.manager.client.ApiClient;
  import com.affinidi.tdk.vault.data.manager.client.BaseApi;
  import com.affinidi.tdk.vault.data.manager.client.Configuration;
  import com.affinidi.tdk.vault.data.manager.client.Pair;
  
  import com.affinidi.tdk.vault.data.manager.client.models.CreateNodeInput;
  import com.affinidi.tdk.vault.data.manager.client.models.CreateNodeOK;
  import com.affinidi.tdk.vault.data.manager.client.models.DeleteNodeDto;
  import com.affinidi.tdk.vault.data.manager.client.models.GetDetailedNodeInfoOK;
  import com.affinidi.tdk.vault.data.manager.client.models.InitNodesOK;
  import com.affinidi.tdk.vault.data.manager.client.models.InvalidParameterError;
  import com.affinidi.tdk.vault.data.manager.client.models.ListNodeChildrenOK;
  import com.affinidi.tdk.vault.data.manager.client.models.ListRootNodeChildrenOK;
  import com.affinidi.tdk.vault.data.manager.client.models.MoveNodeDto;
  import com.affinidi.tdk.vault.data.manager.client.models.MoveNodeInput;
  import com.affinidi.tdk.vault.data.manager.client.models.NodeDto;
  import com.affinidi.tdk.vault.data.manager.client.models.RestoreNodeFromTrashbin;
  import com.affinidi.tdk.vault.data.manager.client.models.UpdateNodeInput;
  
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.StringJoiner;
  
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class NodesApi extends BaseApi {
  
    public NodesApi() {
      super(Configuration.getDefaultApiClient());
    }
  
    public NodesApi(ApiClient apiClient) {
      super(apiClient);
    }
  
    /**
     * 
     * creates child node
     * @param createNodeInput CreateNode (required)
     * @param parentNodeId parent node id (optional)
     * @return CreateNodeOK
     * @throws ApiException if fails to make API call
     */
    public CreateNodeOK createChildNode(@javax.annotation.Nonnull CreateNodeInput createNodeInput, @javax.annotation.Nullable String parentNodeId) throws ApiException {
      return this.createChildNode(createNodeInput, parentNodeId, Collections.emptyMap());
    }
  
  
    /**
     * 
     * creates child node
     * @param createNodeInput CreateNode (required)
     * @param parentNodeId parent node id (optional)
     * @param additionalHeaders additionalHeaders for this call
     * @return CreateNodeOK
     * @throws ApiException if fails to make API call
     */
    public CreateNodeOK createChildNode(@javax.annotation.Nonnull CreateNodeInput createNodeInput, @javax.annotation.Nullable String parentNodeId, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = createNodeInput;
      
      // verify the required parameter 'createNodeInput' is set
      if (createNodeInput == null) {
        throw new ApiException(400, "Missing the required parameter 'createNodeInput' when calling createChildNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}";
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarQueryParams.addAll(apiClient.parameterToPair("parentNodeId", parentNodeId));
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<CreateNodeOK> localVarReturnType = new TypeReference<CreateNodeOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * create a node
     * @param createNodeInput CreateNode (required)
     * @return CreateNodeOK
     * @throws ApiException if fails to make API call
     */
    public CreateNodeOK createNode(@javax.annotation.Nonnull CreateNodeInput createNodeInput) throws ApiException {
      return this.createNode(createNodeInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * create a node
     * @param createNodeInput CreateNode (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return CreateNodeOK
     * @throws ApiException if fails to make API call
     */
    public CreateNodeOK createNode(@javax.annotation.Nonnull CreateNodeInput createNodeInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = createNodeInput;
      
      // verify the required parameter 'createNodeInput' is set
      if (createNodeInput == null) {
        throw new ApiException(400, "Missing the required parameter 'createNodeInput' when calling createNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes";
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<CreateNodeOK> localVarReturnType = new TypeReference<CreateNodeOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Mark a node and any attached files for deletion. If the node is a folder, perform the same action for all its children if the profile type is PROFILE, VC_ROOT, or VC. For other node types, move them to the TRASH_BIN node.
     * @param nodeId  (required)
     * @return DeleteNodeDto
     * @throws ApiException if fails to make API call
     */
    public DeleteNodeDto deleteNode(@javax.annotation.Nonnull String nodeId) throws ApiException {
      return this.deleteNode(nodeId, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Mark a node and any attached files for deletion. If the node is a folder, perform the same action for all its children if the profile type is PROFILE, VC_ROOT, or VC. For other node types, move them to the TRASH_BIN node.
     * @param nodeId  (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return DeleteNodeDto
     * @throws ApiException if fails to make API call
     */
    public DeleteNodeDto deleteNode(@javax.annotation.Nonnull String nodeId, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling deleteNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<DeleteNodeDto> localVarReturnType = new TypeReference<DeleteNodeDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "DELETE",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Gets detailed information about the node
     * @param nodeId  (required)
     * @param dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional)
     * @return GetDetailedNodeInfoOK
     * @throws ApiException if fails to make API call
     */
    public GetDetailedNodeInfoOK getDetailedNodeInfo(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nullable String dek) throws ApiException {
      return this.getDetailedNodeInfo(nodeId, dek, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Gets detailed information about the node
     * @param nodeId  (required)
     * @param dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional)
     * @param additionalHeaders additionalHeaders for this call
     * @return GetDetailedNodeInfoOK
     * @throws ApiException if fails to make API call
     */
    public GetDetailedNodeInfoOK getDetailedNodeInfo(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nullable String dek, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling getDetailedNodeInfo");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarQueryParams.addAll(apiClient.parameterToPair("dek", dek));
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<GetDetailedNodeInfoOK> localVarReturnType = new TypeReference<GetDetailedNodeInfoOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Initialize root node, and TRASH_BIN
     * @return InitNodesOK
     * @throws ApiException if fails to make API call
     * @deprecated
     */
    @Deprecated
    public InitNodesOK initNodes() throws ApiException {
      return this.initNodes(Collections.emptyMap());
    }
  
  
    /**
     * 
     * Initialize root node, and TRASH_BIN
     * @param additionalHeaders additionalHeaders for this call
     * @return InitNodesOK
     * @throws ApiException if fails to make API call
     * @deprecated
     */
    @Deprecated
    public InitNodesOK initNodes(Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // create path and map variables
      String localVarPath = "/v1/nodes/init";
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<InitNodesOK> localVarReturnType = new TypeReference<InitNodesOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * lists children of the node
     * @param nodeId Description for nodeId. (required)
     * @param limit Maximum number of records to fetch in a list (optional, default to 10)
     * @param exclusiveStartKey exclusiveStartKey for retrieving the next batch of data. (optional)
     * @return ListNodeChildrenOK
     * @throws ApiException if fails to make API call
     */
    public ListNodeChildrenOK listNodeChildren(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable String exclusiveStartKey) throws ApiException {
      return this.listNodeChildren(nodeId, limit, exclusiveStartKey, Collections.emptyMap());
    }
  
  
    /**
     * 
     * lists children of the node
     * @param nodeId Description for nodeId. (required)
     * @param limit Maximum number of records to fetch in a list (optional, default to 10)
     * @param exclusiveStartKey exclusiveStartKey for retrieving the next batch of data. (optional)
     * @param additionalHeaders additionalHeaders for this call
     * @return ListNodeChildrenOK
     * @throws ApiException if fails to make API call
     */
    public ListNodeChildrenOK listNodeChildren(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable String exclusiveStartKey, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling listNodeChildren");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}/children"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
      localVarQueryParams.addAll(apiClient.parameterToPair("exclusiveStartKey", exclusiveStartKey));
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<ListNodeChildrenOK> localVarReturnType = new TypeReference<ListNodeChildrenOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * lists children of the root node for the consumer
     * @return ListRootNodeChildrenOK
     * @throws ApiException if fails to make API call
     */
    public ListRootNodeChildrenOK listRootNodeChildren() throws ApiException {
      return this.listRootNodeChildren(Collections.emptyMap());
    }
  
  
    /**
     * 
     * lists children of the root node for the consumer
     * @param additionalHeaders additionalHeaders for this call
     * @return ListRootNodeChildrenOK
     * @throws ApiException if fails to make API call
     */
    public ListRootNodeChildrenOK listRootNodeChildren(Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // create path and map variables
      String localVarPath = "/v1/nodes";
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<ListRootNodeChildrenOK> localVarReturnType = new TypeReference<ListRootNodeChildrenOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Moves a node from source to destination along with the hierarchy
     * @param nodeId  (required)
     * @param moveNodeInput MoveNode (required)
     * @return MoveNodeDto
     * @throws ApiException if fails to make API call
     */
    public MoveNodeDto moveNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull MoveNodeInput moveNodeInput) throws ApiException {
      return this.moveNode(nodeId, moveNodeInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Moves a node from source to destination along with the hierarchy
     * @param nodeId  (required)
     * @param moveNodeInput MoveNode (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return MoveNodeDto
     * @throws ApiException if fails to make API call
     */
    public MoveNodeDto moveNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull MoveNodeInput moveNodeInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = moveNodeInput;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling moveNode");
      }
      
      // verify the required parameter 'moveNodeInput' is set
      if (moveNodeInput == null) {
        throw new ApiException(400, "Missing the required parameter 'moveNodeInput' when calling moveNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}/move"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<MoveNodeDto> localVarReturnType = new TypeReference<MoveNodeDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Permanently delete a node from TRASH_BIN, if the node is not in the TRASH_BIN it cannot delete.
     * @param nodeId nodeId of the TRASH_BIN (required)
     * @param nodeIdToRemove nodeId of the node to be deleted from TRASH_BIN (required)
     * @throws ApiException if fails to make API call
     */
    public void permanentlyDeleteNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull String nodeIdToRemove) throws ApiException {
      this.permanentlyDeleteNode(nodeId, nodeIdToRemove, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Permanently delete a node from TRASH_BIN, if the node is not in the TRASH_BIN it cannot delete.
     * @param nodeId nodeId of the TRASH_BIN (required)
     * @param nodeIdToRemove nodeId of the node to be deleted from TRASH_BIN (required)
     * @param additionalHeaders additionalHeaders for this call
     * @throws ApiException if fails to make API call
     */
    public void permanentlyDeleteNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull String nodeIdToRemove, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling permanentlyDeleteNode");
      }
      
      // verify the required parameter 'nodeIdToRemove' is set
      if (nodeIdToRemove == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeIdToRemove' when calling permanentlyDeleteNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}/remove/{nodeIdToRemove}"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)))
        .replaceAll("\\{" + "nodeIdToRemove" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeIdToRemove)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      apiClient.invokeAPI(
          localVarPath,
          "DELETE",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          null
      );
    }
  
    /**
     * 
     * Restore node marked for deletion from TRASH_BIN
     * @param nodeId nodeId of the TRASH_BIN (required)
     * @param nodeIdToRestore nodeId of the node to be restored from TRASH_BIN (required)
     * @param restoreNodeFromTrashbin RestoreNodeFromTrashbin (required)
     * @return MoveNodeDto
     * @throws ApiException if fails to make API call
     */
    public MoveNodeDto restoreNodeFromTrashbin(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull String nodeIdToRestore, @javax.annotation.Nonnull RestoreNodeFromTrashbin restoreNodeFromTrashbin) throws ApiException {
      return this.restoreNodeFromTrashbin(nodeId, nodeIdToRestore, restoreNodeFromTrashbin, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Restore node marked for deletion from TRASH_BIN
     * @param nodeId nodeId of the TRASH_BIN (required)
     * @param nodeIdToRestore nodeId of the node to be restored from TRASH_BIN (required)
     * @param restoreNodeFromTrashbin RestoreNodeFromTrashbin (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return MoveNodeDto
     * @throws ApiException if fails to make API call
     */
    public MoveNodeDto restoreNodeFromTrashbin(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull String nodeIdToRestore, @javax.annotation.Nonnull RestoreNodeFromTrashbin restoreNodeFromTrashbin, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = restoreNodeFromTrashbin;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling restoreNodeFromTrashbin");
      }
      
      // verify the required parameter 'nodeIdToRestore' is set
      if (nodeIdToRestore == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeIdToRestore' when calling restoreNodeFromTrashbin");
      }
      
      // verify the required parameter 'restoreNodeFromTrashbin' is set
      if (restoreNodeFromTrashbin == null) {
        throw new ApiException(400, "Missing the required parameter 'restoreNodeFromTrashbin' when calling restoreNodeFromTrashbin");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}/restore/{nodeIdToRestore}"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)))
        .replaceAll("\\{" + "nodeIdToRestore" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeIdToRestore)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<MoveNodeDto> localVarReturnType = new TypeReference<MoveNodeDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Updates a node
     * @param nodeId Description for nodeId. (required)
     * @param updateNodeInput UpdateNodeInput (required)
     * @return NodeDto
     * @throws ApiException if fails to make API call
     */
    public NodeDto updateNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull UpdateNodeInput updateNodeInput) throws ApiException {
      return this.updateNode(nodeId, updateNodeInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Updates a node
     * @param nodeId Description for nodeId. (required)
     * @param updateNodeInput UpdateNodeInput (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return NodeDto
     * @throws ApiException if fails to make API call
     */
    public NodeDto updateNode(@javax.annotation.Nonnull String nodeId, @javax.annotation.Nonnull UpdateNodeInput updateNodeInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = updateNodeInput;
      
      // verify the required parameter 'nodeId' is set
      if (nodeId == null) {
        throw new ApiException(400, "Missing the required parameter 'nodeId' when calling updateNode");
      }
      
      // verify the required parameter 'updateNodeInput' is set
      if (updateNodeInput == null) {
        throw new ApiException(400, "Missing the required parameter 'updateNodeInput' when calling updateNode");
      }
      
      // create path and map variables
      String localVarPath = "/v1/nodes/{nodeId}"
        .replaceAll("\\{" + "nodeId" + "\\}", apiClient.escapeString(apiClient.parameterToString(nodeId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      TypeReference<NodeDto> localVarReturnType = new TypeReference<NodeDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "PATCH",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    @Override
    public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
      String localVarPath = url.replace(apiClient.getBaseURL(), "");
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarHeaderParams.putAll(additionalHeaders);
  
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ConsumerTokenAuth" };
  
      return apiClient.invokeAPI(
        localVarPath,
          method,
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          request,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          returnType
      );
    }
  }
  