Exemplo n.º 1
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)
        {
            UpdateAliasResponse response = new UpdateAliasResponse();


            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)
        {
            UpdateAliasResponse response = new UpdateAliasResponse();


            return response;
        }
        public static UpdateAliasResponse Unmarshall(UnmarshallerContext context)
        {
            UpdateAliasResponse updateAliasResponse = new UpdateAliasResponse();

            updateAliasResponse.HttpResponse = context.HttpResponse;
            updateAliasResponse.RequestId    = context.StringValue("UpdateAlias.RequestId");

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("AliasArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.AliasArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Description", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Description = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("FunctionVersion", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.FunctionVersion = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("RevisionId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.RevisionId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("RoutingConfig", targetDepth))
                {
                    var unmarshaller = AliasRoutingConfigurationUnmarshaller.Instance;
                    response.RoutingConfig = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemplo n.º 5
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)
        {
            UpdateAliasResponse response = new UpdateAliasResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Alias", targetDepth))
                {
                    var unmarshaller = AliasUnmarshaller.Instance;
                    response.Alias = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Update the function version to which the alias points and the alias description.
        /// </summary>
        /// <param name="functionName">The name of an AWS Lambda function.</param>
        /// <param name="settings">The <see cref="AliasSettings"/> used during the request to AWS.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async Task <bool> UpdateAlias(string functionName, AliasSettings settings, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (String.IsNullOrEmpty(functionName))
            {
                throw new ArgumentNullException(nameof(functionName));
            }



            // Create Request
            AmazonLambdaClient client = this.CreateClient(settings);

            UpdateAliasRequest request = new UpdateAliasRequest()
            {
                Name = settings.Name,

                FunctionName    = functionName,
                FunctionVersion = settings.Version,

                Description = settings.Description
            };



            // Check Response
            UpdateAliasResponse response = await client.UpdateAliasAsync(request, cancellationToken);

            if (response.HttpStatusCode == HttpStatusCode.OK)
            {
                _Log.Verbose("Successfully published function '{0}'", functionName);
                return(true);
            }
            else
            {
                _Log.Error("Failed to published function '{0}'", functionName);
                return(false);
            }
        }
Exemplo n.º 7
0
        public async Task <IActionResult> UpdateVisaAliasAsync([FromBody] UpdateAliasRequest request)
        {
            UpdateAliasResponse response = await _AcbaVisaAliasService.UpdateVisaAliasAsync(request);

            return(Ok(response));
        }