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

software.amazon.awssdk.services.alexaforbusiness.model.RevokeInvitationRequest Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.alexaforbusiness.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 RevokeInvitationRequest extends AlexaForBusinessRequest implements
        ToCopyableBuilder {
    private static final SdkField USER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(RevokeInvitationRequest::userArn)).setter(setter(Builder::userArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserArn").build()).build();

    private static final SdkField ENROLLMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(RevokeInvitationRequest::enrollmentId)).setter(setter(Builder::enrollmentId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnrollmentId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(USER_ARN_FIELD,
            ENROLLMENT_ID_FIELD));

    private final String userArn;

    private final String enrollmentId;

    private RevokeInvitationRequest(BuilderImpl builder) {
        super(builder);
        this.userArn = builder.userArn;
        this.enrollmentId = builder.enrollmentId;
    }

    /**
     * 

* The ARN of the user for whom to revoke an enrollment invitation. Required. *

* * @return The ARN of the user for whom to revoke an enrollment invitation. Required. */ public String userArn() { return userArn; } /** *

* The ARN of the enrollment invitation to revoke. Required. *

* * @return The ARN of the enrollment invitation to revoke. Required. */ public String enrollmentId() { return enrollmentId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(userArn()); hashCode = 31 * hashCode + Objects.hashCode(enrollmentId()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof RevokeInvitationRequest)) { return false; } RevokeInvitationRequest other = (RevokeInvitationRequest) obj; return Objects.equals(userArn(), other.userArn()) && Objects.equals(enrollmentId(), other.enrollmentId()); } /** * 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("RevokeInvitationRequest").add("UserArn", userArn()).add("EnrollmentId", enrollmentId()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "UserArn": return Optional.ofNullable(clazz.cast(userArn())); case "EnrollmentId": return Optional.ofNullable(clazz.cast(enrollmentId())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RevokeInvitationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends AlexaForBusinessRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The ARN of the user for whom to revoke an enrollment invitation. Required. *

* * @param userArn * The ARN of the user for whom to revoke an enrollment invitation. Required. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userArn(String userArn); /** *

* The ARN of the enrollment invitation to revoke. Required. *

* * @param enrollmentId * The ARN of the enrollment invitation to revoke. Required. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enrollmentId(String enrollmentId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends AlexaForBusinessRequest.BuilderImpl implements Builder { private String userArn; private String enrollmentId; private BuilderImpl() { } private BuilderImpl(RevokeInvitationRequest model) { super(model); userArn(model.userArn); enrollmentId(model.enrollmentId); } public final String getUserArn() { return userArn; } @Override public final Builder userArn(String userArn) { this.userArn = userArn; return this; } public final void setUserArn(String userArn) { this.userArn = userArn; } public final String getEnrollmentId() { return enrollmentId; } @Override public final Builder enrollmentId(String enrollmentId) { this.enrollmentId = enrollmentId; return this; } public final void setEnrollmentId(String enrollmentId) { this.enrollmentId = enrollmentId; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public RevokeInvitationRequest build() { return new RevokeInvitationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy