public void NotificationTemplate_Property_Count() { var notificationTemplate = new NotificationTemplate(); Assert.AreEqual(10, notificationTemplate.GetType().GetProperties().Count()); }
/// <summary> /// Update notification template /// </summary> /// <exception cref="VirtoCommerce.Platform.Client.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="notificationTemplate">Notification template</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task<ApiResponse<object>> NotificationsUpdateNotificationTemplateAsyncWithHttpInfo(NotificationTemplate notificationTemplate) { // verify the required parameter 'notificationTemplate' is set if (notificationTemplate == null) throw new ApiException(400, "Missing required parameter 'notificationTemplate' when calling VirtoCommercePlatformApi->NotificationsUpdateNotificationTemplate"); var localVarPath = "/api/platform/notification/template"; 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", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; string localVarHttpContentType = ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header string[] localVarHttpHeaderAccepts = new string[] { }; string localVarHttpHeaderAccept = 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 (notificationTemplate.GetType() != typeof(byte[])) { localVarPostBody = ApiClient.Serialize(notificationTemplate); // http body (model) parameter } else { localVarPostBody = notificationTemplate; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (localVarStatusCode >= 400 && (localVarStatusCode != 404 || Configuration.ThrowExceptionWhenStatusCodeIs404)) throw new ApiException(localVarStatusCode, "Error calling NotificationsUpdateNotificationTemplate: " + localVarResponse.Content, localVarResponse.Content); else if (localVarStatusCode == 0) throw new ApiException(localVarStatusCode, "Error calling NotificationsUpdateNotificationTemplate: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); return new ApiResponse<object>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); }