/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::ApiGatewayV2::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; CreateAuthorizerResult::CreateAuthorizerResult() : m_authorizerResultTtlInSeconds(0), m_authorizerType(AuthorizerType::NOT_SET), m_enableSimpleResponses(false) { } CreateAuthorizerResult::CreateAuthorizerResult(const Aws::AmazonWebServiceResult& result) : m_authorizerResultTtlInSeconds(0), m_authorizerType(AuthorizerType::NOT_SET), m_enableSimpleResponses(false) { *this = result; } CreateAuthorizerResult& CreateAuthorizerResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("authorizerCredentialsArn")) { m_authorizerCredentialsArn = jsonValue.GetString("authorizerCredentialsArn"); } if(jsonValue.ValueExists("authorizerId")) { m_authorizerId = jsonValue.GetString("authorizerId"); } if(jsonValue.ValueExists("authorizerPayloadFormatVersion")) { m_authorizerPayloadFormatVersion = jsonValue.GetString("authorizerPayloadFormatVersion"); } if(jsonValue.ValueExists("authorizerResultTtlInSeconds")) { m_authorizerResultTtlInSeconds = jsonValue.GetInteger("authorizerResultTtlInSeconds"); } if(jsonValue.ValueExists("authorizerType")) { m_authorizerType = AuthorizerTypeMapper::GetAuthorizerTypeForName(jsonValue.GetString("authorizerType")); } if(jsonValue.ValueExists("authorizerUri")) { m_authorizerUri = jsonValue.GetString("authorizerUri"); } if(jsonValue.ValueExists("enableSimpleResponses")) { m_enableSimpleResponses = jsonValue.GetBool("enableSimpleResponses"); } if(jsonValue.ValueExists("identitySource")) { Aws::Utils::Array identitySourceJsonList = jsonValue.GetArray("identitySource"); for(unsigned identitySourceIndex = 0; identitySourceIndex < identitySourceJsonList.GetLength(); ++identitySourceIndex) { m_identitySource.push_back(identitySourceJsonList[identitySourceIndex].AsString()); } } if(jsonValue.ValueExists("identityValidationExpression")) { m_identityValidationExpression = jsonValue.GetString("identityValidationExpression"); } if(jsonValue.ValueExists("jwtConfiguration")) { m_jwtConfiguration = jsonValue.GetObject("jwtConfiguration"); } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }