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.CreateAccountInput;
  import com.affinidi.tdk.vault.data.manager.client.models.CreateAccountOK;
  import com.affinidi.tdk.vault.data.manager.client.models.DeleteAccountDto;
  import com.affinidi.tdk.vault.data.manager.client.models.InvalidParameterError;
  import com.affinidi.tdk.vault.data.manager.client.models.ListAccountsDto;
  import com.affinidi.tdk.vault.data.manager.client.models.UpdateAccountDto;
  import com.affinidi.tdk.vault.data.manager.client.models.UpdateAccountInput;
  
  
  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 AccountsApi extends BaseApi {
  
    public AccountsApi() {
      super(Configuration.getDefaultApiClient());
    }
  
    public AccountsApi(ApiClient apiClient) {
      super(apiClient);
    }
  
    /**
     * 
     * creates account
     * @param createAccountInput CreateAccount (required)
     * @return CreateAccountOK
     * @throws ApiException if fails to make API call
     */
    public CreateAccountOK createAccount(@javax.annotation.Nonnull CreateAccountInput createAccountInput) throws ApiException {
      return this.createAccount(createAccountInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * creates account
     * @param createAccountInput CreateAccount (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return CreateAccountOK
     * @throws ApiException if fails to make API call
     */
    public CreateAccountOK createAccount(@javax.annotation.Nonnull CreateAccountInput createAccountInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = createAccountInput;
      
      // verify the required parameter 'createAccountInput' is set
      if (createAccountInput == null) {
        throw new ApiException(400, "Missing the required parameter 'createAccountInput' when calling createAccount");
      }
      
      // create path and map variables
      String localVarPath = "/v1/accounts";
  
      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<CreateAccountOK> localVarReturnType = new TypeReference<CreateAccountOK>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Delete account.
     * @param accountIndex  (required)
     * @return DeleteAccountDto
     * @throws ApiException if fails to make API call
     */
    public DeleteAccountDto deleteAccount(@javax.annotation.Nonnull Integer accountIndex) throws ApiException {
      return this.deleteAccount(accountIndex, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Delete account.
     * @param accountIndex  (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return DeleteAccountDto
     * @throws ApiException if fails to make API call
     */
    public DeleteAccountDto deleteAccount(@javax.annotation.Nonnull Integer accountIndex, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'accountIndex' is set
      if (accountIndex == null) {
        throw new ApiException(400, "Missing the required parameter 'accountIndex' when calling deleteAccount");
      }
      
      // create path and map variables
      String localVarPath = "/v1/accounts/{accountIndex}"
        .replaceAll("\\{" + "accountIndex" + "\\}", apiClient.escapeString(apiClient.parameterToString(accountIndex)));
  
      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<DeleteAccountDto> localVarReturnType = new TypeReference<DeleteAccountDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "DELETE",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * List accounts of associated profiles.
     * @param limit Maximum number of accounts to fetch in a list (optional, default to 50)
     * @param exclusiveStartKey The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional)
     * @return ListAccountsDto
     * @throws ApiException if fails to make API call
     */
    public ListAccountsDto listAccounts(@javax.annotation.Nullable Integer limit, @javax.annotation.Nullable String exclusiveStartKey) throws ApiException {
      return this.listAccounts(limit, exclusiveStartKey, Collections.emptyMap());
    }
  
  
    /**
     * 
     * List accounts of associated profiles.
     * @param limit Maximum number of accounts to fetch in a list (optional, default to 50)
     * @param exclusiveStartKey The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional)
     * @param additionalHeaders additionalHeaders for this call
     * @return ListAccountsDto
     * @throws ApiException if fails to make API call
     */
    public ListAccountsDto listAccounts(@javax.annotation.Nullable Integer limit, @javax.annotation.Nullable String exclusiveStartKey, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // create path and map variables
      String localVarPath = "/v1/accounts";
  
      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<ListAccountsDto> localVarReturnType = new TypeReference<ListAccountsDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Update account.
     * @param accountIndex  (required)
     * @param updateAccountInput UpdateAccount (required)
     * @return UpdateAccountDto
     * @throws ApiException if fails to make API call
     */
    public UpdateAccountDto updateAccount(@javax.annotation.Nonnull Integer accountIndex, @javax.annotation.Nonnull UpdateAccountInput updateAccountInput) throws ApiException {
      return this.updateAccount(accountIndex, updateAccountInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Update account.
     * @param accountIndex  (required)
     * @param updateAccountInput UpdateAccount (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return UpdateAccountDto
     * @throws ApiException if fails to make API call
     */
    public UpdateAccountDto updateAccount(@javax.annotation.Nonnull Integer accountIndex, @javax.annotation.Nonnull UpdateAccountInput updateAccountInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = updateAccountInput;
      
      // verify the required parameter 'accountIndex' is set
      if (accountIndex == null) {
        throw new ApiException(400, "Missing the required parameter 'accountIndex' when calling updateAccount");
      }
      
      // verify the required parameter 'updateAccountInput' is set
      if (updateAccountInput == null) {
        throw new ApiException(400, "Missing the required parameter 'updateAccountInput' when calling updateAccount");
      }
      
      // create path and map variables
      String localVarPath = "/v1/accounts/{accountIndex}"
        .replaceAll("\\{" + "accountIndex" + "\\}", apiClient.escapeString(apiClient.parameterToString(accountIndex)));
  
      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<UpdateAccountDto> localVarReturnType = new TypeReference<UpdateAccountDto>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "PUT",
          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
      );
    }
  }
  