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

software.amazon.awssdk.services.deadline.model.AssociateMemberToFarmRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Deadline module holds the client classes that are used for communicating with Deadline.

There is a newer version: 2.28.4
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((AssociateMemberToFarmRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DeadlineRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the farm to associate with the member. *

* * @param farmId * The ID of the farm to associate with the member. * @return Returns a reference to this object so that method calls can be chained together. */ Builder farmId(String farmId); /** *

* The member's principal ID to associate with the farm. *

* * @param principalId * The member's principal ID to associate with the farm. * @return Returns a reference to this object so that method calls can be chained together. */ Builder principalId(String principalId); /** *

* The principal type of the member to associate with the farm. *

* * @param principalType * The principal type of the member to associate with the farm. * @see PrincipalType * @return Returns a reference to this object so that method calls can be chained together. * @see PrincipalType */ Builder principalType(String principalType); /** *

* The principal type of the member to associate with the farm. *

* * @param principalType * The principal type of the member to associate with the farm. * @see PrincipalType * @return Returns a reference to this object so that method calls can be chained together. * @see PrincipalType */ Builder principalType(PrincipalType principalType); /** *

* The identity store ID of the member to associate with the farm. *

* * @param identityStoreId * The identity store ID of the member to associate with the farm. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identityStoreId(String identityStoreId); /** *

* The principal's membership level for the associated farm. *

* * @param membershipLevel * The principal's membership level for the associated farm. * @see MembershipLevel * @return Returns a reference to this object so that method calls can be chained together. * @see MembershipLevel */ Builder membershipLevel(String membershipLevel); /** *

* The principal's membership level for the associated farm. *

* * @param membershipLevel * The principal's membership level for the associated farm. * @see MembershipLevel * @return Returns a reference to this object so that method calls can be chained together. * @see MembershipLevel */ Builder membershipLevel(MembershipLevel membershipLevel); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DeadlineRequest.BuilderImpl implements Builder { private String farmId; private String principalId; private String principalType; private String identityStoreId; private String membershipLevel; private BuilderImpl() { } private BuilderImpl(AssociateMemberToFarmRequest model) { super(model); farmId(model.farmId); principalId(model.principalId); principalType(model.principalType); identityStoreId(model.identityStoreId); membershipLevel(model.membershipLevel); } public final String getFarmId() { return farmId; } public final void setFarmId(String farmId) { this.farmId = farmId; } @Override public final Builder farmId(String farmId) { this.farmId = farmId; return this; } public final String getPrincipalId() { return principalId; } public final void setPrincipalId(String principalId) { this.principalId = principalId; } @Override public final Builder principalId(String principalId) { this.principalId = principalId; return this; } public final String getPrincipalType() { return principalType; } public final void setPrincipalType(String principalType) { this.principalType = principalType; } @Override public final Builder principalType(String principalType) { this.principalType = principalType; return this; } @Override public final Builder principalType(PrincipalType principalType) { this.principalType(principalType == null ? null : principalType.toString()); return this; } public final String getIdentityStoreId() { return identityStoreId; } public final void setIdentityStoreId(String identityStoreId) { this.identityStoreId = identityStoreId; } @Override public final Builder identityStoreId(String identityStoreId) { this.identityStoreId = identityStoreId; return this; } public final String getMembershipLevel() { return membershipLevel; } public final void setMembershipLevel(String membershipLevel) { this.membershipLevel = membershipLevel; } @Override public final Builder membershipLevel(String membershipLevel) { this.membershipLevel = membershipLevel; return this; } @Override public final Builder membershipLevel(MembershipLevel membershipLevel) { this.membershipLevel(membershipLevel == null ? null : membershipLevel.toString()); return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public AssociateMemberToFarmRequest build() { return new AssociateMemberToFarmRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy