toGatewayResponseType method

GatewayResponseType toGatewayResponseType()

Implementation

GatewayResponseType toGatewayResponseType() {
  switch (this) {
    case 'DEFAULT_4XX':
      return GatewayResponseType.default_4xx;
    case 'DEFAULT_5XX':
      return GatewayResponseType.default_5xx;
    case 'RESOURCE_NOT_FOUND':
      return GatewayResponseType.resourceNotFound;
    case 'UNAUTHORIZED':
      return GatewayResponseType.unauthorized;
    case 'INVALID_API_KEY':
      return GatewayResponseType.invalidApiKey;
    case 'ACCESS_DENIED':
      return GatewayResponseType.accessDenied;
    case 'AUTHORIZER_FAILURE':
      return GatewayResponseType.authorizerFailure;
    case 'AUTHORIZER_CONFIGURATION_ERROR':
      return GatewayResponseType.authorizerConfigurationError;
    case 'INVALID_SIGNATURE':
      return GatewayResponseType.invalidSignature;
    case 'EXPIRED_TOKEN':
      return GatewayResponseType.expiredToken;
    case 'MISSING_AUTHENTICATION_TOKEN':
      return GatewayResponseType.missingAuthenticationToken;
    case 'INTEGRATION_FAILURE':
      return GatewayResponseType.integrationFailure;
    case 'INTEGRATION_TIMEOUT':
      return GatewayResponseType.integrationTimeout;
    case 'API_CONFIGURATION_ERROR':
      return GatewayResponseType.apiConfigurationError;
    case 'UNSUPPORTED_MEDIA_TYPE':
      return GatewayResponseType.unsupportedMediaType;
    case 'BAD_REQUEST_PARAMETERS':
      return GatewayResponseType.badRequestParameters;
    case 'BAD_REQUEST_BODY':
      return GatewayResponseType.badRequestBody;
    case 'REQUEST_TOO_LARGE':
      return GatewayResponseType.requestTooLarge;
    case 'THROTTLED':
      return GatewayResponseType.throttled;
    case 'QUOTA_EXCEEDED':
      return GatewayResponseType.quotaExceeded;
  }
  throw Exception('$this is not known in enum GatewayResponseType');
}