text:
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/elasticache/ElastiCacheClient.h>
#include <aws/elasticache/ElastiCacheEndpoint.h>
#include <aws/elasticache/ElastiCacheErrorMarshaller.h>
#include <aws/elasticache/model/AddTagsToResourceRequest.h>
#include <aws/elasticache/model/AuthorizeCacheSecurityGroupIngressRequest.h>
#include <aws/elasticache/model/CopySnapshotRequest.h>
#include <aws/elasticache/model/CreateCacheClusterRequest.h>
#include <aws/elasticache/model/CreateCacheParameterGroupRequest.h>
#include <aws/elasticache/model/CreateCacheSecurityGroupRequest.h>
#include <aws/elasticache/model/CreateCacheSubnetGroupRequest.h>
#include <aws/elasticache/model/CreateReplicationGroupRequest.h>
#include <aws/elasticache/model/CreateSnapshotRequest.h>
#include <aws/elasticache/model/DeleteCacheClusterRequest.h>
#include <aws/elasticache/model/DeleteCacheParameterGroupRequest.h>
#include <aws/elasticache/model/DeleteCacheSecurityGroupRequest.h>
#include <aws/elasticache/model/DeleteCacheSubnetGroupRequest.h>
#include <aws/elasticache/model/DeleteReplicationGroupRequest.h>
#include <aws/elasticache/model/DeleteSnapshotRequest.h>
#include <aws/elasticache/model/DescribeCacheClustersRequest.h>
#include <aws/elasticache/model/DescribeCacheEngineVersionsRequest.h>
#include <aws/elasticache/model/DescribeCacheParameterGroupsRequest.h>
#include <aws/elasticache/model/DescribeCacheParametersRequest.h>
#include <aws/elasticache/model/DescribeCacheSecurityGroupsRequest.h>
#include <aws/elasticache/model/DescribeCacheSubnetGroupsRequest.h>
#include <aws/elasticache/model/DescribeEngineDefaultParametersRequest.h>
#include <aws/elasticache/model/DescribeEventsRequest.h>
#include <aws/elasticache/model/DescribeReplicationGroupsRequest.h>
#include <aws/elasticache/model/DescribeReservedCacheNodesRequest.h>
#include <aws/elasticache/model/DescribeReservedCacheNodesOfferingsRequest.h>
#include <aws/elasticache/model/DescribeSnapshotsRequest.h>
#include <aws/elasticache/model/ListTagsForResourceRequest.h>
#include <aws/elasticache/model/ModifyCacheClusterRequest.h>
#include <aws/elasticache/model/ModifyCacheParameterGroupRequest.h>
#include <aws/elasticache/model/ModifyCacheSubnetGroupRequest.h>
#include <aws/elasticache/model/ModifyReplicationGroupRequest.h>
#include <aws/elasticache/model/PurchaseReservedCacheNodesOfferingRequest.h>
#include <aws/elasticache/model/RebootCacheClusterRequest.h>
#include <aws/elasticache/model/RemoveTagsFromResourceRequest.h>
#include <aws/elasticache/model/ResetCacheParameterGroupRequest.h>
#include <aws/elasticache/model/RevokeCacheSecurityGroupIngressRequest.h>

using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::ElastiCache;
using namespace Aws::ElastiCache::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Xml;

static const char* SERVICE_NAME = "elasticache";
static const char* ALLOCATION_TAG = "ElastiCacheClient";

ElastiCacheClient::ElastiCacheClient(const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(Aws::MakeShared<HttpClientFactory>(ALLOCATION_TAG), clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG), SERVICE_NAME, clientConfiguration.region),
    Aws::MakeShared<ElastiCacheErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

ElastiCacheClient::ElastiCacheClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(Aws::MakeShared<HttpClientFactory>(ALLOCATION_TAG), clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials), SERVICE_NAME, clientConfiguration.region),
    Aws::MakeShared<ElastiCacheErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

ElastiCacheClient::ElastiCacheClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
  const Client::ClientConfiguration& clientConfiguration, const std::shared_ptr<HttpClientFactory const>& httpClientFactory) :
  BASECLASS(httpClientFactory != nullptr ? httpClientFactory : Aws::MakeShared<HttpClientFactory>(ALLOCATION_TAG), clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider, SERVICE_NAME, clientConfiguration.region),
    Aws::MakeShared<ElastiCacheErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

ElastiCacheClient::~ElastiCacheClient()
{
}

void ElastiCacheClient::init(const ClientConfiguration& config)
{
  Aws::StringStream ss;
  ss << SchemeMapper::ToString(config.scheme) << "://";

  if(config.endpointOverride.empty())
  {
    ss << ElastiCacheEndpoint::ForRegion(config.region);
  }
  else
  {
    ss << config.endpointOverride;
  }

  m_uri = ss.str();
}
AddTagsToResourceOutcome ElastiCacheClient::AddTagsToResource(const AddTagsToResourceRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return AddTagsToResourceOutcome(AddTagsToResourceResult(outcome.GetResult()));
  }
  else
  {
    return AddTagsToResourceOutcome(outcome.GetError());
  }
}

AddTagsToResourceOutcomeCallable ElastiCacheClient::AddTagsToResourceCallable(const AddTagsToResourceRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::AddTagsToResource, this, request);
}

void ElastiCacheClient::AddTagsToResourceAsync(const AddTagsToResourceRequest& request, const AddTagsToResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::AddTagsToResourceAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::AddTagsToResourceAsyncHelper(const AddTagsToResourceRequest& request, const AddTagsToResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, AddTagsToResource(request), context);
}

AuthorizeCacheSecurityGroupIngressOutcome ElastiCacheClient::AuthorizeCacheSecurityGroupIngress(const AuthorizeCacheSecurityGroupIngressRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return AuthorizeCacheSecurityGroupIngressOutcome(AuthorizeCacheSecurityGroupIngressResult(outcome.GetResult()));
  }
  else
  {
    return AuthorizeCacheSecurityGroupIngressOutcome(outcome.GetError());
  }
}

AuthorizeCacheSecurityGroupIngressOutcomeCallable ElastiCacheClient::AuthorizeCacheSecurityGroupIngressCallable(const AuthorizeCacheSecurityGroupIngressRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::AuthorizeCacheSecurityGroupIngress, this, request);
}

void ElastiCacheClient::AuthorizeCacheSecurityGroupIngressAsync(const AuthorizeCacheSecurityGroupIngressRequest& request, const AuthorizeCacheSecurityGroupIngressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::AuthorizeCacheSecurityGroupIngressAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::AuthorizeCacheSecurityGroupIngressAsyncHelper(const AuthorizeCacheSecurityGroupIngressRequest& request, const AuthorizeCacheSecurityGroupIngressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, AuthorizeCacheSecurityGroupIngress(request), context);
}

CopySnapshotOutcome ElastiCacheClient::CopySnapshot(const CopySnapshotRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CopySnapshotOutcome(CopySnapshotResult(outcome.GetResult()));
  }
  else
  {
    return CopySnapshotOutcome(outcome.GetError());
  }
}

CopySnapshotOutcomeCallable ElastiCacheClient::CopySnapshotCallable(const CopySnapshotRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CopySnapshot, this, request);
}

void ElastiCacheClient::CopySnapshotAsync(const CopySnapshotRequest& request, const CopySnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CopySnapshotAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CopySnapshotAsyncHelper(const CopySnapshotRequest& request, const CopySnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CopySnapshot(request), context);
}

CreateCacheClusterOutcome ElastiCacheClient::CreateCacheCluster(const CreateCacheClusterRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateCacheClusterOutcome(CreateCacheClusterResult(outcome.GetResult()));
  }
  else
  {
    return CreateCacheClusterOutcome(outcome.GetError());
  }
}

CreateCacheClusterOutcomeCallable ElastiCacheClient::CreateCacheClusterCallable(const CreateCacheClusterRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateCacheCluster, this, request);
}

void ElastiCacheClient::CreateCacheClusterAsync(const CreateCacheClusterRequest& request, const CreateCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateCacheClusterAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateCacheClusterAsyncHelper(const CreateCacheClusterRequest& request, const CreateCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateCacheCluster(request), context);
}

CreateCacheParameterGroupOutcome ElastiCacheClient::CreateCacheParameterGroup(const CreateCacheParameterGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateCacheParameterGroupOutcome(CreateCacheParameterGroupResult(outcome.GetResult()));
  }
  else
  {
    return CreateCacheParameterGroupOutcome(outcome.GetError());
  }
}

CreateCacheParameterGroupOutcomeCallable ElastiCacheClient::CreateCacheParameterGroupCallable(const CreateCacheParameterGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateCacheParameterGroup, this, request);
}

void ElastiCacheClient::CreateCacheParameterGroupAsync(const CreateCacheParameterGroupRequest& request, const CreateCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateCacheParameterGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateCacheParameterGroupAsyncHelper(const CreateCacheParameterGroupRequest& request, const CreateCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateCacheParameterGroup(request), context);
}

CreateCacheSecurityGroupOutcome ElastiCacheClient::CreateCacheSecurityGroup(const CreateCacheSecurityGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateCacheSecurityGroupOutcome(CreateCacheSecurityGroupResult(outcome.GetResult()));
  }
  else
  {
    return CreateCacheSecurityGroupOutcome(outcome.GetError());
  }
}

CreateCacheSecurityGroupOutcomeCallable ElastiCacheClient::CreateCacheSecurityGroupCallable(const CreateCacheSecurityGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateCacheSecurityGroup, this, request);
}

void ElastiCacheClient::CreateCacheSecurityGroupAsync(const CreateCacheSecurityGroupRequest& request, const CreateCacheSecurityGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateCacheSecurityGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateCacheSecurityGroupAsyncHelper(const CreateCacheSecurityGroupRequest& request, const CreateCacheSecurityGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateCacheSecurityGroup(request), context);
}

CreateCacheSubnetGroupOutcome ElastiCacheClient::CreateCacheSubnetGroup(const CreateCacheSubnetGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateCacheSubnetGroupOutcome(CreateCacheSubnetGroupResult(outcome.GetResult()));
  }
  else
  {
    return CreateCacheSubnetGroupOutcome(outcome.GetError());
  }
}

CreateCacheSubnetGroupOutcomeCallable ElastiCacheClient::CreateCacheSubnetGroupCallable(const CreateCacheSubnetGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateCacheSubnetGroup, this, request);
}

void ElastiCacheClient::CreateCacheSubnetGroupAsync(const CreateCacheSubnetGroupRequest& request, const CreateCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateCacheSubnetGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateCacheSubnetGroupAsyncHelper(const CreateCacheSubnetGroupRequest& request, const CreateCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateCacheSubnetGroup(request), context);
}

CreateReplicationGroupOutcome ElastiCacheClient::CreateReplicationGroup(const CreateReplicationGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateReplicationGroupOutcome(CreateReplicationGroupResult(outcome.GetResult()));
  }
  else
  {
    return CreateReplicationGroupOutcome(outcome.GetError());
  }
}

CreateReplicationGroupOutcomeCallable ElastiCacheClient::CreateReplicationGroupCallable(const CreateReplicationGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateReplicationGroup, this, request);
}

void ElastiCacheClient::CreateReplicationGroupAsync(const CreateReplicationGroupRequest& request, const CreateReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateReplicationGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateReplicationGroupAsyncHelper(const CreateReplicationGroupRequest& request, const CreateReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateReplicationGroup(request), context);
}

CreateSnapshotOutcome ElastiCacheClient::CreateSnapshot(const CreateSnapshotRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return CreateSnapshotOutcome(CreateSnapshotResult(outcome.GetResult()));
  }
  else
  {
    return CreateSnapshotOutcome(outcome.GetError());
  }
}

CreateSnapshotOutcomeCallable ElastiCacheClient::CreateSnapshotCallable(const CreateSnapshotRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::CreateSnapshot, this, request);
}

void ElastiCacheClient::CreateSnapshotAsync(const CreateSnapshotRequest& request, const CreateSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::CreateSnapshotAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::CreateSnapshotAsyncHelper(const CreateSnapshotRequest& request, const CreateSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, CreateSnapshot(request), context);
}

DeleteCacheClusterOutcome ElastiCacheClient::DeleteCacheCluster(const DeleteCacheClusterRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteCacheClusterOutcome(DeleteCacheClusterResult(outcome.GetResult()));
  }
  else
  {
    return DeleteCacheClusterOutcome(outcome.GetError());
  }
}

DeleteCacheClusterOutcomeCallable ElastiCacheClient::DeleteCacheClusterCallable(const DeleteCacheClusterRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteCacheCluster, this, request);
}

void ElastiCacheClient::DeleteCacheClusterAsync(const DeleteCacheClusterRequest& request, const DeleteCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteCacheClusterAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteCacheClusterAsyncHelper(const DeleteCacheClusterRequest& request, const DeleteCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteCacheCluster(request), context);
}

DeleteCacheParameterGroupOutcome ElastiCacheClient::DeleteCacheParameterGroup(const DeleteCacheParameterGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteCacheParameterGroupOutcome(NoResult());
  }
  else
  {
    return DeleteCacheParameterGroupOutcome(outcome.GetError());
  }
}

DeleteCacheParameterGroupOutcomeCallable ElastiCacheClient::DeleteCacheParameterGroupCallable(const DeleteCacheParameterGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteCacheParameterGroup, this, request);
}

void ElastiCacheClient::DeleteCacheParameterGroupAsync(const DeleteCacheParameterGroupRequest& request, const DeleteCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteCacheParameterGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteCacheParameterGroupAsyncHelper(const DeleteCacheParameterGroupRequest& request, const DeleteCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteCacheParameterGroup(request), context);
}

DeleteCacheSecurityGroupOutcome ElastiCacheClient::DeleteCacheSecurityGroup(const DeleteCacheSecurityGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteCacheSecurityGroupOutcome(NoResult());
  }
  else
  {
    return DeleteCacheSecurityGroupOutcome(outcome.GetError());
  }
}

DeleteCacheSecurityGroupOutcomeCallable ElastiCacheClient::DeleteCacheSecurityGroupCallable(const DeleteCacheSecurityGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteCacheSecurityGroup, this, request);
}

void ElastiCacheClient::DeleteCacheSecurityGroupAsync(const DeleteCacheSecurityGroupRequest& request, const DeleteCacheSecurityGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteCacheSecurityGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteCacheSecurityGroupAsyncHelper(const DeleteCacheSecurityGroupRequest& request, const DeleteCacheSecurityGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteCacheSecurityGroup(request), context);
}

DeleteCacheSubnetGroupOutcome ElastiCacheClient::DeleteCacheSubnetGroup(const DeleteCacheSubnetGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteCacheSubnetGroupOutcome(NoResult());
  }
  else
  {
    return DeleteCacheSubnetGroupOutcome(outcome.GetError());
  }
}

DeleteCacheSubnetGroupOutcomeCallable ElastiCacheClient::DeleteCacheSubnetGroupCallable(const DeleteCacheSubnetGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteCacheSubnetGroup, this, request);
}

void ElastiCacheClient::DeleteCacheSubnetGroupAsync(const DeleteCacheSubnetGroupRequest& request, const DeleteCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteCacheSubnetGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteCacheSubnetGroupAsyncHelper(const DeleteCacheSubnetGroupRequest& request, const DeleteCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteCacheSubnetGroup(request), context);
}

DeleteReplicationGroupOutcome ElastiCacheClient::DeleteReplicationGroup(const DeleteReplicationGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteReplicationGroupOutcome(DeleteReplicationGroupResult(outcome.GetResult()));
  }
  else
  {
    return DeleteReplicationGroupOutcome(outcome.GetError());
  }
}

DeleteReplicationGroupOutcomeCallable ElastiCacheClient::DeleteReplicationGroupCallable(const DeleteReplicationGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteReplicationGroup, this, request);
}

void ElastiCacheClient::DeleteReplicationGroupAsync(const DeleteReplicationGroupRequest& request, const DeleteReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteReplicationGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteReplicationGroupAsyncHelper(const DeleteReplicationGroupRequest& request, const DeleteReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteReplicationGroup(request), context);
}

DeleteSnapshotOutcome ElastiCacheClient::DeleteSnapshot(const DeleteSnapshotRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DeleteSnapshotOutcome(DeleteSnapshotResult(outcome.GetResult()));
  }
  else
  {
    return DeleteSnapshotOutcome(outcome.GetError());
  }
}

DeleteSnapshotOutcomeCallable ElastiCacheClient::DeleteSnapshotCallable(const DeleteSnapshotRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DeleteSnapshot, this, request);
}

void ElastiCacheClient::DeleteSnapshotAsync(const DeleteSnapshotRequest& request, const DeleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DeleteSnapshotAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DeleteSnapshotAsyncHelper(const DeleteSnapshotRequest& request, const DeleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteSnapshot(request), context);
}

DescribeCacheClustersOutcome ElastiCacheClient::DescribeCacheClusters(const DescribeCacheClustersRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheClustersOutcome(DescribeCacheClustersResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheClustersOutcome(outcome.GetError());
  }
}

DescribeCacheClustersOutcomeCallable ElastiCacheClient::DescribeCacheClustersCallable(const DescribeCacheClustersRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheClusters, this, request);
}

