software.amazon.awssdk.services.deadline.model.AssociateMemberToFleetRequest Maven / Gradle / Ivy
Show all versions of deadline Show documentation
/*
* 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.deadline.model;
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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AssociateMemberToFleetRequest extends DeadlineRequest implements
ToCopyableBuilder {
private static final SdkField FARM_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("farmId")
.getter(getter(AssociateMemberToFleetRequest::farmId)).setter(setter(Builder::farmId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("farmId").build()).build();
private static final SdkField FLEET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("fleetId").getter(getter(AssociateMemberToFleetRequest::fleetId)).setter(setter(Builder::fleetId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("fleetId").build()).build();
private static final SdkField PRINCIPAL_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("principalId").getter(getter(AssociateMemberToFleetRequest::principalId))
.setter(setter(Builder::principalId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("principalId").build()).build();
private static final SdkField PRINCIPAL_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("principalType").getter(getter(AssociateMemberToFleetRequest::principalTypeAsString))
.setter(setter(Builder::principalType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("principalType").build()).build();
private static final SdkField IDENTITY_STORE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("identityStoreId").getter(getter(AssociateMemberToFleetRequest::identityStoreId))
.setter(setter(Builder::identityStoreId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("identityStoreId").build()).build();
private static final SdkField MEMBERSHIP_LEVEL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("membershipLevel").getter(getter(AssociateMemberToFleetRequest::membershipLevelAsString))
.setter(setter(Builder::membershipLevel))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("membershipLevel").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FARM_ID_FIELD, FLEET_ID_FIELD,
PRINCIPAL_ID_FIELD, PRINCIPAL_TYPE_FIELD, IDENTITY_STORE_ID_FIELD, MEMBERSHIP_LEVEL_FIELD));
private final String farmId;
private final String fleetId;
private final String principalId;
private final String principalType;
private final String identityStoreId;
private final String membershipLevel;
private AssociateMemberToFleetRequest(BuilderImpl builder) {
super(builder);
this.farmId = builder.farmId;
this.fleetId = builder.fleetId;
this.principalId = builder.principalId;
this.principalType = builder.principalType;
this.identityStoreId = builder.identityStoreId;
this.membershipLevel = builder.membershipLevel;
}
/**
*
* The farm ID of the fleet to associate with the member.
*
*
* @return The farm ID of the fleet to associate with the member.
*/
public final String farmId() {
return farmId;
}
/**
*
* The ID of the fleet to associate with a member.
*
*
* @return The ID of the fleet to associate with a member.
*/
public final String fleetId() {
return fleetId;
}
/**
*
* The member's principal ID to associate with a fleet.
*
*
* @return The member's principal ID to associate with a fleet.
*/
public final String principalId() {
return principalId;
}
/**
*
* The member's principal type to associate with the fleet.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #principalType}
* will return {@link PrincipalType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #principalTypeAsString}.
*
*
* @return The member's principal type to associate with the fleet.
* @see PrincipalType
*/
public final PrincipalType principalType() {
return PrincipalType.fromValue(principalType);
}
/**
*
* The member's principal type to associate with the fleet.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #principalType}
* will return {@link PrincipalType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #principalTypeAsString}.
*
*
* @return The member's principal type to associate with the fleet.
* @see PrincipalType
*/
public final String principalTypeAsString() {
return principalType;
}
/**
*
* The member's identity store ID to associate with the fleet.
*
*
* @return The member's identity store ID to associate with the fleet.
*/
public final String identityStoreId() {
return identityStoreId;
}
/**
*
* The principal's membership level for the associated fleet.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #membershipLevel}
* will return {@link MembershipLevel#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #membershipLevelAsString}.
*
*
* @return The principal's membership level for the associated fleet.
* @see MembershipLevel
*/
public final MembershipLevel membershipLevel() {
return MembershipLevel.fromValue(membershipLevel);
}
/**
*
* The principal's membership level for the associated fleet.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #membershipLevel}
* will return {@link MembershipLevel#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #membershipLevelAsString}.
*
*
* @return The principal's membership level for the associated fleet.
* @see MembershipLevel
*/
public final String membershipLevelAsString() {
return membershipLevel;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(farmId());
hashCode = 31 * hashCode + Objects.hashCode(fleetId());
hashCode = 31 * hashCode + Objects.hashCode(principalId());
hashCode = 31 * hashCode + Objects.hashCode(principalTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(identityStoreId());
hashCode = 31 * hashCode + Objects.hashCode(membershipLevelAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AssociateMemberToFleetRequest)) {
return false;
}
AssociateMemberToFleetRequest other = (AssociateMemberToFleetRequest) obj;
return Objects.equals(farmId(), other.farmId()) && Objects.equals(fleetId(), other.fleetId())
&& Objects.equals(principalId(), other.principalId())
&& Objects.equals(principalTypeAsString(), other.principalTypeAsString())
&& Objects.equals(identityStoreId(), other.identityStoreId())
&& Objects.equals(membershipLevelAsString(), other.membershipLevelAsString());
}
/**
* 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 final String toString() {
return ToString.builder("AssociateMemberToFleetRequest").add("FarmId", farmId()).add("FleetId", fleetId())
.add("PrincipalId", principalId()).add("PrincipalType", principalTypeAsString())
.add("IdentityStoreId", identityStoreId()).add("MembershipLevel", membershipLevelAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "farmId":
return Optional.ofNullable(clazz.cast(farmId()));
case "fleetId":
return Optional.ofNullable(clazz.cast(fleetId()));
case "principalId":
return Optional.ofNullable(clazz.cast(principalId()));
case "principalType":
return Optional.ofNullable(clazz.cast(principalTypeAsString()));
case "identityStoreId":
return Optional.ofNullable(clazz.cast(identityStoreId()));
case "membershipLevel":
return Optional.ofNullable(clazz.cast(membershipLevelAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function