/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ScheduleKeyDeletionResponse response = new ScheduleKeyDeletionResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("DeletionDate", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.DeletionDate = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("KeyId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.KeyId = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Example #2
0
        public static ScheduleKeyDeletionResponse Unmarshall(UnmarshallerContext context)
        {
            ScheduleKeyDeletionResponse scheduleKeyDeletionResponse = new ScheduleKeyDeletionResponse();

            scheduleKeyDeletionResponse.HttpResponse = context.HttpResponse;
            scheduleKeyDeletionResponse.RequestId    = context.StringValue("ScheduleKeyDeletion.RequestId");

            return(scheduleKeyDeletionResponse);
        }
        public static ScheduleKeyDeletionResponse Unmarshall(UnmarshallerContext context)
        {
            ScheduleKeyDeletionResponse scheduleKeyDeletionResponse = new ScheduleKeyDeletionResponse();

            scheduleKeyDeletionResponse.HttpResponse = context.HttpResponse;
            scheduleKeyDeletionResponse.RequestId = context.StringValue("ScheduleKeyDeletion.RequestId");

            return scheduleKeyDeletionResponse;
        }
Example #4
0
        private static async Task ScheduleKeyDeletion(KmsManagementClient kmsManagementClient, string keyId)
        {
            ScheduleKeyDeletionDetails scheduleKeyDeletionDetails = new ScheduleKeyDeletionDetails
            {
                TimeOfDeletion = null
            };
            ScheduleKeyDeletionRequest scheduleKeyDeletionRequest = new ScheduleKeyDeletionRequest
            {
                KeyId = keyId,
                ScheduleKeyDeletionDetails = scheduleKeyDeletionDetails
            };
            ScheduleKeyDeletionResponse scheduleKeyDeletionResponse = await kmsManagementClient.ScheduleKeyDeletion(scheduleKeyDeletionRequest);

            logger.Info($"Key Scheduled deletion Successfully: {scheduleKeyDeletionResponse.Key.DisplayName}");
        }