/// <summary>
 /// Initializes a new instance of the <see cref="InlineObject2" /> class.
 /// </summary>
 /// <param name="status">status (required).</param>
 /// <param name="marker">marker.</param>
 /// <param name="file">a file (required).</param>
 public InlineObject2(MultipartMixedStatus status = default(MultipartMixedStatus), MultipartMixedMarker marker = default(MultipartMixedMarker), System.IO.Stream file = default(System.IO.Stream))
 {
     this.Status = status;
     // to ensure "file" is required (not null)
     if (file == null)
     {
         throw new ArgumentNullException("file is a required property for InlineObject2 and cannot be null");
     }
     this.File   = file;
     this.Marker = marker;
 }
Beispiel #2
0
 /// <summary>
 ///  Mixed MultipartFile test
 /// </summary>
 /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="status"></param>
 /// <param name="file">a file</param>
 /// <param name="marker"> (optional)</param>
 /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     await MultipartMixedWithHttpInfoAsync(status, file, marker, cancellationToken).ConfigureAwait(false);
 }
Beispiel #3
0
        /// <summary>
        ///  Mixed MultipartFile test
        /// </summary>
        /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="status"></param>
        /// <param name="file">a file</param>
        /// <param name="marker"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <Org.OpenAPITools.Client.ApiResponse <Object> > MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'file' is set
            if (file == null)
            {
                throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed");
            }


            Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();

            string[] _contentTypes = new string[] {
                "multipart/form-data"
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
            };

            var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter
            if (marker != null)
            {
                localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.ParameterToString(marker)); // form parameter
            }
            localVarRequestOptions.FileParameters.Add("file", file);


            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/multipart-mixed", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Beispiel #4
0
 /// <summary>
 ///  Mixed MultipartFile test
 /// </summary>
 /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="status"></param>
 /// <param name="file">a file</param>
 /// <param name="marker"> (optional)</param>
 /// <returns></returns>
 public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker))
 {
     MultipartMixedWithHttpInfo(status, file, marker);
 }