void ElastiCacheClient::DescribeCacheClustersAsync(const DescribeCacheClustersRequest& request, const DescribeCacheClustersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheClustersAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheClustersAsyncHelper(const DescribeCacheClustersRequest& request, const DescribeCacheClustersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheClusters(request), context);
}

DescribeCacheEngineVersionsOutcome ElastiCacheClient::DescribeCacheEngineVersions(const DescribeCacheEngineVersionsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheEngineVersionsOutcome(DescribeCacheEngineVersionsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheEngineVersionsOutcome(outcome.GetError());
  }
}

DescribeCacheEngineVersionsOutcomeCallable ElastiCacheClient::DescribeCacheEngineVersionsCallable(const DescribeCacheEngineVersionsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheEngineVersions, this, request);
}

void ElastiCacheClient::DescribeCacheEngineVersionsAsync(const DescribeCacheEngineVersionsRequest& request, const DescribeCacheEngineVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheEngineVersionsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheEngineVersionsAsyncHelper(const DescribeCacheEngineVersionsRequest& request, const DescribeCacheEngineVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheEngineVersions(request), context);
}

DescribeCacheParameterGroupsOutcome ElastiCacheClient::DescribeCacheParameterGroups(const DescribeCacheParameterGroupsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheParameterGroupsOutcome(DescribeCacheParameterGroupsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheParameterGroupsOutcome(outcome.GetError());
  }
}

DescribeCacheParameterGroupsOutcomeCallable ElastiCacheClient::DescribeCacheParameterGroupsCallable(const DescribeCacheParameterGroupsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheParameterGroups, this, request);
}

void ElastiCacheClient::DescribeCacheParameterGroupsAsync(const DescribeCacheParameterGroupsRequest& request, const DescribeCacheParameterGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheParameterGroupsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheParameterGroupsAsyncHelper(const DescribeCacheParameterGroupsRequest& request, const DescribeCacheParameterGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheParameterGroups(request), context);
}

DescribeCacheParametersOutcome ElastiCacheClient::DescribeCacheParameters(const DescribeCacheParametersRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheParametersOutcome(DescribeCacheParametersResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheParametersOutcome(outcome.GetError());
  }
}

DescribeCacheParametersOutcomeCallable ElastiCacheClient::DescribeCacheParametersCallable(const DescribeCacheParametersRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheParameters, this, request);
}

void ElastiCacheClient::DescribeCacheParametersAsync(const DescribeCacheParametersRequest& request, const DescribeCacheParametersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheParametersAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheParametersAsyncHelper(const DescribeCacheParametersRequest& request, const DescribeCacheParametersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheParameters(request), context);
}

DescribeCacheSecurityGroupsOutcome ElastiCacheClient::DescribeCacheSecurityGroups(const DescribeCacheSecurityGroupsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheSecurityGroupsOutcome(DescribeCacheSecurityGroupsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheSecurityGroupsOutcome(outcome.GetError());
  }
}

DescribeCacheSecurityGroupsOutcomeCallable ElastiCacheClient::DescribeCacheSecurityGroupsCallable(const DescribeCacheSecurityGroupsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheSecurityGroups, this, request);
}

void ElastiCacheClient::DescribeCacheSecurityGroupsAsync(const DescribeCacheSecurityGroupsRequest& request, const DescribeCacheSecurityGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheSecurityGroupsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheSecurityGroupsAsyncHelper(const DescribeCacheSecurityGroupsRequest& request, const DescribeCacheSecurityGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheSecurityGroups(request), context);
}

DescribeCacheSubnetGroupsOutcome ElastiCacheClient::DescribeCacheSubnetGroups(const DescribeCacheSubnetGroupsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeCacheSubnetGroupsOutcome(DescribeCacheSubnetGroupsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeCacheSubnetGroupsOutcome(outcome.GetError());
  }
}

DescribeCacheSubnetGroupsOutcomeCallable ElastiCacheClient::DescribeCacheSubnetGroupsCallable(const DescribeCacheSubnetGroupsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeCacheSubnetGroups, this, request);
}

void ElastiCacheClient::DescribeCacheSubnetGroupsAsync(const DescribeCacheSubnetGroupsRequest& request, const DescribeCacheSubnetGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeCacheSubnetGroupsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeCacheSubnetGroupsAsyncHelper(const DescribeCacheSubnetGroupsRequest& request, const DescribeCacheSubnetGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeCacheSubnetGroups(request), context);
}

DescribeEngineDefaultParametersOutcome ElastiCacheClient::DescribeEngineDefaultParameters(const DescribeEngineDefaultParametersRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeEngineDefaultParametersOutcome(DescribeEngineDefaultParametersResult(outcome.GetResult()));
  }
  else
  {
    return DescribeEngineDefaultParametersOutcome(outcome.GetError());
  }
}

DescribeEngineDefaultParametersOutcomeCallable ElastiCacheClient::DescribeEngineDefaultParametersCallable(const DescribeEngineDefaultParametersRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeEngineDefaultParameters, this, request);
}

void ElastiCacheClient::DescribeEngineDefaultParametersAsync(const DescribeEngineDefaultParametersRequest& request, const DescribeEngineDefaultParametersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeEngineDefaultParametersAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeEngineDefaultParametersAsyncHelper(const DescribeEngineDefaultParametersRequest& request, const DescribeEngineDefaultParametersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeEngineDefaultParameters(request), context);
}

DescribeEventsOutcome ElastiCacheClient::DescribeEvents(const DescribeEventsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeEventsOutcome(DescribeEventsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeEventsOutcome(outcome.GetError());
  }
}

DescribeEventsOutcomeCallable ElastiCacheClient::DescribeEventsCallable(const DescribeEventsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeEvents, this, request);
}

void ElastiCacheClient::DescribeEventsAsync(const DescribeEventsRequest& request, const DescribeEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeEventsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeEventsAsyncHelper(const DescribeEventsRequest& request, const DescribeEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeEvents(request), context);
}

DescribeReplicationGroupsOutcome ElastiCacheClient::DescribeReplicationGroups(const DescribeReplicationGroupsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeReplicationGroupsOutcome(DescribeReplicationGroupsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeReplicationGroupsOutcome(outcome.GetError());
  }
}

DescribeReplicationGroupsOutcomeCallable ElastiCacheClient::DescribeReplicationGroupsCallable(const DescribeReplicationGroupsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeReplicationGroups, this, request);
}

void ElastiCacheClient::DescribeReplicationGroupsAsync(const DescribeReplicationGroupsRequest& request, const DescribeReplicationGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeReplicationGroupsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeReplicationGroupsAsyncHelper(const DescribeReplicationGroupsRequest& request, const DescribeReplicationGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeReplicationGroups(request), context);
}

DescribeReservedCacheNodesOutcome ElastiCacheClient::DescribeReservedCacheNodes(const DescribeReservedCacheNodesRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeReservedCacheNodesOutcome(DescribeReservedCacheNodesResult(outcome.GetResult()));
  }
  else
  {
    return DescribeReservedCacheNodesOutcome(outcome.GetError());
  }
}

DescribeReservedCacheNodesOutcomeCallable ElastiCacheClient::DescribeReservedCacheNodesCallable(const DescribeReservedCacheNodesRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeReservedCacheNodes, this, request);
}

void ElastiCacheClient::DescribeReservedCacheNodesAsync(const DescribeReservedCacheNodesRequest& request, const DescribeReservedCacheNodesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeReservedCacheNodesAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeReservedCacheNodesAsyncHelper(const DescribeReservedCacheNodesRequest& request, const DescribeReservedCacheNodesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeReservedCacheNodes(request), context);
}

DescribeReservedCacheNodesOfferingsOutcome ElastiCacheClient::DescribeReservedCacheNodesOfferings(const DescribeReservedCacheNodesOfferingsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeReservedCacheNodesOfferingsOutcome(DescribeReservedCacheNodesOfferingsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeReservedCacheNodesOfferingsOutcome(outcome.GetError());
  }
}

DescribeReservedCacheNodesOfferingsOutcomeCallable ElastiCacheClient::DescribeReservedCacheNodesOfferingsCallable(const DescribeReservedCacheNodesOfferingsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeReservedCacheNodesOfferings, this, request);
}

void ElastiCacheClient::DescribeReservedCacheNodesOfferingsAsync(const DescribeReservedCacheNodesOfferingsRequest& request, const DescribeReservedCacheNodesOfferingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeReservedCacheNodesOfferingsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeReservedCacheNodesOfferingsAsyncHelper(const DescribeReservedCacheNodesOfferingsRequest& request, const DescribeReservedCacheNodesOfferingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeReservedCacheNodesOfferings(request), context);
}

DescribeSnapshotsOutcome ElastiCacheClient::DescribeSnapshots(const DescribeSnapshotsRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return DescribeSnapshotsOutcome(DescribeSnapshotsResult(outcome.GetResult()));
  }
  else
  {
    return DescribeSnapshotsOutcome(outcome.GetError());
  }
}

DescribeSnapshotsOutcomeCallable ElastiCacheClient::DescribeSnapshotsCallable(const DescribeSnapshotsRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::DescribeSnapshots, this, request);
}

void ElastiCacheClient::DescribeSnapshotsAsync(const DescribeSnapshotsRequest& request, const DescribeSnapshotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::DescribeSnapshotsAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::DescribeSnapshotsAsyncHelper(const DescribeSnapshotsRequest& request, const DescribeSnapshotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeSnapshots(request), context);
}

ListTagsForResourceOutcome ElastiCacheClient::ListTagsForResource(const ListTagsForResourceRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ListTagsForResourceOutcome(ListTagsForResourceResult(outcome.GetResult()));
  }
  else
  {
    return ListTagsForResourceOutcome(outcome.GetError());
  }
}

ListTagsForResourceOutcomeCallable ElastiCacheClient::ListTagsForResourceCallable(const ListTagsForResourceRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ListTagsForResource, this, request);
}

void ElastiCacheClient::ListTagsForResourceAsync(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ListTagsForResourceAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ListTagsForResourceAsyncHelper(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListTagsForResource(request), context);
}

ModifyCacheClusterOutcome ElastiCacheClient::ModifyCacheCluster(const ModifyCacheClusterRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ModifyCacheClusterOutcome(ModifyCacheClusterResult(outcome.GetResult()));
  }
  else
  {
    return ModifyCacheClusterOutcome(outcome.GetError());
  }
}

ModifyCacheClusterOutcomeCallable ElastiCacheClient::ModifyCacheClusterCallable(const ModifyCacheClusterRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ModifyCacheCluster, this, request);
}

void ElastiCacheClient::ModifyCacheClusterAsync(const ModifyCacheClusterRequest& request, const ModifyCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ModifyCacheClusterAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ModifyCacheClusterAsyncHelper(const ModifyCacheClusterRequest& request, const ModifyCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ModifyCacheCluster(request), context);
}

ModifyCacheParameterGroupOutcome ElastiCacheClient::ModifyCacheParameterGroup(const ModifyCacheParameterGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ModifyCacheParameterGroupOutcome(ModifyCacheParameterGroupResult(outcome.GetResult()));
  }
  else
  {
    return ModifyCacheParameterGroupOutcome(outcome.GetError());
  }
}

ModifyCacheParameterGroupOutcomeCallable ElastiCacheClient::ModifyCacheParameterGroupCallable(const ModifyCacheParameterGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ModifyCacheParameterGroup, this, request);
}

void ElastiCacheClient::ModifyCacheParameterGroupAsync(const ModifyCacheParameterGroupRequest& request, const ModifyCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ModifyCacheParameterGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ModifyCacheParameterGroupAsyncHelper(const ModifyCacheParameterGroupRequest& request, const ModifyCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ModifyCacheParameterGroup(request), context);
}

ModifyCacheSubnetGroupOutcome ElastiCacheClient::ModifyCacheSubnetGroup(const ModifyCacheSubnetGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ModifyCacheSubnetGroupOutcome(ModifyCacheSubnetGroupResult(outcome.GetResult()));
  }
  else
  {
    return ModifyCacheSubnetGroupOutcome(outcome.GetError());
  }
}

ModifyCacheSubnetGroupOutcomeCallable ElastiCacheClient::ModifyCacheSubnetGroupCallable(const ModifyCacheSubnetGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ModifyCacheSubnetGroup, this, request);
}

void ElastiCacheClient::ModifyCacheSubnetGroupAsync(const ModifyCacheSubnetGroupRequest& request, const ModifyCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ModifyCacheSubnetGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ModifyCacheSubnetGroupAsyncHelper(const ModifyCacheSubnetGroupRequest& request, const ModifyCacheSubnetGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ModifyCacheSubnetGroup(request), context);
}

ModifyReplicationGroupOutcome ElastiCacheClient::ModifyReplicationGroup(const ModifyReplicationGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ModifyReplicationGroupOutcome(ModifyReplicationGroupResult(outcome.GetResult()));
  }
  else
  {
    return ModifyReplicationGroupOutcome(outcome.GetError());
  }
}

ModifyReplicationGroupOutcomeCallable ElastiCacheClient::ModifyReplicationGroupCallable(const ModifyReplicationGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ModifyReplicationGroup, this, request);
}

void ElastiCacheClient::ModifyReplicationGroupAsync(const ModifyReplicationGroupRequest& request, const ModifyReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ModifyReplicationGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ModifyReplicationGroupAsyncHelper(const ModifyReplicationGroupRequest& request, const ModifyReplicationGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ModifyReplicationGroup(request), context);
}

PurchaseReservedCacheNodesOfferingOutcome ElastiCacheClient::PurchaseReservedCacheNodesOffering(const PurchaseReservedCacheNodesOfferingRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return PurchaseReservedCacheNodesOfferingOutcome(PurchaseReservedCacheNodesOfferingResult(outcome.GetResult()));
  }
  else
  {
    return PurchaseReservedCacheNodesOfferingOutcome(outcome.GetError());
  }
}

PurchaseReservedCacheNodesOfferingOutcomeCallable ElastiCacheClient::PurchaseReservedCacheNodesOfferingCallable(const PurchaseReservedCacheNodesOfferingRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::PurchaseReservedCacheNodesOffering, this, request);
}

void ElastiCacheClient::PurchaseReservedCacheNodesOfferingAsync(const PurchaseReservedCacheNodesOfferingRequest& request, const PurchaseReservedCacheNodesOfferingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::PurchaseReservedCacheNodesOfferingAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::PurchaseReservedCacheNodesOfferingAsyncHelper(const PurchaseReservedCacheNodesOfferingRequest& request, const PurchaseReservedCacheNodesOfferingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, PurchaseReservedCacheNodesOffering(request), context);
}

RebootCacheClusterOutcome ElastiCacheClient::RebootCacheCluster(const RebootCacheClusterRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return RebootCacheClusterOutcome(RebootCacheClusterResult(outcome.GetResult()));
  }
  else
  {
    return RebootCacheClusterOutcome(outcome.GetError());
  }
}

RebootCacheClusterOutcomeCallable ElastiCacheClient::RebootCacheClusterCallable(const RebootCacheClusterRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::RebootCacheCluster, this, request);
}

void ElastiCacheClient::RebootCacheClusterAsync(const RebootCacheClusterRequest& request, const RebootCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::RebootCacheClusterAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::RebootCacheClusterAsyncHelper(const RebootCacheClusterRequest& request, const RebootCacheClusterResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, RebootCacheCluster(request), context);
}

RemoveTagsFromResourceOutcome ElastiCacheClient::RemoveTagsFromResource(const RemoveTagsFromResourceRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return RemoveTagsFromResourceOutcome(RemoveTagsFromResourceResult(outcome.GetResult()));
  }
  else
  {
    return RemoveTagsFromResourceOutcome(outcome.GetError());
  }
}

RemoveTagsFromResourceOutcomeCallable ElastiCacheClient::RemoveTagsFromResourceCallable(const RemoveTagsFromResourceRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::RemoveTagsFromResource, this, request);
}

void ElastiCacheClient::RemoveTagsFromResourceAsync(const RemoveTagsFromResourceRequest& request, const RemoveTagsFromResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::RemoveTagsFromResourceAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::RemoveTagsFromResourceAsyncHelper(const RemoveTagsFromResourceRequest& request, const RemoveTagsFromResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, RemoveTagsFromResource(request), context);
}

ResetCacheParameterGroupOutcome ElastiCacheClient::ResetCacheParameterGroup(const ResetCacheParameterGroupRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return ResetCacheParameterGroupOutcome(ResetCacheParameterGroupResult(outcome.GetResult()));
  }
  else
  {
    return ResetCacheParameterGroupOutcome(outcome.GetError());
  }
}

ResetCacheParameterGroupOutcomeCallable ElastiCacheClient::ResetCacheParameterGroupCallable(const ResetCacheParameterGroupRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::ResetCacheParameterGroup, this, request);
}

void ElastiCacheClient::ResetCacheParameterGroupAsync(const ResetCacheParameterGroupRequest& request, const ResetCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::ResetCacheParameterGroupAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::ResetCacheParameterGroupAsyncHelper(const ResetCacheParameterGroupRequest& request, const ResetCacheParameterGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ResetCacheParameterGroup(request), context);
}

RevokeCacheSecurityGroupIngressOutcome ElastiCacheClient::RevokeCacheSecurityGroupIngress(const RevokeCacheSecurityGroupIngressRequest& request) const
{
  Aws::StringStream ss;
  ss << m_uri << "/";
  XmlOutcome outcome = MakeRequest(ss.str(), request, HttpMethod::HTTP_POST);
  if(outcome.IsSuccess())
  {
    return RevokeCacheSecurityGroupIngressOutcome(RevokeCacheSecurityGroupIngressResult(outcome.GetResult()));
  }
  else
  {
    return RevokeCacheSecurityGroupIngressOutcome(outcome.GetError());
  }
}

RevokeCacheSecurityGroupIngressOutcomeCallable ElastiCacheClient::RevokeCacheSecurityGroupIngressCallable(const RevokeCacheSecurityGroupIngressRequest& request) const
{
  return std::async(std::launch::async, &ElastiCacheClient::RevokeCacheSecurityGroupIngress, this, request);
}

void ElastiCacheClient::RevokeCacheSecurityGroupIngressAsync(const RevokeCacheSecurityGroupIngressRequest& request, const RevokeCacheSecurityGroupIngressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit(&ElastiCacheClient::RevokeCacheSecurityGroupIngressAsyncHelper, this, request, handler, context);
}

void ElastiCacheClient::RevokeCacheSecurityGroupIngressAsyncHelper(const RevokeCacheSecurityGroupIngressRequest& request, const RevokeCacheSecurityGroupIngressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, RevokeCacheSecurityGroupIngress(request), context);
}


text:
/*!
* Module dependencies.
*/

var markdown = require('marked'),
	/**
	* Escape the given `html`.
	*
	* @param {String} html
	* @return {String}
	* @api private
	*/

	escape = function(html){
		return String(html)	.replace(/&(?!\w+;)/g, '&')
							.replace(/</g, '<')
							.replace(/>/g, '>');
	},
	stripOutsideTags = function(str) {
		return str.replace(/^<\w+>\s*/, '').replace(/\s*<\/\w+>\s*\n?\s*$/, '');
	};

/**
* Parse comments in the given string of `js`.
*
* @param {String} js
* @param {Object} options
* @return {Array}
* @see exports.parseComment
* @api public
*/

var line_num;
exports.parseComments = function(js, options) {
	options = options || {};
	js = js.replace(/\r\n/gm, '\n');
	line_num = 1;

	var comments = [],
	raw = options.raw,
	comment,
	buf = '',
	ignore,
	withinMultiline = false,
	withinSingle = false,
	code,
	start_line_num = line_num;

	for (var i = 0, len = js.length; i < len; ++i) {
		// start comment
		if (!withinMultiline && !withinSingle && '/' == js[i] && '*' == js[i+1]) {
			start_line_num = line_num;
			// code following previous comment
			if (buf.trim().length) {
				comment = comments[comments.length - 1];
				if(comment) {
					comment.code = code = buf.trim();
				}
				buf = '';
			}
			i += 2;
			withinMultiline = true;
			ignore = '!' == js[i];
			// end comment
		} else if (withinMultiline && !withinSingle && '*' == js[i] && '/' == js[i+1]) {
			i += 2;
			buf = buf.replace(/^[ \t]*\* ?/gm, '');
			var comment = exports.parseComment(buf, options);
			comment.ignore = ignore;
			comment.line = start_line_num;
			comments.push(comment);
			withinMultiline = ignore = false;
			buf = '';
		} else if (!withinSingle && !withinMultiline && '/' == js[i] && '/' == js[i+1]) {
			withinSingle = true;
			buf += js[i];
		} else if (withinSingle && !withinMultiline && '\n' == js[i]) {
			withinSingle = false;
			buf += js[i];
			// buffer comment or code
		} else {
			buf += js[i];
		}
		if('\n' == js[i]) {
			line_num++;
		}

	}

	if (comments.length === 0) {
		comments.push({
			tags: [],
			description: {full: '', summary: '', body: ''},
			isPrivate: false,
			line: start_line_num
		});
	}

	// trailing code
	if (buf.trim().length) {
		comment = comments[comments.length - 1];
		code = buf.trim();
		comment.code = code;
	}

	return comments;
};

/**
* Parse the given comment `str`.
*
* The comment object returned contains the following
*
*  - `tags`  array of tag objects
*  - `description` the first line of the comment
*  - `body` lines following the description
*  - `content` both the description and the body
*  - `isPrivate` true when "@api private" is used
*
* @param {String} str
* @param {Object} options
* @return {Object}
* @see exports.parseTag
* @api public
*/

exports.parseComment = function(str, options) {
	str = str.trim();
	options = options || {};

	var comment = { tags: [] },
		raw = options.raw,
		description = {};

	if(str.indexOf("@")===0 && str.indexOf("\n")<0) { // one-line comment
		var tags = '@' + str.split('@').slice(1).join('@');
		comment.tags = tags.split('\n').map(exports.parseTag);
	} else {
		// parse comment body
		description.full = str.split('\n@')[0];
		description.summary = description.full.split('\n\n')[0];
		description.body = description.full.split('\n\n').slice(1).join('\n\n');
		comment.description = description;

		// parse tags
		if (~str.indexOf('\n@')) {
			var tags = str.split('\n@').slice(1).join('\n@');
			comment.tags = tags.split('\n@').map(function(tag) { return "@" + tag; }).map(exports.parseTag);
			comment.isPrivate = comment.tags.some(function(tag){
				return 'api' == tag.type && 'private' == tag.visibility;
			})
		}

		// markdown
		if (!raw) {
			description.full = markdown(description.full);
			description.summary = markdown(description.summary);
			description.body = markdown(description.body);
		}
	}

	return comment;
}

/**
* Parse tag string "@param {Array} name description" etc.
*
* @param {String}
* @return {Object}
* @api public
*/

exports.parseTag = function(str) {
	var tag = {},
		parts = str.split(/[ ]+/),
		type = tag.type = parts.shift().replace('@', '');

	if(str.match(/^@example[\s\n]/)) {
		str = str.replace(/^@example/, "");
		//.trim();
		tag = {type: "example", code: markdown(str)};
		return tag;
	}

	switch (type) {
		case 'param':
		case 'property':
			tag.types = exports.parseTagTypes(parts.shift());
			tag.name = parts.shift() || '';
			tag.description = stripOutsideTags(markdown(parts.join(' ').replace(/^\s*-?\s*/, '')));
			break;
		case 'return':
			tag.types = exports.parseTagTypes(parts.shift());
			tag.description = stripOutsideTags(markdown(parts.join(' ').replace(/^\s*-?\s*/, '')));
			break;
		case 'see':
			if (~str.indexOf('http')) {
				tag.title = parts.length > 1
				? parts.shift()
				: '';
				tag.url = parts.join(' ');
			} else {
				tag.local = parts.join(' ');
			}
		case 'api':
			tag.visibility = parts.shift();
			break;
		case 'type':
			tag.types = exports.parseTagTypes(parts.shift());
			break;
		case 'memberOf':
			tag.parent = parts.shift();
			break;
		case 'augments':
			tag.otherClass = parts.shift();
			break;
		case 'borrows':
			tag.otherMemberName = parts.join(' ').split(' as ')[0];
			tag.thisMemberName = parts.join(' ').split(' as ')[1];
			break;
		case 'throws':
			tag.types = exports.parseTagTypes(parts.shift());
			tag.description = parts.join(' ');
			break;
		default:
			tag.string = parts.join(' ');
			break;
	}

	return tag;
}

/**
* Parse tag type string "{Array|Object}" etc.
*
* @param {String} str
* @return {Array}
* @api public
*/

exports.parseTagTypes = function(str) {
	return str	.replace(/[{}]/g, '')
				.split(/ *[|,\/] */);
};

redpajama_set_name: RedPajamaGithub


text:
{% extends "site_base.html" %}

{% block head_title %}{{ gettext("Confirm Email") }}{% endblock %}

{% block body %}

      <form method="post" action="{{ url("account_confirm_email", key=confirmation.key) }}" class="form-horizontal">
        {{ csrf() }}

        <legend>{{ gettext("Confirm Email") }}</legend>
        <fieldset>

{% trans email=confirmation.email_address.email %}Confirm email address {{ email }}?{% endtrans %}

            <button type="submit" class="btn btn-primary">{{ gettext("Confirm") }}</button>

        </fieldset>
      </form>

{% endblock %}


text:
"""
    queryparams.page
    ~~~~~~~~~~~~~~~~

    Paginate resources according to limit offset criteria
    according to.

        jsonapi.org/format/#fetching-pagination

    Only two query params are supported for pagination:

        page[limit]: number of resources to return
        page[offset]: number of resources to skip
"""

import goldman

from goldman.exceptions import InvalidQueryParams

LINK = 'jsonapi.org/format/#fetching-pagination'
PARAM = 'page'

class Paginator(object):
    """ Pagination object

    An instance of this object can be used to express a
    pagination strategy.

    :param limit:
        Integer value of resources to limit a result
        set to
    :param offet:
        Integer value of resources to skip
    """

    def __init__(self, limit, offset):

        self.limit = self._cast_page(limit)
        self.offset = self._cast_page(offset)
        self.total = 0

    def __eq__(self, other):

        try:
            return self.limit == other.limit and \
                self.offset == other.offset
        except AttributeError:
            return False

    def __repr__(self):

        name = self.__class__.__name__

        return '%s(%s, %s)' % (name, self.limit, self.offset)

    def __str__(self):

        return '%s, %s' % (self.limit, self.offset)

    @property
    def current(self):
        """ Generate query parameters for the current page """

        return {'page[offset]': self.offset, 'page[limit]': self.limit}

    @property
    def first(self):
        """ Generate query parameters for the first page """

        if self.total and self.limit < self.total:
            return {'page[offset]': 0, 'page[limit]': self.limit}
        else:
            return None

    @property
    def last(self):
        """ Generate query parameters for the last page """

        if self.limit > self.total:
            return None
        elif self.offset >= self.total:
            return None
        else:
            offset = (self.total / self.limit) * self.limit
            return {'page[offset]': offset, 'page[limit]': self.limit}

    @property
    def more(self):
        """ Generate query parameters for the next page """

        if self.offset + self.limit + self.limit >= self.total:
            return self.last
        else:
            offset = self.offset + self.limit
            return {'page[offset]': offset, 'page[limit]': self.limit}

    @property
    def prev(self):
        """ Generate query parameters for the prev page """

        if self.total:
            if self.offset - self.limit - self.limit < 0:
                return self.first
            else:
                offset = self.offset - self.limit
                return {'page[offset]': offset, 'page[limit]': self.limit}
        else:
            return None

    @staticmethod
    def _cast_page(val):
        """ Convert the page limit & offset into int's & type check """

        try:
            val = int(val)
            if val < 0:
                raise ValueError
            return val
        except (TypeError, ValueError):
            raise ValueError

    def to_dict(self):
        """ Convert the Paginator into a dict """

        return {
            'current': self.current,
            'first': self.first,
            'last': self.last,
            'next': self.more,
            'prev': self.prev,
        }

def init(req, model):  # pylint: disable=unused-argument
    """ Determine the pagination preference by query parameter

    Numbers only, >=0, & each query param may only be
    specified once.

    :return: Paginator object
    """

    limit = req.get_param('page[limit]') or goldman.config.PAGE_LIMIT
    offset = req.get_param('page[offset]') or 0

    try:
        return Paginator(limit, offset)
    except ValueError:
        raise InvalidQueryParams(**{
            'detail': 'The page[\'limit\'] & page[\'offset\'] query '
                      'params may only be specified once each & must '
                      'both be an integer >= 0.',
            'links': 'jsonapi.org/format/#fetching-pagination',
            'parameter': 'page',
        })


text:
{% extends "base.html" %}
{% block title %}Dashboards - {{ dashboard.name|default:"Untitled dashboard" }} {% endblock %}
{% block breadcrumb_class %}view-dashboard{% endblock breadcrumb_class %}
{% block header %}
    <link rel="stylesheet" href="{{ STATIC_URL }}css/libs/pickadate.css">
{% endblock %}

{% block breadcrumb %}
{{ block.super }}

{{ dashboard.name|default:"Untitled dashboard" }}

d

Edit

        Reorder

    {{ date_from|datetimecharts_local:request.timezone }} - {{ date_to|datetimecharts_local:request.timezone  }}

        {% for d, label in duration_form.fields.duration.choices %}

            {{ label }}

        {% endfor %}

Custom range

    {% verbatim %}

        {{s}}

    {% endverbatim %}

    <form id='update_daterange' action="{% url 'view_dashboard' dashboard_id=dashboard|mongo_id %}" method="post">

                From:
                <input type="text" class='date_from' name='date_from' value="{{ date_from|day_local:request.timezone }}">@
                <input type="text" class='time_from' name='time_from' value="{% if date_from %}{{ date_from|time_local:request.timezone }}{% else %}00:00{% endif %}">

                To:
                <input type="text" class='date_to' name='date_to' value="{{ date_to|day_local:request.timezone }}">@
                <input type="text" class='time_to' name='time_to' value="{% if date_to %}{{ date_to|time_local:request.timezone }}{% else %}00:00{% endif %}">

                <button class='button' type="submit">Update</button>
                <button id='close-timepicker' class='button delete'>Cancel</button>

</form>

<input type="hidden" id="now_local" value="{{ now|datetimecharts_local:request.timezone }}">
<input type="hidden" id="timezone_url" value="{% url 'localtime_to_unix' %}">
{% endblock breadcrumb %}

{% block content %}
{% endblock content %}

{% block js %}

{% if request.devmode %}

{% endif %}

{% endblock js %}


text:
<?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class PluginsfUserEmailAddressTable extends Doctrine_Table
{

}


text:
package org.elasticsearch.script;

import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.unit.TimeValue;

import java.util.Map;

/**
 * A script used by the Ingest Script Processor.
 */
public abstract class IngestScript {

    public static final String[] PARAMETERS = { "ctx" };

    /** The context used to compile {@link IngestScript} factories. */
    public static final ScriptContext<Factory> CONTEXT = new ScriptContext<>("ingest", Factory.class,
        200, TimeValue.timeValueMillis(0), new Tuple<>(375, TimeValue.timeValueMinutes(5)));

    /** The generic runtime parameters for the script. */
    private final Map<String, Object> params;

    public IngestScript(Map<String, Object> params) {
        this.params = params;
    }

    /** Return the parameters for this script. */
    public Map<String, Object> getParams() {
        return params;
    }

    public abstract void execute(Map<String, Object> ctx);

    public interface Factory {
        IngestScript newInstance(Map<String, Object> params);
    }
}


text:
package io.instacount.client.model.shardedcounters.responses;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.ToString;
import feign.Response;
import io.instacount.client.model.InstacountResponse;
import io.instacount.client.model.headers.Quota;
import io.instacount.client.model.shardedcounters.ShardedCounterOperation;

/**
 * A class for modeling HTTP responses that have no content, such as an HTTP 201, 204, and the like.
 */
@Getter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class GetShardedCounterOperationResponse extends InstacountResponse
{
	@NonNull
	private final ShardedCounterOperation counterOperation;

	/**
	 * Required-args Constructor.
	 *
	 * @param response
	 * @param quota
	 * @param counterOperation
	 */
	public GetShardedCounterOperationResponse(final Response response, final Quota quota,
			final ShardedCounterOperation counterOperation)
	{
		super(response, quota);
		this.counterOperation = counterOperation;
	}
}


text:
module PDFCompare
  # Actual comparison class
  class Compare
    def initialize
      FileUtils.mkdir TEMP unless File.exists? TEMP
      Dir[TEMP + '/*.png'].each {|f| FileUtils.rm_f f }
      Dir[TEMP + '/*.pdf'].each {|f| FileUtils.rm_f f }
    end

    #
    # [get_diff description]
    # @param  left_pdf [type] [description]
    # @param  right_pdf [type] [description]
    #
    # @return [type] [description]
    def get_diff(left_pdf, right_pdf)
      left = convert(left_pdf)
      right = convert(right_pdf)

      output_pdf = "#{TEMP}/results.pdf"

      merged_images = []

      left.images.each_with_index do |image, index|
        merged_images << compare_images(
          left.images[index], right.images[index], index
          )
      end

      Prawn::Document.generate(output_pdf, margin: 0) do
        merged_images.each do |merged_image|
          # TODO: Find a way to get the correct DPI for the image
          # programatically Look at this for explaination:
          # https://groups.google.com/d/msg/prawn
          #   -ruby/PqalbkHg8p0/QGBUG0kiRGgJ
          image merged_image[:image], scale: 72.0 / 96.0
          # TODO: Skip last page for start_new_page
          start_new_page
          FileUtils.rm_f merged_image[:image]
        end
      end

      output_pdf
    end

    private

    def convert(input)
      pdf = PDF.new
      pdf.name = input
      pdf.basename = File.basename(input, '.pdf')
      loc = "#{TEMP}/#{pdf.basename} #{pdf.name}"
      options = 'PDFToImage -imageType png -outputPrefix'
      `java -jar #{PDFBOX_EXECUTABLE} #{options} #{loc}`
      Dir["#{TEMP}/#{pdf.basename}*.png"].each do |image|
        pdf.images << image
      end
      pdf
    end

    def compare_images(left, right, index)
      merged = "#{TEMP}/result#{index + 1}.png"

      images = [
        ChunkyPNG::Image.from_file(left),
        ChunkyPNG::Image.from_file(right)
      ]

      output = ChunkyPNG::Image.new(
        images.first.width, images.last.height, ChunkyPNG::Color::WHITE
        )

      images.first.height.times do |y|
        images.first.row(y).each_with_index do |pixel, x|
          unless pixel == images.last[x, y]
            score = Math.sqrt(
              (ChunkyPNG::Color.r(images.last[x, y]) -
                ChunkyPNG::Color.r(pixel))**2 +
              (ChunkyPNG::Color.g(images.last[x, y]) -
                ChunkyPNG::Color.g(pixel))**2 +
              (ChunkyPNG::Color.b(images.last[x, y]) -
                ChunkyPNG::Color.b(pixel))**2
            ) / Math.sqrt(ChunkyPNG::Color::MAX**2 * 3)
            output[x, y] = ChunkyPNG::Color.grayscale(
              ChunkyPNG::Color::MAX - (score * ChunkyPNG::Color::MAX).round)
          end
        end
      end
      output.save(merged)
      FileUtils.rm_f left
      FileUtils.rm_f right
      { image: merged, width: output.width, height: output.height }
    end
  end
end


text:
package org.eulerframework.web.core.base.dao.impl.hibernate5;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.hibernate.Criteria;
import org.hibernate.FetchMode;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.CriteriaSpecification;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projection;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.hibernate.transform.Transformers;
import org.springframework.util.CollectionUtils;

import org.eulerframework.common.util.JavaObjectUtils;
import org.eulerframework.common.base.log.LogSupport;
import org.eulerframework.common.util.Assert;
import org.eulerframework.common.util.StringUtils;
import org.eulerframework.web.core.base.dao.IBaseDao;
import org.eulerframework.web.core.base.entity.BaseEmbeddable;
import org.eulerframework.web.core.base.entity.BaseEntity;
import org.eulerframework.web.core.base.request.PageQueryRequest;
import org.eulerframework.web.core.base.request.QueryRequest;
import org.eulerframework.web.core.base.request.QueryRequest.OrderMode;
import org.eulerframework.web.core.base.request.QueryRequest.QueryMode;
import org.eulerframework.web.core.base.response.PageResponse;
import org.eulerframework.web.core.extend.hibernate5.RestrictionsX;

public abstract class BaseDao<T extends BaseEntity<?, ?>> extends LogSupport implements IBaseDao<T> {

    private SessionFactory sessionFactory;

    public Session getCurrentSession() {
        return sessionFactory.getCurrentSession();
    }

    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    protected final Class<T> entityClass;

    @SuppressWarnings("unchecked")
    public BaseDao() {
        this.entityClass = (Class<T>) JavaObjectUtils.findSuperClassGenricType(this.getClass(), 0);
    }

    @Override
    public T load(Serializable id) {
        Assert.notNull(id);
        T entity = this.getCurrentSession().get(this.entityClass, id);
        evict(entity);
        return entity;
    }

    @Override
    public List<T> load(Collection<Serializable> ids) {
        Assert.notNull(ids);
        Serializable[] idArray = ids.toArray(new Serializable[0]);
        return this.load(idArray);
    }

    @Override
    public List<T> load(Serializable[] idArray) {
        Assert.notNull(idArray);
        List<T> ret = new ArrayList<>();
        for(Serializable id : idArray){
            T entity = this.load(id);
            if(entity != null) {
                ret.add(entity);
            }
        }
        return ret;
    }

    @Override
    public Serializable save(T entity) {
        Assert.notNull(entity);
        this.cleanBean(entity);
        return this.getSessionFactory().getCurrentSession().save(entity);
    }

    @Override
    public void update(T entity) {
        Assert.notNull(entity);
        this.cleanBean(entity);
        this.getSessionFactory().getCurrentSession().update(entity);

    }

    protected void update(String hql) {
        Assert.notNull(hql);
        this.getSessionFactory().getCurrentSession().createQuery(hql).executeUpdate();
    }

    protected void update(String hql, Object... params) {
        Assert.notNull(hql);
        Assert.notNull(params);
        Query query = this.getSessionFactory().getCurrentSession().createQuery(hql);

        for (int i = 0; i < params.length; i++) {
            query.setParameter(i, params[i]);
        }

        query.executeUpdate();
    }

    @Override
    public void saveOrUpdate(T entity) {
        Assert.notNull(entity);
        this.cleanBean(entity);
        this.getSessionFactory().getCurrentSession().saveOrUpdate(entity);
    }

    @Override
    public void saveOrUpdateBatch(Collection<T> entities) {
        Assert.notNull(entities);
        this.cleanBeans(entities);

        for (T entity : entities) {
            this.saveOrUpdate(entity);
        }
    }

    @Override
    public void delete(T entity) {
        Assert.notNull(entity);
        this.getCurrentSession().delete(entity);
    }

    @Override
    public void deleteBatch(Collection<T> entities) {
        Assert.notNull(entities);
        if (entities == null || entities.isEmpty())
            return;

        for (T entity : entities) {
            this.delete(entity);
        }
    }

    @Override
    public void deleteById(Serializable id) {
        try {
            T entity = this.entityClass.newInstance();
            entity.setSerializable(id);
            this.delete(entity);
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void deleteByIds(Serializable[] idArray) {
        for(Serializable id : idArray) {
            this.deleteById(id);
        }
    }

    @Override
    public void deleteByIds(Collection<Serializable> ids) {
        Serializable[] idArray = ids.toArray(new Serializable[0]);
        this.deleteByIds(idArray);
    }

    @Override
    public List<T> queryByEntity(T entity) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(this.entityClass);
        detachedCriteria.add(Example.create(entity));
        detachedCriteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
        List<T> result = this.query(detachedCriteria);
        evict(result);
        return result;
    }

    @Override
    public List<T> queryAll() {
        StringBuffer hqlBuffer = new StringBuffer();
        hqlBuffer.append("select en from ");
        hqlBuffer.append(this.entityClass.getSimpleName());
        hqlBuffer.append(" en");
        final String hql = hqlBuffer.toString();
        List<T> result = this.query(hql);
        return result;
    }

    @Override
    public long countAll() {
        StringBuffer hqlBuffer = new StringBuffer();
        hqlBuffer.append("select count(*) from ");
        hqlBuffer.append(this.entityClass.getSimpleName());
        final String hql = hqlBuffer.toString();
        List<?> l = this.query(hql);

        if (l != null && l.size() == 1)
            return (Long) l.get(0);
        return 0;
    }

    @Override
    public PageResponse<T> pageQuery(PageQueryRequest pageQueryRequest) {
        return this.pageQuery(pageQueryRequest, null, null, null, null);
    }

    @Override
    public PageResponse<T> pageQuery(
            PageQueryRequest pageQueryRequest,
            List<Criterion> criterions) {
        return this.pageQuery(pageQueryRequest, criterions, null, null, null);
    }

    @Override
    public PageResponse<T> pageQuery(
            PageQueryRequest pageQueryRequest,
            List<Criterion> criterions,
            List<Order> orders) {
        return this.pageQuery(pageQueryRequest, criterions, orders, null, null);
    }

    @Override
    public PageResponse<T> pageQuery(
            PageQueryRequest pageQueryRequest,
            List<Criterion> criterions,
            List<Order> orders,
            Projection projection) {
        return this.pageQuery(pageQueryRequest, criterions, orders, projection, null);
    }

    @Override
    public PageResponse<T> pageQuery(PageQueryRequest pageQueryRequest, List<Criterion> criterions, List<Order> orders, Projection projection, Map<String, FetchMode> fetchMode) {
        DetachedCriteria detachedCriteria = this.analyzeQueryRequest(pageQueryRequest);

        if(!CollectionUtils.isEmpty(criterions)) {
            for(Criterion c : criterions) {
                detachedCriteria.add(c);
            }
        }

        if(!CollectionUtils.isEmpty(orders)) {
            for(Order d : orders) {
                detachedCriteria.addOrder(d);
            }
        }

        if(!CollectionUtils.isEmpty(fetchMode)) {
            for (Map.Entry<String, FetchMode> entry : fetchMode.entrySet()) {
                String property = entry.getKey();
                FetchMode propertyFetchMode = entry.getValue();
                detachedCriteria.setFetchMode(property, propertyFetchMode);
            }
        }

        return this.pageQuery(detachedCriteria, pageQueryRequest.getPageIndex(), pageQueryRequest.getPageSize(), projection);
    }

    @Override
    public void flushSession() {
        this.getCurrentSession().flush();
    }

    @Override
    public boolean isMyEntity(Class<? extends T> clazz) {
        return clazz.equals(this.entityClass);
    }

    @SuppressWarnings("unchecked")
    protected List<T> query(String hql) {
        List<T> result = this.getSessionFactory().getCurrentSession().createQuery(hql).list();
        evict(result);
        return result;
    }

    @SuppressWarnings("unchecked")
    protected List<T> query(String hql, Object... params) {
        Query query = this.getSessionFactory().getCurrentSession().createQuery(hql);

        for (int i = 0; i < params.length; i++) {
            query.setParameter(i, params[i]);
        }

        List<T> result = query.list();
        evict(result);
        return result;
    }

    @SuppressWarnings("unchecked")
    protected List<T> query(DetachedCriteria detachedCriteria) {
        List<T> result = detachedCriteria.getExecutableCriteria(this.getSessionFactory().getCurrentSession()).list();
        evict(result);
        return result;
    }

    @SuppressWarnings("unchecked")
    protected List<T> limitQuery(String hql, int maxResults) {
        Query query = this.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setMaxResults(maxResults);
        List<T> result = query.list();
        evict(result);
        return result;
    }

    @SuppressWarnings("unchecked")
    protected List<T> limitQuery(String hql, int maxResults, Object... params) {
        Query query = this.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setMaxResults(maxResults);

        for (int i = 0; i < params.length; i++) {
            query.setParameter(i, params[i]);
        }

        List<T> result = query.list();
        evict(result);
        return result;
    }

    @SuppressWarnings("unchecked")
    protected List<T> limitQuery(DetachedCriteria detachedCriteria, int maxResults) {
        Criteria criteria = detachedCriteria.getExecutableCriteria(this.getSessionFactory().getCurrentSession());

        criteria.setMaxResults(maxResults);

        List<T> result = criteria.list();
        evict(result);
        return result;
    }

    protected PageResponse<T> pageQuery(DetachedCriteria detachedCriteria, int pageIndex, int pageSize) {
        return this.pageQuery(detachedCriteria, pageIndex, pageSize, null);
    }

    @SuppressWarnings("unchecked")
    protected PageResponse<T> pageQuery(DetachedCriteria detachedCriteria, int pageIndex, int pageSize, Projection projection) {

        detachedCriteria.setProjection(Projections.rowCount());
        long total = ((Long)detachedCriteria.getExecutableCriteria(this.getSessionFactory().getCurrentSession()).list().get(0)).longValue();

        detachedCriteria.setProjection(projection);

        if(projection != null)
            detachedCriteria.setResultTransformer(Transformers.aliasToBean(this.entityClass));

        Criteria criteria = detachedCriteria.getExecutableCriteria(this.getSessionFactory().getCurrentSession());
        criteria.setFirstResult((pageIndex - 1) * pageSize);
        criteria.setMaxResults(pageSize);
        List<T> result = criteria.list();
        evict(result);
        return new PageResponse<>(result, total, pageIndex, pageSize);
    }

    protected final void evict(Object entity) {
        if (entity == null || !BaseEntity.class.isAssignableFrom(entity.getClass()))
            return;
        this.getCurrentSession().evict(entity);
    }

    protected void evict(Collection<?> entities) {
        if (entities == null)
            return;

        for (Object entity : entities) {
            if (entity == null)
                continue;
            evict(entity);
        }
    }

    protected void cleanBeans(Collection<T> entities) {
        for (T entity : entities)
            this.cleanBean(entity);
    }

    protected void cleanBean(T entity) {
        JavaObjectUtils.clearEmptyProperty(entity);
    }

    protected DetachedCriteria analyzeQueryRequest(QueryRequest queryRequest) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(this.entityClass);

        Map<String, String> queryMap = queryRequest.getQueryMap();

        if(queryRequest.useOr()) {
            List<Criterion> criterions = new ArrayList<>();

            for (Map.Entry<String, String> entry : queryMap.entrySet()) {
                String property = entry.getKey();
                String value = entry.getValue();

                if(StringUtils.isNull(value))
                    continue;

                QueryMode queryMode = queryRequest.getQueryMode(property);
                try {
                    criterions.add(this.generateRestriction(property, value, queryMode));
                } catch (NumberFormatException e) {
                    this.logger.warn(e.getMessage() + " property:" + property);
                }
            }

            detachedCriteria.add(Restrictions.or(criterions.toArray(new Criterion [0])));
        } else {
            for (Map.Entry<String, String> entry : queryMap.entrySet()) {
                String property = entry.getKey();
                String value = entry.getValue();

                if(StringUtils.isNull(value))
                    continue;

                QueryMode queryMode = queryRequest.getQueryMode(property);
                detachedCriteria.add(this.generateRestriction(property, value, queryMode));
            }
        }

        LinkedHashMap<String, OrderMode> sortMap = queryRequest.getSortMap();

        for (Map.Entry<String, OrderMode> entry : sortMap.entrySet()) {
            String property = entry.getKey();
            OrderMode value = entry.getValue();

            if(value == null)
                continue;

            detachedCriteria.addOrder(this.analyzeOrderMode(property, value));
        }

        return detachedCriteria;
    }

    protected Order analyzeOrderMode(String property, OrderMode orderMode) {
        try {
            this.entityClass.getDeclaredField(property);
        } catch (NoSuchFieldException e) {
            throw new IllegalArgumentException("Property '" + property + "' not exist");
        }

        switch (orderMode) {
        case ASC:
            return Order.asc(property);
        case DESC:
            return Order.desc(property);
        default:
            throw new IllegalArgumentException("Unknown order mode: " + orderMode);
        }
    }

    protected Criterion generateRestriction(String property, String value, QueryMode queryMode) {
        Field field;
        try {
            String fieldName = property;
            if(property.indexOf('.') > 0) {
                fieldName = property.substring(0, property.indexOf('.'));
            }
            field = this.entityClass.getDeclaredField(fieldName);
        } catch (NoSuchFieldException e) {
            throw new IllegalArgumentException("Property '" + property + "' not exist");
        }

        if(BaseEmbeddable.class.isAssignableFrom(field.getType())){
            try {
                field = field.getType().getDeclaredField(property.substring(property.indexOf('.') + 1));
            } catch (NoSuchFieldException e) {
                throw new IllegalArgumentException("Property '" + property + "' not exist");
            }
        }

        switch (queryMode) {
        case ANYWHERE:
            return RestrictionsX.like(property, value, MatchMode.ANYWHERE);
        case START:
            return RestrictionsX.like(property, value, MatchMode.START);
        case END:
            return RestrictionsX.like(property, value, MatchMode.END);
        case EXACT:
            return RestrictionsX.like(property, value, MatchMode.EXACT);
        case GE:
            return Restrictions.ge(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case GT:
            return Restrictions.gt(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case LE:
            return Restrictions.le(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case LT:
            return Restrictions.lt(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case IN:
            return Restrictions.in(property, this.analyzeInterval(value, field.getType()));
        case NOTIN:
            return Restrictions.not(RestrictionsX.in(property, this.analyzeInterval(value, field.getType())));
        case IS:
            return Restrictions.eq(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case NOT:
            return Restrictions.ne(property, JavaObjectUtils.analyzeStringValueToObject(value, field.getType()));
        case BETWEEN:
            Object[] array1 = this.analyzeInterval(value, field.getType());
            return Restrictions.between(property, array1[0], array1[1]);
        case OUTSIDE:
            Object[] array2 = this.analyzeInterval(value, field.getType());
            return Restrictions.not(Restrictions.between(property, array2[0], array2[1]));
        default:
            throw new IllegalArgumentException("Unknown query mode: " + queryMode);
        }
    }

    private Object[] analyzeInterval(String value, Class<?> clazz) {
        String[] valueArray = value.split(",");

        Object[] result = new Object[valueArray.length];

        for(int i = 0; i < valueArray.length; i++) {
            result[i] = JavaObjectUtils.analyzeStringValueToObject(valueArray[i], clazz);
        }
        return result;
    }
}


text:
package com.lightcrafts.ui.editor;

/**
 * When the application decides to save a document, if the editor's crop or
 * rotate mode is active, then the temporary mode state (the crop bounds the
 * user sees) must be committed to the engine while the save is happening, to
 * make sure that the thumbnail, preview, and LZN all match what the user
 * sees in the mode.
 * <p>
 * When the application notifies the editor that save is occurring, the
 * editor commits any active crop or rotate mode and returns what its state
 * was before the commit in a TemporaryEditorCommitState.  Then the
 * application submits this same TemporaryEditorCommitState when it notifies
 * the editor that the save is done.
 */
public class TemporaryEditorCommitState {

    boolean isCropActive;

    boolean isRotateActive;

    TemporaryEditorCommitState(boolean rotate, boolean crop) {
        isRotateActive = rotate;
        isCropActive = crop;
    }
}


text:
{% extends "base_generic.html" %}

{% block content %}

    {% if user.is_staff %}
        Admin
    {% endif %}

{{ place.name }}

Country: {{ place.country }}

Region: {{ place.region }}

{% if region.description %}

Region description: {{ region.description }}
{% endif %}
{% if place.australian_state %}

Australian State: {{ place.australian_state }}

{% endif %}
{% if place.gn_id %}

GeoNames: {{place.gn_name}}

{% endif %}

Items

{% include "snippets/paged_object_list.html" %}

Map

{% endblock %}

{% block javascript %}
{{block.super}}

{% endblock javascript %}