com.amazonaws.services.comprehend.model.transform.DatasetPropertiesMarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-comprehend Show documentation
Show all versions of aws-java-sdk-comprehend Show documentation
The AWS Java SDK for Amazon Comprehend module holds the client classes that are used for communicating with Amazon Comprehend Service
/*
* 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.comprehend.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.comprehend.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* DatasetPropertiesMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DatasetPropertiesMarshaller {
private static final MarshallingInfo DATASETARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DatasetArn").build();
private static final MarshallingInfo DATASETNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DatasetName").build();
private static final MarshallingInfo DATASETTYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DatasetType").build();
private static final MarshallingInfo DATASETS3URI_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DatasetS3Uri").build();
private static final MarshallingInfo DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build();
private static final MarshallingInfo STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Status").build();
private static final MarshallingInfo MESSAGE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Message").build();
private static final MarshallingInfo NUMBEROFDOCUMENTS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NumberOfDocuments").build();
private static final MarshallingInfo CREATIONTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreationTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo ENDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("EndTime").timestampFormat("unixTimestamp").build();
private static final DatasetPropertiesMarshaller instance = new DatasetPropertiesMarshaller();
public static DatasetPropertiesMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(DatasetProperties datasetProperties, ProtocolMarshaller protocolMarshaller) {
if (datasetProperties == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(datasetProperties.getDatasetArn(), DATASETARN_BINDING);
protocolMarshaller.marshall(datasetProperties.getDatasetName(), DATASETNAME_BINDING);
protocolMarshaller.marshall(datasetProperties.getDatasetType(), DATASETTYPE_BINDING);
protocolMarshaller.marshall(datasetProperties.getDatasetS3Uri(), DATASETS3URI_BINDING);
protocolMarshaller.marshall(datasetProperties.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(datasetProperties.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(datasetProperties.getMessage(), MESSAGE_BINDING);
protocolMarshaller.marshall(datasetProperties.getNumberOfDocuments(), NUMBEROFDOCUMENTS_BINDING);
protocolMarshaller.marshall(datasetProperties.getCreationTime(), CREATIONTIME_BINDING);
protocolMarshaller.marshall(datasetProperties.getEndTime(), ENDTIME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}