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

com.amazonaws.services.pinpointsmsvoicev2.model.transform.PhoneNumberInformationMarshaller Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Pinpoint SMS Voice V2 module holds the client classes that are used for communicating with Amazon Pinpoint SMS Voice V2 Service

The newest version!
/*
 * 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.pinpointsmsvoicev2.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.pinpointsmsvoicev2.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * PhoneNumberInformationMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class PhoneNumberInformationMarshaller {

    private static final MarshallingInfo PHONENUMBERARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PhoneNumberArn").build();
    private static final MarshallingInfo PHONENUMBERID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PhoneNumberId").build();
    private static final MarshallingInfo PHONENUMBER_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PhoneNumber").build();
    private static final MarshallingInfo STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Status").build();
    private static final MarshallingInfo ISOCOUNTRYCODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("IsoCountryCode").build();
    private static final MarshallingInfo MESSAGETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MessageType").build();
    private static final MarshallingInfo NUMBERCAPABILITIES_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NumberCapabilities").build();
    private static final MarshallingInfo NUMBERTYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NumberType").build();
    private static final MarshallingInfo MONTHLYLEASINGPRICE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MonthlyLeasingPrice").build();
    private static final MarshallingInfo TWOWAYENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TwoWayEnabled").build();
    private static final MarshallingInfo TWOWAYCHANNELARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TwoWayChannelArn").build();
    private static final MarshallingInfo TWOWAYCHANNELROLE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TwoWayChannelRole").build();
    private static final MarshallingInfo SELFMANAGEDOPTOUTSENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SelfManagedOptOutsEnabled").build();
    private static final MarshallingInfo OPTOUTLISTNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("OptOutListName").build();
    private static final MarshallingInfo DELETIONPROTECTIONENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DeletionProtectionEnabled").build();
    private static final MarshallingInfo POOLID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("PoolId").build();
    private static final MarshallingInfo REGISTRATIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("RegistrationId").build();
    private static final MarshallingInfo CREATEDTIMESTAMP_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreatedTimestamp").timestampFormat("unixTimestamp").build();

    private static final PhoneNumberInformationMarshaller instance = new PhoneNumberInformationMarshaller();

    public static PhoneNumberInformationMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(PhoneNumberInformation phoneNumberInformation, ProtocolMarshaller protocolMarshaller) {

        if (phoneNumberInformation == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumberArn(), PHONENUMBERARN_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumberId(), PHONENUMBERID_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumber(), PHONENUMBER_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getStatus(), STATUS_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getIsoCountryCode(), ISOCOUNTRYCODE_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getMessageType(), MESSAGETYPE_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getNumberCapabilities(), NUMBERCAPABILITIES_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getNumberType(), NUMBERTYPE_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getMonthlyLeasingPrice(), MONTHLYLEASINGPRICE_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getTwoWayEnabled(), TWOWAYENABLED_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getTwoWayChannelArn(), TWOWAYCHANNELARN_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getTwoWayChannelRole(), TWOWAYCHANNELROLE_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getSelfManagedOptOutsEnabled(), SELFMANAGEDOPTOUTSENABLED_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getOptOutListName(), OPTOUTLISTNAME_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getDeletionProtectionEnabled(), DELETIONPROTECTIONENABLED_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getPoolId(), POOLID_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getRegistrationId(), REGISTRATIONID_BINDING);
            protocolMarshaller.marshall(phoneNumberInformation.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy