software.amazon.awssdk.services.deadline.model.AssociateMemberToFarmRequest 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 AssociateMemberToFarmRequest extends DeadlineRequest implements
ToCopyableBuilder {
private static final SdkField FARM_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("farmId")
.getter(getter(AssociateMemberToFarmRequest::farmId)).setter(setter(Builder::farmId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("farmId").build()).build();
private static final SdkField PRINCIPAL_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("principalId").getter(getter(AssociateMemberToFarmRequest::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(AssociateMemberToFarmRequest::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(AssociateMemberToFarmRequest::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(AssociateMemberToFarmRequest::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,
PRINCIPAL_ID_FIELD, PRINCIPAL_TYPE_FIELD, IDENTITY_STORE_ID_FIELD, MEMBERSHIP_LEVEL_FIELD));
private final String farmId;
private final String principalId;
private final String principalType;
private final String identityStoreId;
private final String membershipLevel;
private AssociateMemberToFarmRequest(BuilderImpl builder) {
super(builder);
this.farmId = builder.farmId;
this.principalId = builder.principalId;
this.principalType = builder.principalType;
this.identityStoreId = builder.identityStoreId;
this.membershipLevel = builder.membershipLevel;
}
/**
*
* The ID of the farm to associate with the member.
*
*
* @return The ID of the farm to associate with the member.
*/
public final String farmId() {
return farmId;
}
/**
*
* The member's principal ID to associate with the farm.
*
*
* @return The member's principal ID to associate with the farm.
*/
public final String principalId() {
return principalId;
}
/**
*
* The principal type of the member to associate with the farm.
*
*
* 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 principal type of the member to associate with the farm.
* @see PrincipalType
*/
public final PrincipalType principalType() {
return PrincipalType.fromValue(principalType);
}
/**
*
* The principal type of the member to associate with the farm.
*
*
* 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 principal type of the member to associate with the farm.
* @see PrincipalType
*/
public final String principalTypeAsString() {
return principalType;
}
/**
*
* The identity store ID of the member to associate with the farm.
*
*
* @return The identity store ID of the member to associate with the farm.
*/
public final String identityStoreId() {
return identityStoreId;
}
/**
*
* The principal's membership level for the associated farm.
*
*
* 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 farm.
* @see MembershipLevel
*/
public final MembershipLevel membershipLevel() {
return MembershipLevel.fromValue(membershipLevel);
}
/**
*
* The principal's membership level for the associated farm.
*
*
* 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 farm.
* @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(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 AssociateMemberToFarmRequest)) {
return false;
}
AssociateMemberToFarmRequest other = (AssociateMemberToFarmRequest) obj;
return Objects.equals(farmId(), other.farmId()) && 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("AssociateMemberToFarmRequest").add("FarmId", farmId()).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 "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