All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.factset.sdk.IRNNotes.api.AttachmentsApi Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
package com.factset.sdk.IRNNotes.api;

import com.factset.sdk.IRNNotes.ApiException;
import com.factset.sdk.IRNNotes.ApiClient;
import com.factset.sdk.IRNNotes.ApiResponse;
import com.factset.sdk.IRNNotes.Configuration;
import com.factset.sdk.IRNNotes.Pair;

import jakarta.ws.rs.core.GenericType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import com.factset.sdk.IRNNotes.models.AttachmentSummaryDto;
import java.io.File;
import com.factset.sdk.IRNNotes.models.NewItemDto;
import com.factset.sdk.IRNNotes.models.ProblemDetails;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")

public class AttachmentsApi {
  private ApiClient apiClient;

  public AttachmentsApi() {
    this(Configuration.getDefaultApiClient());
  }

  public AttachmentsApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }
  
  private static final Map createAttachmentResponseTypeMap = new HashMap();
  static {
    createAttachmentResponseTypeMap.put(201, new GenericType(){});
    createAttachmentResponseTypeMap.put(400, new GenericType(){});
    createAttachmentResponseTypeMap.put(0, new GenericType(){});
  }

  private static final Map downloadAttachmentResponseTypeMap = new HashMap();

  private static final Map getAttachmentsResponseTypeMap = new HashMap();
  static {
    getAttachmentsResponseTypeMap.put(200, new GenericType>(){});
    getAttachmentsResponseTypeMap.put(404, new GenericType(){});
    getAttachmentsResponseTypeMap.put(0, new GenericType(){});
  }

  private static final Map softDeleteNoteAttachmentResponseTypeMap = new HashMap();

  


  /**
   * Get the API client
   *
   * @return API client
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /**
   * Set the API client
   *
   * @param apiClient an instance of API client
   */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Create an attachment for an existing note
   * 
   * @param noteId  (required)
   * @param _file  (required)
   * @return NewItemDto
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Status Code Description Response Headers
201 Created -
400 Bad Request -
0 Error -
*/ public NewItemDto createAttachment(java.util.UUID noteId, File _file) throws ApiException { return createAttachmentWithHttpInfo(noteId, _file).getData(); } /** * Create an attachment for an existing note * * @param noteId (required) * @param _file (required) * @return ApiResponse<NewItemDto> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
201 Created -
400 Bad Request -
0 Error -
*/ public ApiResponse createAttachmentWithHttpInfo(java.util.UUID noteId, File _file) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'noteId' is set if (noteId == null) { throw new ApiException(400, "Missing the required parameter 'noteId' when calling createAttachment"); } // verify the required parameter '_file' is set if (_file == null) { throw new ApiException(400, "Missing the required parameter '_file' when calling createAttachment"); } // create path and map variables String localVarPath = "/v1/notes/{noteId}/attachments" .replaceAll("\\{" + "noteId" + "\\}", apiClient.escapeString(noteId.toString())); // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); if (_file != null) localVarFormParams.put("file", _file); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "multipart/form-data" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< NewItemDto > apiResponse = apiClient.invokeAPI("AttachmentsApi.createAttachment", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, createAttachmentResponseTypeMap, false); return apiResponse; } /** * Download an attachment from a Note * * @param noteId (required) * @param attachmentId (required) * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
*/ public void downloadAttachment(java.util.UUID noteId, java.util.UUID attachmentId) throws ApiException { downloadAttachmentWithHttpInfo(noteId, attachmentId); } /** * Download an attachment from a Note * * @param noteId (required) * @param attachmentId (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
*/ public ApiResponse downloadAttachmentWithHttpInfo(java.util.UUID noteId, java.util.UUID attachmentId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'noteId' is set if (noteId == null) { throw new ApiException(400, "Missing the required parameter 'noteId' when calling downloadAttachment"); } // verify the required parameter 'attachmentId' is set if (attachmentId == null) { throw new ApiException(400, "Missing the required parameter 'attachmentId' when calling downloadAttachment"); } // create path and map variables String localVarPath = "/v1/notes/{noteId}/attachments/{attachmentId}/download" .replaceAll("\\{" + "noteId" + "\\}", apiClient.escapeString(noteId.toString())) .replaceAll("\\{" + "attachmentId" + "\\}", apiClient.escapeString(attachmentId.toString())); // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< Void > apiResponse = apiClient.invokeAPI("AttachmentsApi.downloadAttachment", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, downloadAttachmentResponseTypeMap, false); return apiResponse; } /** * Get all the attachments belonging to a note * * @param noteId Note Id (required) * @return java.util.List * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
404 Not Found -
0 Error -
*/ public java.util.List getAttachments(java.util.UUID noteId) throws ApiException { return getAttachmentsWithHttpInfo(noteId).getData(); } /** * Get all the attachments belonging to a note * * @param noteId Note Id (required) * @return ApiResponse<java.util.List> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
404 Not Found -
0 Error -
*/ public ApiResponse> getAttachmentsWithHttpInfo(java.util.UUID noteId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'noteId' is set if (noteId == null) { throw new ApiException(400, "Missing the required parameter 'noteId' when calling getAttachments"); } // create path and map variables String localVarPath = "/v1/notes/{noteId}/attachments" .replaceAll("\\{" + "noteId" + "\\}", apiClient.escapeString(noteId.toString())); // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< java.util.List > apiResponse = apiClient.invokeAPI("AttachmentsApi.getAttachments", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, getAttachmentsResponseTypeMap, false); return apiResponse; } /** * Delete attachment from note * * @param noteId Note Id (required) * @param attachmentId Attachment Id (required) * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
*/ public void softDeleteNoteAttachment(java.util.UUID noteId, java.util.UUID attachmentId) throws ApiException { softDeleteNoteAttachmentWithHttpInfo(noteId, attachmentId); } /** * Delete attachment from note * * @param noteId Note Id (required) * @param attachmentId Attachment Id (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
*/ public ApiResponse softDeleteNoteAttachmentWithHttpInfo(java.util.UUID noteId, java.util.UUID attachmentId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'noteId' is set if (noteId == null) { throw new ApiException(400, "Missing the required parameter 'noteId' when calling softDeleteNoteAttachment"); } // verify the required parameter 'attachmentId' is set if (attachmentId == null) { throw new ApiException(400, "Missing the required parameter 'attachmentId' when calling softDeleteNoteAttachment"); } // create path and map variables String localVarPath = "/v1/notes/{noteId}/attachments/{attachmentId}" .replaceAll("\\{" + "noteId" + "\\}", apiClient.escapeString(noteId.toString())) .replaceAll("\\{" + "attachmentId" + "\\}", apiClient.escapeString(attachmentId.toString())); // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< Void > apiResponse = apiClient.invokeAPI("AttachmentsApi.softDeleteNoteAttachment", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, softDeleteNoteAttachmentResponseTypeMap, false); return apiResponse; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy