/// <summary> /// Send push message Deploys and sends a push message /// </summary> /// <exception cref="org.egoi.client.api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="campaignHash">ID of the Campaign</param> /// <param name="campaignPushSendRequest">Parameters for the 'send push' action</param> /// <returns>Task of AcceptedResponse</returns> public async System.Threading.Tasks.Task <AcceptedResponse> ActionSendPushAsync(string campaignHash, CampaignPushSendRequest campaignPushSendRequest) { ApiResponse <AcceptedResponse> localVarResponse = await ActionSendPushAsyncWithHttpInfo(campaignHash, campaignPushSendRequest); return(localVarResponse.Data); }
/// <summary> /// Send push message Deploys and sends a push message /// </summary> /// <exception cref="org.egoi.client.api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="campaignHash">ID of the Campaign</param> /// <param name="campaignPushSendRequest">Parameters for the 'send push' action</param> /// <returns>Task of ApiResponse (AcceptedResponse)</returns> public async System.Threading.Tasks.Task <ApiResponse <AcceptedResponse> > ActionSendPushAsyncWithHttpInfo(string campaignHash, CampaignPushSendRequest campaignPushSendRequest) { // verify the required parameter 'campaignHash' is set if (campaignHash == null) { throw new ApiException(400, "Missing required parameter 'campaignHash' when calling PushApi->ActionSendPush"); } // verify the required parameter 'campaignPushSendRequest' is set if (campaignPushSendRequest == null) { throw new ApiException(400, "Missing required parameter 'campaignPushSendRequest' when calling PushApi->ActionSendPush"); } var localVarPath = "/campaigns/push/{campaign_hash}/actions/send"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.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 = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (campaignHash != null) { localVarPathParams.Add("campaign_hash", this.Configuration.ApiClient.ParameterToString(campaignHash)); // path parameter } if (campaignPushSendRequest != null && campaignPushSendRequest.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(campaignPushSendRequest); // http body (model) parameter } else { localVarPostBody = campaignPushSendRequest; // byte array } // authentication (Apikey) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Apikey"))) { localVarHeaderParams["Apikey"] = this.Configuration.GetApiKeyWithPrefix("Apikey"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ActionSendPush", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <AcceptedResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (AcceptedResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(AcceptedResponse)))); }
/// <summary> /// Send push message Deploys and sends a push message /// </summary> /// <exception cref="org.egoi.client.api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="campaignHash">ID of the Campaign</param> /// <param name="campaignPushSendRequest">Parameters for the 'send push' action</param> /// <returns>AcceptedResponse</returns> public AcceptedResponse ActionSendPush(string campaignHash, CampaignPushSendRequest campaignPushSendRequest) { ApiResponse <AcceptedResponse> localVarResponse = ActionSendPushWithHttpInfo(campaignHash, campaignPushSendRequest); return(localVarResponse.Data); }