All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.databasemigration.transform.TableStatisticsMarshaller Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

The newest version!
/*
 * Copyright 2013-2018 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 software.amazon.awssdk.services.databasemigration.transform;

import java.time.Instant;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingInfo;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.services.databasemigration.model.TableStatistics;
import software.amazon.awssdk.utils.Validate;

/**
 * {@link TableStatistics} Marshaller
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public class TableStatisticsMarshaller {
    private static final MarshallingInfo SCHEMANAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SchemaName").isBinary(false).build();

    private static final MarshallingInfo TABLENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TableName").isBinary(false).build();

    private static final MarshallingInfo INSERTS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Inserts").isBinary(false).build();

    private static final MarshallingInfo DELETES_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Deletes").isBinary(false).build();

    private static final MarshallingInfo UPDATES_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Updates").isBinary(false).build();

    private static final MarshallingInfo DDLS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Ddls").isBinary(false).build();

    private static final MarshallingInfo FULLLOADROWS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("FullLoadRows").isBinary(false).build();

    private static final MarshallingInfo FULLLOADCONDTNLCHKFAILEDROWS_BINDING = MarshallingInfo
            .builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("FullLoadCondtnlChkFailedRows").isBinary(false).build();

    private static final MarshallingInfo FULLLOADERRORROWS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("FullLoadErrorRows").isBinary(false).build();

    private static final MarshallingInfo LASTUPDATETIME_BINDING = MarshallingInfo.builder(MarshallingType.INSTANT)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LastUpdateTime").isBinary(false).build();

    private static final MarshallingInfo TABLESTATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TableState").isBinary(false).build();

    private static final MarshallingInfo VALIDATIONPENDINGRECORDS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ValidationPendingRecords").isBinary(false).build();

    private static final MarshallingInfo VALIDATIONFAILEDRECORDS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ValidationFailedRecords").isBinary(false).build();

    private static final MarshallingInfo VALIDATIONSUSPENDEDRECORDS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ValidationSuspendedRecords").isBinary(false)
            .build();

    private static final MarshallingInfo VALIDATIONSTATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ValidationState").isBinary(false).build();

    private static final TableStatisticsMarshaller INSTANCE = new TableStatisticsMarshaller();

    private TableStatisticsMarshaller() {
    }

    public static TableStatisticsMarshaller getInstance() {
        return INSTANCE;
    }

    /**
     * Marshall the given parameter object
     */
    public void marshall(TableStatistics tableStatistics, ProtocolMarshaller protocolMarshaller) {
        Validate.paramNotNull(tableStatistics, "tableStatistics");
        Validate.paramNotNull(protocolMarshaller, "protocolMarshaller");
        try {
            protocolMarshaller.marshall(tableStatistics.schemaName(), SCHEMANAME_BINDING);
            protocolMarshaller.marshall(tableStatistics.tableName(), TABLENAME_BINDING);
            protocolMarshaller.marshall(tableStatistics.inserts(), INSERTS_BINDING);
            protocolMarshaller.marshall(tableStatistics.deletes(), DELETES_BINDING);
            protocolMarshaller.marshall(tableStatistics.updates(), UPDATES_BINDING);
            protocolMarshaller.marshall(tableStatistics.ddls(), DDLS_BINDING);
            protocolMarshaller.marshall(tableStatistics.fullLoadRows(), FULLLOADROWS_BINDING);
            protocolMarshaller.marshall(tableStatistics.fullLoadCondtnlChkFailedRows(), FULLLOADCONDTNLCHKFAILEDROWS_BINDING);
            protocolMarshaller.marshall(tableStatistics.fullLoadErrorRows(), FULLLOADERRORROWS_BINDING);
            protocolMarshaller.marshall(tableStatistics.lastUpdateTime(), LASTUPDATETIME_BINDING);
            protocolMarshaller.marshall(tableStatistics.tableState(), TABLESTATE_BINDING);
            protocolMarshaller.marshall(tableStatistics.validationPendingRecords(), VALIDATIONPENDINGRECORDS_BINDING);
            protocolMarshaller.marshall(tableStatistics.validationFailedRecords(), VALIDATIONFAILEDRECORDS_BINDING);
            protocolMarshaller.marshall(tableStatistics.validationSuspendedRecords(), VALIDATIONSUSPENDEDRECORDS_BINDING);
            protocolMarshaller.marshall(tableStatistics.validationState(), VALIDATIONSTATE_BINDING);
        } catch (Exception e) {
            throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy