DescribePlatformVersionResponse

We found 10 examples in language CSharp for this search. You will see 21 fragments of code.
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribePlatformVersionResponse response = new DescribePlatformVersionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {                    
                    if(context.TestExpression("DescribePlatformVersionResult", 2))
                    {
                        UnmarshallResult(context, response);                        
                        continue;
                    }
                    
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return response;
        }

        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribePlatformVersionResponse response)
        {
            
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            
            if (context.IsStartOfDocument) 
               targetDepth += 2;
            
            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {

                    if (context.TestExpression("PlatformDescription", targetDepth))
                    {
                        var unmarshaller = PlatformDescriptionUnmarshaller.Instance;
                        response.PlatformDescription = unmarshaller.Unmarshall(context);
                        continue;
                    }
                } 
           }

            return;
        }


        /// <summary>
        /// Unmarshaller error response to exception.
        /// </summary>  
        /// <param name="context"></param>
        /// <param name="innerException"></param>
        /// <param name="statusCode"></param>
        /// <returns></returns>
        public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            errorResponse.InnerException = innerException;
            errorResponse.StatusCode = statusCode;

            var responseBodyBytes = context.GetResponseBodyBytes();

            using (var streamCopy = new MemoryStream(responseBodyBytes))
            using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null))
            {
                if (errorResponse.Code != null && errorResponse.Code.Equals("ElasticBeanstalkServiceException"))
                {
                    return ElasticBeanstalkServiceExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
                }
                if (errorResponse.Code != null && errorResponse.Code.Equals("InsufficientPrivilegesException"))
                {
                    return InsufficientPrivilegesExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
                }
            }
            return new AmazonElasticBeanstalkException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }

        internal static DescribePlatformVersionResponseUnmarshaller GetInstance()
        {
            return _instance;
        }

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

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {                    
                    if(context.TestExpression("DescribePlatformVersionResult", 2))
                    {
                        UnmarshallResult(context, response);                        
                        continue;
                    }
                    
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return response;
        }

        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribePlatformVersionResponse response)
        {
            
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            
            if (context.IsStartOfDocument) 
               targetDepth += 2;
            
            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {

                    if (context.TestExpression("PlatformDescription", targetDepth))
                    {
                        var unmarshaller = PlatformDescriptionUnmarshaller.Instance;
                        response.PlatformDescription = unmarshaller.Unmarshall(context);
                        continue;
                    }
                } 
           }

            return;
        }


        /// <summary>
        /// Unmarshaller error response to exception.
        /// </summary>  
        /// <param name="context"></param>
        /// <param name="innerException"></param>
        /// <param name="statusCode"></param>
        /// <returns></returns>
        public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            errorResponse.InnerException = innerException;
            errorResponse.StatusCode = statusCode;

            var responseBodyBytes = context.GetResponseBodyBytes();

            using (var streamCopy = new MemoryStream(responseBodyBytes))
            using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null))
            {
                if (errorResponse.Code != null && errorResponse.Code.Equals("ElasticBeanstalkServiceException"))
                {
                    return ElasticBeanstalkServiceExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
                }
                if (errorResponse.Code != null && errorResponse.Code.Equals("InsufficientPrivilegesException"))
                {
                    return InsufficientPrivilegesExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
                }
            }
            return new AmazonElasticBeanstalkException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }

        internal static DescribePlatformVersionResponseUnmarshaller GetInstance()
        {
            return _instance;
        }


        public async Task<string> GetLatestAmiVersionAsync(string platformArn)
        {
            _logger.LogInformation("Retrieving Beanstalk Platform {BeanstalkPlatformArn}", platformArn);

            DescribePlatformVersionResponse versionsResponse = await _beanstalkClient.DescribePlatformVersionAsync(new DescribePlatformVersionRequest
            {
                PlatformArn = platformArn
            });

            CustomAmi ami = versionsResponse.PlatformDescription
                                            .CustomAmiList
                                            .FirstOrDefault(a => a.VirtualizationType.Equals("hvm", StringComparison.OrdinalIgnoreCase));

            return ami?.ImageId;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        // Check to see if PlatformDescription property is set
        internal bool IsSetPlatformDescription()
        {
            return this._platformDescription != null;
        }


        #endregion
#if AWS_ASYNC_ENUMERABLES_API
        private IElasticBeanstalkPaginatorFactory _paginators;

        /// <summary>
        /// Paginators for the service
        /// </summary>
        public IElasticBeanstalkPaginatorFactory Paginators 
        {
            get 
            {
                if (this._paginators == null) 
                {
                    this._paginators = new ElasticBeanstalkPaginatorFactory(this);
                }
                return this._paginators;
            }
        }
#endif

        #region Overrides

        /// <summary>
        /// Creates the signer for the service.
        /// </summary>
        protected override AbstractAWSSigner CreateSigner()
        {
            return new AWS4Signer();
        } 

        #endregion

        #region Dispose

        /// <summary>
        /// Disposes the service client.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
        }

        #endregion


        #region  AbortEnvironmentUpdate

        internal virtual AbortEnvironmentUpdateResponse AbortEnvironmentUpdate(AbortEnvironmentUpdateRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = AbortEnvironmentUpdateRequestMarshaller.Instance;
            options.ResponseUnmarshaller = AbortEnvironmentUpdateResponseUnmarshaller.Instance;

            return Invoke<AbortEnvironmentUpdateResponse>(request, options);
        }



        /// <summary>
        /// Cancels in-progress environment configuration update or application version deployment.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the AbortEnvironmentUpdate service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// 
        /// <returns>The response from the AbortEnvironmentUpdate service method, as returned by ElasticBeanstalk.</returns>
        /// <exception cref="Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException">
        /// The specified account does not have sufficient privileges for one or more AWS services.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdate">REST API Reference for AbortEnvironmentUpdate Operation</seealso>
        public virtual Task<AbortEnvironmentUpdateResponse> AbortEnvironmentUpdateAsync(AbortEnvironmentUpdateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = AbortEnvironmentUpdateRequestMarshaller.Instance;
            options.ResponseUnmarshaller = AbortEnvironmentUpdateResponseUnmarshaller.Instance;

            return InvokeAsync<AbortEnvironmentUpdateResponse>(request, options, cancellationToken);
        }

        #endregion
        
        #region  ApplyEnvironmentManagedAction

        internal virtual ApplyEnvironmentManagedActionResponse ApplyEnvironmentManagedAction(ApplyEnvironmentManagedActionRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = ApplyEnvironmentManagedActionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ApplyEnvironmentManagedActionResponseUnmarshaller.Instance;

            return Invoke<ApplyEnvironmentManagedActionResponse>(request, options);
        }



        /// <summary>
        /// Applies a scheduled managed action immediately. A managed action can be applied only
        /// if its status is <code>Scheduled</code>. Get the status and action ID of a managed
        /// action with <a>DescribeEnvironmentManagedActions</a>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ApplyEnvironmentManagedAction service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// 
        /// <returns>The response from the ApplyEnvironmentManagedAction service method, as returned by ElasticBeanstalk.</returns>
        /// <exception cref="Amazon.ElasticBeanstalk.Model.ElasticBeanstalkServiceException">
        /// A generic service exception has occurred.
        /// </exception>
        /// <exception cref="Amazon.ElasticBeanstalk.Model.ManagedActionInvalidStateException">
        /// Cannot modify the managed action in its current state.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedAction">REST API Reference for ApplyEnvironmentManagedAction Operation</seealso>
        public virtual Task<ApplyEnvironmentManagedActionResponse> ApplyEnvironmentManagedActionAsync(ApplyEnvironmentManagedActionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = ApplyEnvironmentManagedActionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ApplyEnvironmentManagedActionResponseUnmarshaller.Instance;

            return InvokeAsync<ApplyEnvironmentManagedActionResponse>(request, options, cancellationToken);
        }

Amazon.ElasticBeanstalk.Model.DescribePlatformVersionResponse : AmazonWebServiceResponse

Constructors :

public DescribePlatformVersionResponse()

Methods :

public PlatformDescription get_PlatformDescription()
public Void set_PlatformDescription(PlatformDescription value = )
public ResponseMetadata get_ResponseMetadata()
public Void set_ResponseMetadata(ResponseMetadata value = )
public Int64 get_ContentLength()
public Void set_ContentLength(Int64 value = )
public HttpStatusCode get_HttpStatusCode()
public Void set_HttpStatusCode(HttpStatusCode value = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()