
com.amazonaws.services.lightsail.model.transform.AlarmMarshaller Maven / Gradle / Ivy
/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.lightsail.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.lightsail.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* AlarmMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AlarmMarshaller {
private static final MarshallingInfo NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("name").build();
private static final MarshallingInfo ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("arn").build();
private static final MarshallingInfo CREATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("createdAt").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo LOCATION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("location").build();
private static final MarshallingInfo RESOURCETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("resourceType").build();
private static final MarshallingInfo SUPPORTCODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("supportCode").build();
private static final MarshallingInfo MONITOREDRESOURCEINFO_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("monitoredResourceInfo").build();
private static final MarshallingInfo COMPARISONOPERATOR_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("comparisonOperator").build();
private static final MarshallingInfo EVALUATIONPERIODS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("evaluationPeriods").build();
private static final MarshallingInfo PERIOD_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("period").build();
private static final MarshallingInfo THRESHOLD_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("threshold").build();
private static final MarshallingInfo DATAPOINTSTOALARM_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("datapointsToAlarm").build();
private static final MarshallingInfo TREATMISSINGDATA_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("treatMissingData").build();
private static final MarshallingInfo STATISTIC_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("statistic").build();
private static final MarshallingInfo METRICNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("metricName").build();
private static final MarshallingInfo STATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("state").build();
private static final MarshallingInfo UNIT_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("unit").build();
private static final MarshallingInfo CONTACTPROTOCOLS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("contactProtocols").build();
private static final MarshallingInfo NOTIFICATIONTRIGGERS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("notificationTriggers").build();
private static final MarshallingInfo NOTIFICATIONENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("notificationEnabled").build();
private static final AlarmMarshaller instance = new AlarmMarshaller();
public static AlarmMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(Alarm alarm, ProtocolMarshaller protocolMarshaller) {
if (alarm == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(alarm.getName(), NAME_BINDING);
protocolMarshaller.marshall(alarm.getArn(), ARN_BINDING);
protocolMarshaller.marshall(alarm.getCreatedAt(), CREATEDAT_BINDING);
protocolMarshaller.marshall(alarm.getLocation(), LOCATION_BINDING);
protocolMarshaller.marshall(alarm.getResourceType(), RESOURCETYPE_BINDING);
protocolMarshaller.marshall(alarm.getSupportCode(), SUPPORTCODE_BINDING);
protocolMarshaller.marshall(alarm.getMonitoredResourceInfo(), MONITOREDRESOURCEINFO_BINDING);
protocolMarshaller.marshall(alarm.getComparisonOperator(), COMPARISONOPERATOR_BINDING);
protocolMarshaller.marshall(alarm.getEvaluationPeriods(), EVALUATIONPERIODS_BINDING);
protocolMarshaller.marshall(alarm.getPeriod(), PERIOD_BINDING);
protocolMarshaller.marshall(alarm.getThreshold(), THRESHOLD_BINDING);
protocolMarshaller.marshall(alarm.getDatapointsToAlarm(), DATAPOINTSTOALARM_BINDING);
protocolMarshaller.marshall(alarm.getTreatMissingData(), TREATMISSINGDATA_BINDING);
protocolMarshaller.marshall(alarm.getStatistic(), STATISTIC_BINDING);
protocolMarshaller.marshall(alarm.getMetricName(), METRICNAME_BINDING);
protocolMarshaller.marshall(alarm.getState(), STATE_BINDING);
protocolMarshaller.marshall(alarm.getUnit(), UNIT_BINDING);
protocolMarshaller.marshall(alarm.getContactProtocols(), CONTACTPROTOCOLS_BINDING);
protocolMarshaller.marshall(alarm.getNotificationTriggers(), NOTIFICATIONTRIGGERS_BINDING);
protocolMarshaller.marshall(alarm.getNotificationEnabled(), NOTIFICATIONENABLED_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy