Beispiel #1
0
    private void OnDeleteConfiguration(DeleteConfigurationResponse resp, Dictionary <string, object> customData)
    {
        Log.Debug("ExampleDiscovery.OnDeleteConfiguration()", "Discovery - DeleteConfiguration Response: deleted:{0}", customData["json"].ToString());
        _environmentId = default(string);

        _deleteConfigurationTested = true;
    }
Beispiel #2
0
        public DeleteConfigurationResponse DeleteConfiguration(string environmentId, string configurationId)
        {
            if (string.IsNullOrEmpty(environmentId))
            {
                throw new ArgumentNullException(nameof(environmentId));
            }
            if (string.IsNullOrEmpty(configurationId))
            {
                throw new ArgumentNullException(nameof(configurationId));
            }

            if (string.IsNullOrEmpty(VersionDate))
            {
                throw new ArgumentNullException("versionDate cannot be null. Use 'DISCOVERY_VERSION_DATE_2016_12_01'");
            }

            DeleteConfigurationResponse result = null;

            try
            {
                result = this.Client.WithAuthentication(this.UserName, this.Password)
                         .DeleteAsync($"{this.Endpoint}/v1/environments/{environmentId}/configurations/{configurationId}")
                         .WithArgument("version", VersionDate)
                         .As <DeleteConfigurationResponse>()
                         .Result;
            }
            catch (AggregateException ae)
            {
                throw ae.Flatten();
            }

            return(result);
        }
Beispiel #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)
        {
            DeleteConfigurationResponse response = new DeleteConfigurationResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("arn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Arn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("state", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.State = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Beispiel #4
0
        public async Task <DeleteConfigurationResponse> DeleteConfiguration(DeleteConfigurationRequest o)
        {
            var result = new DeleteConfigurationResponse(o.RequestId);

            result.Deleted = await Server.DeleteSettings(o.Application, o.Key);

            return(result);
        }
Beispiel #5
0
        private void OnDeleteConfiguration(DeleteConfigurationResponse resp, Dictionary <string, object> customData)
        {
            Log.Debug("TestDiscovery.OnDeleteConfiguration()", "Discovery - Delete configuration Response: deleted:{0}", customData["json"].ToString());

            _createdConfigurationID = default(string);
            Test(resp != null);

            _deleteConfigurationTested = true;
        }
Beispiel #6
0
        public static DeleteConfigurationResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteConfigurationResponse deleteConfigurationResponse = new DeleteConfigurationResponse();

            deleteConfigurationResponse.HttpResponse = context.HttpResponse;
            deleteConfigurationResponse.RequestId    = context.StringValue("DeleteConfiguration.RequestId");
            deleteConfigurationResponse.Code         = context.StringValue("DeleteConfiguration.Code");
            deleteConfigurationResponse.Message      = context.StringValue("DeleteConfiguration.Message");

            return(deleteConfigurationResponse);
        }