Ejemplo n.º 1
0
        public DeleteServiceResponse DeleteService(DeleteServiceRequest request)
        {
            var response = new DeleteServiceResponse {
                ResponseStatus = ResponseStatus.Success
            };

            var settingsProvider = new SettingsProvider();

            try
            {
                if (request.ActionType == ActionType.Delete)
                {
                    response.isSuccessful = settingsProvider.DeleteService(request);
                }
                else
                {
                    response.ResponseStatus      = ResponseStatus.Failure;
                    response.ResponseDescription = "Not update action";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus      = ResponseStatus.Failure;
                response.ResponseDescription = ex.Message;
            }
            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)
        {
            DeleteServiceResponse response = new DeleteServiceResponse();


            return(response);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeleteServiceResponse response = new DeleteServiceResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("OperationId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.OperationId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Service", targetDepth))
                {
                    var unmarshaller = ServiceUnmarshaller.Instance;
                    response.Service = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeleteServiceResponse response = new DeleteServiceResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("ApplicationId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ApplicationId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Arn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Arn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("EnvironmentId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.EnvironmentId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("LastUpdatedTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastUpdatedTime = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ServiceId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ServiceId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("State", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.State = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        public static DeleteServiceResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteServiceResponse deleteServiceResponse = new DeleteServiceResponse();

            deleteServiceResponse.HttpResponse = context.HttpResponse;
            deleteServiceResponse.Code         = context.IntegerValue("DeleteService.Code");
            deleteServiceResponse.Message      = context.StringValue("DeleteService.Message");
            deleteServiceResponse.RequestId    = context.StringValue("DeleteService.RequestId");

            return(deleteServiceResponse);
        }
Ejemplo n.º 6
0
        public static DeleteServiceResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteServiceResponse deleteServiceResponse = new DeleteServiceResponse();

            deleteServiceResponse.HttpResponse = context.HttpResponse;
            deleteServiceResponse.Code         = context.IntegerValue("DeleteService.Code");
            deleteServiceResponse.ErrMsg       = context.StringValue("DeleteService.ErrMsg");
            deleteServiceResponse.RequestId    = context.StringValue("DeleteService.RequestId");
            deleteServiceResponse.Success      = context.BooleanValue("DeleteService.Success");

            return(deleteServiceResponse);
        }
Ejemplo n.º 7
0
        public void TestDeleteServiceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""da005992-5a54-4658-830d-fe6b3d4c707b"",
    ""created_at"": ""2016-09-02T11:52:11Z"",
    ""url"": ""/v2/jobs/ac108b04-21a9-482c-ad44-159dff6c031b""
  },
  ""entity"": {
    ""guid"": ""da005992-5a54-4658-830d-fe6b3d4c707b"",
    ""status"": ""queued""
  }
}";

            DeleteServiceResponse obj = Utilities.DeserializeJson <DeleteServiceResponse>(json);

            Assert.AreEqual("da005992-5a54-4658-830d-fe6b3d4c707b", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("2016-09-02T11:52:11Z", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("/v2/jobs/ac108b04-21a9-482c-ad44-159dff6c031b", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("da005992-5a54-4658-830d-fe6b3d4c707b", TestUtil.ToTestableString(obj.Guid), true);
            Assert.AreEqual("queued", TestUtil.ToTestableString(obj.Status), true);
        }