/* * Copyright 2012-2017 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.opsworkscm.model.transform; import java.util.List; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.opsworkscm.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * BackupMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class BackupMarshaller { private static final MarshallingInfo<String> BACKUPARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("BackupArn").build(); private static final MarshallingInfo<String> BACKUPID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("BackupId").build(); private static final MarshallingInfo<String> BACKUPTYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("BackupType").build(); private static final MarshallingInfo<java.util.Date> CREATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreatedAt").build(); private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build(); private static final MarshallingInfo<String> ENGINE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Engine").build(); private static final MarshallingInfo<String> ENGINEMODEL_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("EngineModel").build(); private static final MarshallingInfo<String> ENGINEVERSION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("EngineVersion").build(); private static final MarshallingInfo<String> INSTANCEPROFILEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("InstanceProfileArn").build(); private static final MarshallingInfo<String> INSTANCETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("InstanceType").build(); private static final MarshallingInfo<String> KEYPAIR_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("KeyPair").build(); private static final MarshallingInfo<String> PREFERREDBACKUPWINDOW_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PreferredBackupWindow").build(); private static final MarshallingInfo<String> PREFERREDMAINTENANCEWINDOW_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PreferredMaintenanceWindow").build(); private static final MarshallingInfo<Integer> S3DATASIZE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("S3DataSize").build(); private static final MarshallingInfo<String> S3DATAURL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("S3DataUrl").build(); private static final MarshallingInfo<String> S3LOGURL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("S3LogUrl").build(); private static final MarshallingInfo<List> SECURITYGROUPIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SecurityGroupIds").build(); private static final MarshallingInfo<String> SERVERNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ServerName").build(); private static final MarshallingInfo<String> SERVICEROLEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ServiceRoleArn").build(); private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Status").build(); private static final MarshallingInfo<String> STATUSDESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("StatusDescription").build(); private static final MarshallingInfo<List> SUBNETIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("SubnetIds").build(); private static final MarshallingInfo<String> TOOLSVERSION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ToolsVersion").build(); private static final MarshallingInfo<String> USERARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("UserArn").build(); private static final BackupMarshaller instance = new BackupMarshaller(); public static BackupMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(Backup backup, ProtocolMarshaller protocolMarshaller) { if (backup == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(backup.getBackupArn(), BACKUPARN_BINDING); protocolMarshaller.marshall(backup.getBackupId(), BACKUPID_BINDING); protocolMarshaller.marshall(backup.getBackupType(), BACKUPTYPE_BINDING); protocolMarshaller.marshall(backup.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(backup.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(backup.getEngine(), ENGINE_BINDING); protocolMarshaller.marshall(backup.getEngineModel(), ENGINEMODEL_BINDING); protocolMarshaller.marshall(backup.getEngineVersion(), ENGINEVERSION_BINDING); protocolMarshaller.marshall(backup.getInstanceProfileArn(), INSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(backup.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(backup.getKeyPair(), KEYPAIR_BINDING); protocolMarshaller.marshall(backup.getPreferredBackupWindow(), PREFERREDBACKUPWINDOW_BINDING); protocolMarshaller.marshall(backup.getPreferredMaintenanceWindow(), PREFERREDMAINTENANCEWINDOW_BINDING); protocolMarshaller.marshall(backup.getS3DataSize(), S3DATASIZE_BINDING); protocolMarshaller.marshall(backup.getS3DataUrl(), S3DATAURL_BINDING); protocolMarshaller.marshall(backup.getS3LogUrl(), S3LOGURL_BINDING); protocolMarshaller.marshall(backup.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING); protocolMarshaller.marshall(backup.getServerName(), SERVERNAME_BINDING); protocolMarshaller.marshall(backup.getServiceRoleArn(), SERVICEROLEARN_BINDING); protocolMarshaller.marshall(backup.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(backup.getStatusDescription(), STATUSDESCRIPTION_BINDING); protocolMarshaller.marshall(backup.getSubnetIds(), SUBNETIDS_BINDING); protocolMarshaller.marshall(backup.getToolsVersion(), TOOLSVERSION_BINDING); protocolMarshaller.marshall(backup.getUserArn(), USERARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }