/// <summary> /// Perform action for single user /// </summary> /// <exception cref="Rakam.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="userEmailActionSend"></param> /// <returns>Task of bool?</returns> public async System.Threading.Tasks.Task <bool?> SendAsync(UserEmailActionSend userEmailActionSend) { ApiResponse <bool?> localVarResponse = await SendAsyncWithHttpInfo(userEmailActionSend); return(localVarResponse.Data); }
/// <summary> /// Perform action for single user /// </summary> /// <exception cref="Rakam.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="userEmailActionSend"></param> /// <returns>Task of ApiResponse (bool?)</returns> public async System.Threading.Tasks.Task <ApiResponse <bool?> > SendAsyncWithHttpInfo(UserEmailActionSend userEmailActionSend) { // verify the required parameter 'userEmailActionSend' is set if (userEmailActionSend == null) { throw new ApiException(400, "Missing required parameter 'userEmailActionSend' when calling UseractionApi->Send"); } var localVarPath = "/user/action/email/single"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <String, String>(); var localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (userEmailActionSend != null && userEmailActionSend.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(userEmailActionSend); // http body (model) parameter } else { localVarPostBody = userEmailActionSend; // byte array } // authentication (read_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("read_key"))) { localVarHeaderParams["read_key"] = Configuration.GetApiKeyWithPrefix("read_key"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("Send", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <bool?>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (bool?)Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?)))); }
/// <summary> /// Perform action for single user /// </summary> /// <exception cref="Rakam.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="userEmailActionSend"></param> /// <returns>bool?</returns> public bool?Send(UserEmailActionSend userEmailActionSend) { ApiResponse <bool?> localVarResponse = SendWithHttpInfo(userEmailActionSend); return(localVarResponse.Data); }