Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 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.clouddirectory.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents the output of a BatchWrite operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BatchWriteOperation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CREATE_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CreateObject")
.getter(getter(BatchWriteOperation::createObject)).setter(setter(Builder::createObject))
.constructor(BatchCreateObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateObject").build()).build();
private static final SdkField ATTACH_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AttachObject")
.getter(getter(BatchWriteOperation::attachObject)).setter(setter(Builder::attachObject))
.constructor(BatchAttachObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachObject").build()).build();
private static final SdkField DETACH_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DetachObject")
.getter(getter(BatchWriteOperation::detachObject)).setter(setter(Builder::detachObject))
.constructor(BatchDetachObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetachObject").build()).build();
private static final SdkField UPDATE_OBJECT_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("UpdateObjectAttributes")
.getter(getter(BatchWriteOperation::updateObjectAttributes)).setter(setter(Builder::updateObjectAttributes))
.constructor(BatchUpdateObjectAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdateObjectAttributes").build())
.build();
private static final SdkField DELETE_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DeleteObject")
.getter(getter(BatchWriteOperation::deleteObject)).setter(setter(Builder::deleteObject))
.constructor(BatchDeleteObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeleteObject").build()).build();
private static final SdkField ADD_FACET_TO_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AddFacetToObject")
.getter(getter(BatchWriteOperation::addFacetToObject)).setter(setter(Builder::addFacetToObject))
.constructor(BatchAddFacetToObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AddFacetToObject").build()).build();
private static final SdkField REMOVE_FACET_FROM_OBJECT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RemoveFacetFromObject")
.getter(getter(BatchWriteOperation::removeFacetFromObject)).setter(setter(Builder::removeFacetFromObject))
.constructor(BatchRemoveFacetFromObject::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoveFacetFromObject").build())
.build();
private static final SdkField ATTACH_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AttachPolicy")
.getter(getter(BatchWriteOperation::attachPolicy)).setter(setter(Builder::attachPolicy))
.constructor(BatchAttachPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachPolicy").build()).build();
private static final SdkField DETACH_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DetachPolicy")
.getter(getter(BatchWriteOperation::detachPolicy)).setter(setter(Builder::detachPolicy))
.constructor(BatchDetachPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetachPolicy").build()).build();
private static final SdkField CREATE_INDEX_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CreateIndex")
.getter(getter(BatchWriteOperation::createIndex)).setter(setter(Builder::createIndex))
.constructor(BatchCreateIndex::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateIndex").build()).build();
private static final SdkField ATTACH_TO_INDEX_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AttachToIndex")
.getter(getter(BatchWriteOperation::attachToIndex)).setter(setter(Builder::attachToIndex))
.constructor(BatchAttachToIndex::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachToIndex").build()).build();
private static final SdkField DETACH_FROM_INDEX_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DetachFromIndex")
.getter(getter(BatchWriteOperation::detachFromIndex)).setter(setter(Builder::detachFromIndex))
.constructor(BatchDetachFromIndex::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetachFromIndex").build()).build();
private static final SdkField ATTACH_TYPED_LINK_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AttachTypedLink")
.getter(getter(BatchWriteOperation::attachTypedLink)).setter(setter(Builder::attachTypedLink))
.constructor(BatchAttachTypedLink::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachTypedLink").build()).build();
private static final SdkField DETACH_TYPED_LINK_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DetachTypedLink")
.getter(getter(BatchWriteOperation::detachTypedLink)).setter(setter(Builder::detachTypedLink))
.constructor(BatchDetachTypedLink::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetachTypedLink").build()).build();
private static final SdkField UPDATE_LINK_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("UpdateLinkAttributes")
.getter(getter(BatchWriteOperation::updateLinkAttributes)).setter(setter(Builder::updateLinkAttributes))
.constructor(BatchUpdateLinkAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdateLinkAttributes").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATE_OBJECT_FIELD,
ATTACH_OBJECT_FIELD, DETACH_OBJECT_FIELD, UPDATE_OBJECT_ATTRIBUTES_FIELD, DELETE_OBJECT_FIELD,
ADD_FACET_TO_OBJECT_FIELD, REMOVE_FACET_FROM_OBJECT_FIELD, ATTACH_POLICY_FIELD, DETACH_POLICY_FIELD,
CREATE_INDEX_FIELD, ATTACH_TO_INDEX_FIELD, DETACH_FROM_INDEX_FIELD, ATTACH_TYPED_LINK_FIELD, DETACH_TYPED_LINK_FIELD,
UPDATE_LINK_ATTRIBUTES_FIELD));
private static final long serialVersionUID = 1L;
private final BatchCreateObject createObject;
private final BatchAttachObject attachObject;
private final BatchDetachObject detachObject;
private final BatchUpdateObjectAttributes updateObjectAttributes;
private final BatchDeleteObject deleteObject;
private final BatchAddFacetToObject addFacetToObject;
private final BatchRemoveFacetFromObject removeFacetFromObject;
private final BatchAttachPolicy attachPolicy;
private final BatchDetachPolicy detachPolicy;
private final BatchCreateIndex createIndex;
private final BatchAttachToIndex attachToIndex;
private final BatchDetachFromIndex detachFromIndex;
private final BatchAttachTypedLink attachTypedLink;
private final BatchDetachTypedLink detachTypedLink;
private final BatchUpdateLinkAttributes updateLinkAttributes;
private BatchWriteOperation(BuilderImpl builder) {
this.createObject = builder.createObject;
this.attachObject = builder.attachObject;
this.detachObject = builder.detachObject;
this.updateObjectAttributes = builder.updateObjectAttributes;
this.deleteObject = builder.deleteObject;
this.addFacetToObject = builder.addFacetToObject;
this.removeFacetFromObject = builder.removeFacetFromObject;
this.attachPolicy = builder.attachPolicy;
this.detachPolicy = builder.detachPolicy;
this.createIndex = builder.createIndex;
this.attachToIndex = builder.attachToIndex;
this.detachFromIndex = builder.detachFromIndex;
this.attachTypedLink = builder.attachTypedLink;
this.detachTypedLink = builder.detachTypedLink;
this.updateLinkAttributes = builder.updateLinkAttributes;
}
/**
*
* Creates an object.
*
*
* @return Creates an object.
*/
public BatchCreateObject createObject() {
return createObject;
}
/**
*
*
* @return Deletes an object in a Directory.
*/
public BatchDeleteObject deleteObject() {
return deleteObject;
}
/**
*
* A batch operation that adds a facet to an object.
*
*
* @return A batch operation that adds a facet to an object.
*/
public BatchAddFacetToObject addFacetToObject() {
return addFacetToObject;
}
/**
*
* A batch operation that removes a facet from an object.
*
*
* @return A batch operation that removes a facet from an object.
*/
public BatchRemoveFacetFromObject removeFacetFromObject() {
return removeFacetFromObject;
}
/**
*
* Attaches a policy object to a regular object. An object can have a limited number of attached policies.
*
*
* @return Attaches a policy object to a regular object. An object can have a limited number of attached policies.
*/
public BatchAttachPolicy attachPolicy() {
return attachPolicy;
}
/**
*
*
* @return Creates an index object. See Indexing and
* search for more information.
*/
public BatchCreateIndex createIndex() {
return createIndex;
}
/**
*
* Attaches the specified object to the specified index.
*
*
* @return Attaches the specified object to the specified index.
*/
public BatchAttachToIndex attachToIndex() {
return attachToIndex;
}
/**
*
* Detaches the specified object from the specified index.
*
*
* @return Detaches the specified object from the specified index.
*/
public BatchDetachFromIndex detachFromIndex() {
return detachFromIndex;
}
/**
*
* Attaches a typed link to a specified source and target object. For more information, see Typed Links.
*
*
* @return Attaches a typed link to a specified source and target object. For more information, see Typed Links.
*/
public BatchAttachTypedLink attachTypedLink() {
return attachTypedLink;
}
/**
*
* Detaches a typed link from a specified source and target object. For more information, see Typed Links.
*
*
* @return Detaches a typed link from a specified source and target object. For more information, see Typed Links.
*/
public BatchDetachTypedLink detachTypedLink() {
return detachTypedLink;
}
/**
*
* Updates a given object's attributes.
*
*
* @return Updates a given object's attributes.
*/
public BatchUpdateLinkAttributes updateLinkAttributes() {
return updateLinkAttributes;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(createObject());
hashCode = 31 * hashCode + Objects.hashCode(attachObject());
hashCode = 31 * hashCode + Objects.hashCode(detachObject());
hashCode = 31 * hashCode + Objects.hashCode(updateObjectAttributes());
hashCode = 31 * hashCode + Objects.hashCode(deleteObject());
hashCode = 31 * hashCode + Objects.hashCode(addFacetToObject());
hashCode = 31 * hashCode + Objects.hashCode(removeFacetFromObject());
hashCode = 31 * hashCode + Objects.hashCode(attachPolicy());
hashCode = 31 * hashCode + Objects.hashCode(detachPolicy());
hashCode = 31 * hashCode + Objects.hashCode(createIndex());
hashCode = 31 * hashCode + Objects.hashCode(attachToIndex());
hashCode = 31 * hashCode + Objects.hashCode(detachFromIndex());
hashCode = 31 * hashCode + Objects.hashCode(attachTypedLink());
hashCode = 31 * hashCode + Objects.hashCode(detachTypedLink());
hashCode = 31 * hashCode + Objects.hashCode(updateLinkAttributes());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof BatchWriteOperation)) {
return false;
}
BatchWriteOperation other = (BatchWriteOperation) obj;
return Objects.equals(createObject(), other.createObject()) && Objects.equals(attachObject(), other.attachObject())
&& Objects.equals(detachObject(), other.detachObject())
&& Objects.equals(updateObjectAttributes(), other.updateObjectAttributes())
&& Objects.equals(deleteObject(), other.deleteObject())
&& Objects.equals(addFacetToObject(), other.addFacetToObject())
&& Objects.equals(removeFacetFromObject(), other.removeFacetFromObject())
&& Objects.equals(attachPolicy(), other.attachPolicy()) && Objects.equals(detachPolicy(), other.detachPolicy())
&& Objects.equals(createIndex(), other.createIndex()) && Objects.equals(attachToIndex(), other.attachToIndex())
&& Objects.equals(detachFromIndex(), other.detachFromIndex())
&& Objects.equals(attachTypedLink(), other.attachTypedLink())
&& Objects.equals(detachTypedLink(), other.detachTypedLink())
&& Objects.equals(updateLinkAttributes(), other.updateLinkAttributes());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public String toString() {
return ToString.builder("BatchWriteOperation").add("CreateObject", createObject()).add("AttachObject", attachObject())
.add("DetachObject", detachObject()).add("UpdateObjectAttributes", updateObjectAttributes())
.add("DeleteObject", deleteObject()).add("AddFacetToObject", addFacetToObject())
.add("RemoveFacetFromObject", removeFacetFromObject()).add("AttachPolicy", attachPolicy())
.add("DetachPolicy", detachPolicy()).add("CreateIndex", createIndex()).add("AttachToIndex", attachToIndex())
.add("DetachFromIndex", detachFromIndex()).add("AttachTypedLink", attachTypedLink())
.add("DetachTypedLink", detachTypedLink()).add("UpdateLinkAttributes", updateLinkAttributes()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CreateObject":
return Optional.ofNullable(clazz.cast(createObject()));
case "AttachObject":
return Optional.ofNullable(clazz.cast(attachObject()));
case "DetachObject":
return Optional.ofNullable(clazz.cast(detachObject()));
case "UpdateObjectAttributes":
return Optional.ofNullable(clazz.cast(updateObjectAttributes()));
case "DeleteObject":
return Optional.ofNullable(clazz.cast(deleteObject()));
case "AddFacetToObject":
return Optional.ofNullable(clazz.cast(addFacetToObject()));
case "RemoveFacetFromObject":
return Optional.ofNullable(clazz.cast(removeFacetFromObject()));
case "AttachPolicy":
return Optional.ofNullable(clazz.cast(attachPolicy()));
case "DetachPolicy":
return Optional.ofNullable(clazz.cast(detachPolicy()));
case "CreateIndex":
return Optional.ofNullable(clazz.cast(createIndex()));
case "AttachToIndex":
return Optional.ofNullable(clazz.cast(attachToIndex()));
case "DetachFromIndex":
return Optional.ofNullable(clazz.cast(detachFromIndex()));
case "AttachTypedLink":
return Optional.ofNullable(clazz.cast(attachTypedLink()));
case "DetachTypedLink":
return Optional.ofNullable(clazz.cast(detachTypedLink()));
case "UpdateLinkAttributes":
return Optional.ofNullable(clazz.cast(updateLinkAttributes()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function