com.amazonaws.services.guardduty.model.transform.S3BucketDetailMarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-guardduty Show documentation
Show all versions of aws-java-sdk-guardduty Show documentation
The AWS Java SDK for Amazon GuardDuty module holds the client classes that are used for communicating with Amazon GuardDuty Service
/*
* Copyright 2015-2020 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.guardduty.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.guardduty.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* S3BucketDetailMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class S3BucketDetailMarshaller {
private static final MarshallingInfo ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("arn").build();
private static final MarshallingInfo NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("name").build();
private static final MarshallingInfo TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("type").build();
private static final MarshallingInfo CREATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("createdAt").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo OWNER_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("owner").build();
private static final MarshallingInfo TAGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("tags").build();
private static final MarshallingInfo DEFAULTSERVERSIDEENCRYPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("defaultServerSideEncryption").build();
private static final MarshallingInfo PUBLICACCESS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("publicAccess").build();
private static final S3BucketDetailMarshaller instance = new S3BucketDetailMarshaller();
public static S3BucketDetailMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(S3BucketDetail s3BucketDetail, ProtocolMarshaller protocolMarshaller) {
if (s3BucketDetail == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3BucketDetail.getArn(), ARN_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getName(), NAME_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getType(), TYPE_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getCreatedAt(), CREATEDAT_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getOwner(), OWNER_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getTags(), TAGS_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getDefaultServerSideEncryption(), DEFAULTSERVERSIDEENCRYPTION_BINDING);
protocolMarshaller.marshall(s3BucketDetail.getPublicAccess(), PUBLICACCESS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}