public UpdateApiKeyResponse UpdateApiKey(UpdateApiKeyRequest request) { UpdateApiKeyResponse response = new UpdateApiKeyResponse(); ThirdPartyClient thirdPartyClient = Mapper.Map <ThirdPartyClientViewModel, ThirdPartyClient>(request.ThirdPartyClientViewModel); thirdPartyClientRepository.UpdateThirdPartyClient(thirdPartyClient); return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateApiKeyResponse response = new UpdateApiKeyResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("enabled", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.Enabled = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Id = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastUpdatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("stageKeys", targetDepth)) { var unmarshaller = new ListUnmarshaller <string, StringUnmarshaller>(StringUnmarshaller.Instance); response.StageKeys = unmarshaller.Unmarshall(context); continue; } } return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateApiKeyResponse response = new UpdateApiKeyResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiKey", targetDepth)) { var unmarshaller = ApiKeyUnmarshaller.Instance; response.ApiKey = unmarshaller.Unmarshall(context); continue; } } return(response); }
/// <summary> /// Updates the API key. /// </summary> /// <param name="apiKeys">The API keys.</param> /// <returns></returns> public JsonResult UpdateApiKey(string apiKeys) { int UserID = this.Identity.ToUserID(); int userID = UserExtensions.ToUserID(this.Identity); ThirdPartyClientViewModel thirdPartyClientViewmodel = JsonConvert.DeserializeObject <ThirdPartyClientViewModel>(apiKeys); thirdPartyClientViewmodel.LastUpdatedOn = DateTime.Now.ToUniversalTime(); thirdPartyClientViewmodel.LastUpdatedBy = userID; UpdateApiKeyResponse response = thirdPartyClientService.UpdateApiKey(new UpdateApiKeyRequest() { ThirdPartyClientViewModel = thirdPartyClientViewmodel, RequestedBy = UserID, AccountId = this.Identity.ToAccountID() }); return(Json(new { success = true, response = response }, JsonRequestBehavior.AllowGet)); }