com.amazonaws.services.health.model.transform.EventMarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-health Show documentation
Show all versions of aws-java-sdk-health Show documentation
The AWS Java SDK for AWS Health APIs and Notifications module holds the client classes that are used for communicating with AWS Health APIs and Notifications service.
/*
* Copyright 2017-2022 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.health.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.health.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* EventMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class EventMarshaller {
private static final MarshallingInfo ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("arn").build();
private static final MarshallingInfo SERVICE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("service").build();
private static final MarshallingInfo EVENTTYPECODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("eventTypeCode").build();
private static final MarshallingInfo EVENTTYPECATEGORY_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("eventTypeCategory").build();
private static final MarshallingInfo REGION_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("region").build();
private static final MarshallingInfo AVAILABILITYZONE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("availabilityZone").build();
private static final MarshallingInfo STARTTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("startTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo ENDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("endTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo LASTUPDATEDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("lastUpdatedTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo STATUSCODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("statusCode").build();
private static final MarshallingInfo EVENTSCOPECODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("eventScopeCode").build();
private static final EventMarshaller instance = new EventMarshaller();
public static EventMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(Event event, ProtocolMarshaller protocolMarshaller) {
if (event == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(event.getArn(), ARN_BINDING);
protocolMarshaller.marshall(event.getService(), SERVICE_BINDING);
protocolMarshaller.marshall(event.getEventTypeCode(), EVENTTYPECODE_BINDING);
protocolMarshaller.marshall(event.getEventTypeCategory(), EVENTTYPECATEGORY_BINDING);
protocolMarshaller.marshall(event.getRegion(), REGION_BINDING);
protocolMarshaller.marshall(event.getAvailabilityZone(), AVAILABILITYZONE_BINDING);
protocolMarshaller.marshall(event.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(event.getEndTime(), ENDTIME_BINDING);
protocolMarshaller.marshall(event.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);
protocolMarshaller.marshall(event.getStatusCode(), STATUSCODE_BINDING);
protocolMarshaller.marshall(event.getEventScopeCode(), EVENTSCOPECODE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy