You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.cpp

75 lines
2.5 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AWSMetricsServiceApi.h>
#include<AWSMetricsConstant.h>
#include <AWSCoreBus.h>
namespace AWSMetrics
{
namespace ServiceAPI
{
bool MetricsEventSuccessResponseRecord::OnJsonKey(const char* key, AWSCore::JsonReader& reader)
{
if (strcmp(key, AwsMetricsSuccessResponseRecordKeyErrorCode) == 0) return reader.Accept(errorCode);
if (strcmp(key, AwsMetricsSuccessResponseRecordKeyResult) == 0) return reader.Accept(result);
return reader.Ignore();
}
bool MetricsEventSuccessResponse::OnJsonKey(const char* key, AWSCore::JsonReader& reader)
{
if (strcmp(key, AwsMetricsSuccessResponseKeyFailedRecordCount) == 0) return reader.Accept(failedRecordCount);
if (strcmp(key, AwsMetricsSuccessResponseKeyEvents) == 0) return reader.Accept(events);
if (strcmp(key, AwsMetricsSuccessResponseKeyTotal) == 0) return reader.Accept(total);
return reader.Ignore();
}
bool Error::OnJsonKey(const char* key, AWSCore::JsonReader& reader)
{
if (strcmp(key, AwsMetricsErrorKeyMessage) == 0) return reader.Accept(message);
if (strcmp(key, AwsMetricsErrorKeyType) == 0) return reader.Accept(type);
return reader.Ignore();
}
// Generated Function Parameters
bool PostProducerEventsRequest::Parameters::BuildRequest(AWSCore::RequestBuilder& request)
{
bool ok = true;
ok = ok && request.WriteJsonBodyParameter(*this);
return ok;
}
bool PostProducerEventsRequest::Parameters::WriteJson(AWSCore::JsonWriter& writer) const
{
bool ok = true;
ok = ok && writer.StartObject();
ok = ok && writer.Key(AwsMetricsRequestParameterKeyEvents);
ok = ok && data.SerializeToJson(writer);
ok = ok && writer.EndObject();
return ok;
}
}
}