com.amazonaws.services.redshiftdataapi.model.transform.StatementDataMarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-redshiftdataapi Show documentation
Show all versions of aws-java-sdk-redshiftdataapi Show documentation
The AWS Java SDK for Redshift Data API module holds the client classes that are used for communicating with Redshift Data API Service
/*
* Copyright 2019-2024 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.redshiftdataapi.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.redshiftdataapi.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* StatementDataMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class StatementDataMarshaller {
private static final MarshallingInfo CREATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreatedAt").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo ID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Id").build();
private static final MarshallingInfo ISBATCHSTATEMENT_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("IsBatchStatement").build();
private static final MarshallingInfo QUERYPARAMETERS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("QueryParameters").build();
private static final MarshallingInfo QUERYSTRING_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("QueryString").build();
private static final MarshallingInfo QUERYSTRINGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("QueryStrings").build();
private static final MarshallingInfo SECRETARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("SecretArn").build();
private static final MarshallingInfo STATEMENTNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("StatementName").build();
private static final MarshallingInfo STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Status").build();
private static final MarshallingInfo UPDATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("UpdatedAt").timestampFormat("unixTimestamp").build();
private static final StatementDataMarshaller instance = new StatementDataMarshaller();
public static StatementDataMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(StatementData statementData, ProtocolMarshaller protocolMarshaller) {
if (statementData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(statementData.getCreatedAt(), CREATEDAT_BINDING);
protocolMarshaller.marshall(statementData.getId(), ID_BINDING);
protocolMarshaller.marshall(statementData.getIsBatchStatement(), ISBATCHSTATEMENT_BINDING);
protocolMarshaller.marshall(statementData.getQueryParameters(), QUERYPARAMETERS_BINDING);
protocolMarshaller.marshall(statementData.getQueryString(), QUERYSTRING_BINDING);
protocolMarshaller.marshall(statementData.getQueryStrings(), QUERYSTRINGS_BINDING);
protocolMarshaller.marshall(statementData.getSecretArn(), SECRETARN_BINDING);
protocolMarshaller.marshall(statementData.getStatementName(), STATEMENTNAME_BINDING);
protocolMarshaller.marshall(statementData.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(statementData.getUpdatedAt(), UPDATEDAT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}