public void ResourcesCorpusSegmentAddPostTest()
 {
     CorpusSegmentAddRequest corpusSegmentAddRequest = new CorpusSegmentAddRequest();
     corpusSegmentAddRequest.CorpusId = corpusId;
     CorpusAddSegment corpusAddSegment = new CorpusAddSegment();
     List<CorpusAddSegment> segList = new List<CorpusAddSegment>();
     corpusAddSegment.Source = "Illustation";
     corpusAddSegment.Lang = "en";
     CorpusAddSegmentTarget corpusAddSegmentTarget = new CorpusAddSegmentTarget();
     corpusAddSegmentTarget.Lang = "fr";
     corpusAddSegmentTarget.Target = "nouveau segment cible";
     List<CorpusAddSegmentTarget> targList = new List<CorpusAddSegmentTarget>();
     targList.Add(corpusAddSegmentTarget);
     corpusAddSegment.Targets = targList;
     segList.Add(corpusAddSegment);
     corpusSegmentAddRequest.Segments = segList;
     CorpusSegmentAddResponse corpusSegmentAddResponse = new CorpusSegmentAddResponse();
     corpusSegmentAddResponse = corpusApi.ResourcesCorpusSegmentAddPost(corpusSegmentAddRequest, null);
     Assert.IsNotNull(corpusSegmentAddResponse.Segments);
 }
    /// <summary>
    /// Add corpus segments Add segments in a corpus.\n
    /// </summary>
    /// <param name="Body">List of segments to add</param>/// <param name="Callback">Javascript callback function name for JSONP Support\n</param>
    /// <returns>CorpusSegmentAddResponse</returns>
    public CorpusSegmentAddResponse ResourcesCorpusSegmentAddPost (CorpusSegmentAddRequest Body, string Callback) {

      
      // verify the required parameter 'Body' is set
      if (Body == null) throw new ApiException(400, "Missing required parameter 'Body' when calling ResourcesCorpusSegmentAddPost");
      

      var path = "/resources/corpus/segment/add";
      path = path.Replace("{format}", "json");
      

      var queryParams = new Dictionary<String, String>();
      var headerParams = new Dictionary<String, String>();
      var formParams = new Dictionary<String, String>();
      var fileParams = new Dictionary<String, String>();
      String postBody = null;

       if (Callback != null) queryParams.Add("callback", apiClient.ParameterToString(Callback)); // query parameter
      
      
      
      postBody = apiClient.Serialize(Body); // http body (model) parameter
      

      // authentication setting, if any
      String[] authSettings = new String[] { "accessToken", "apiKey" };

      // make the HTTP request
      IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

      if (((int)response.StatusCode) >= 400) {
        throw new ApiException ((int)response.StatusCode, "Error calling ResourcesCorpusSegmentAddPost: " + response.Content, response.Content);
      }
      return (CorpusSegmentAddResponse) apiClient.Deserialize(response.Content, typeof(CorpusSegmentAddResponse));
    }