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

software.amazon.awssdk.services.quicksight.model.UpdateIamPolicyAssignmentResponse Maven / Gradle / Ivy

/*
 * 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.quicksight.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 UpdateIamPolicyAssignmentResponse extends QuickSightResponse implements
        ToCopyableBuilder {
    private static final SdkField ASSIGNMENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateIamPolicyAssignmentResponse::assignmentName)).setter(setter(Builder::assignmentName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssignmentName").build()).build();

    private static final SdkField ASSIGNMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateIamPolicyAssignmentResponse::assignmentId)).setter(setter(Builder::assignmentId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssignmentId").build()).build();

    private static final SdkField POLICY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateIamPolicyAssignmentResponse::policyArn)).setter(setter(Builder::policyArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolicyArn").build()).build();

    private static final SdkField>> IDENTITIES_FIELD = SdkField
            .>> builder(MarshallingType.MAP)
            .getter(getter(UpdateIamPolicyAssignmentResponse::identities))
            .setter(setter(Builder::identities))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Identities").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField.> builder(MarshallingType.LIST)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build(),
                                                    ListTrait
                                                            .builder()
                                                            .memberLocationName(null)
                                                            .memberFieldInfo(
                                                                    SdkField. builder(MarshallingType.STRING)
                                                                            .traits(LocationTrait.builder()
                                                                                    .location(MarshallLocation.PAYLOAD)
                                                                                    .locationName("member").build()).build())
                                                            .build()).build()).build()).build();

    private static final SdkField ASSIGNMENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateIamPolicyAssignmentResponse::assignmentStatusAsString))
            .setter(setter(Builder::assignmentStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssignmentStatus").build()).build();

    private static final SdkField REQUEST_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateIamPolicyAssignmentResponse::requestId)).setter(setter(Builder::requestId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RequestId").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .getter(getter(UpdateIamPolicyAssignmentResponse::status)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.STATUS_CODE).locationName("Status").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASSIGNMENT_NAME_FIELD,
            ASSIGNMENT_ID_FIELD, POLICY_ARN_FIELD, IDENTITIES_FIELD, ASSIGNMENT_STATUS_FIELD, REQUEST_ID_FIELD, STATUS_FIELD));

    private final String assignmentName;

    private final String assignmentId;

    private final String policyArn;

    private final Map> identities;

    private final String assignmentStatus;

    private final String requestId;

    private final Integer status;

    private UpdateIamPolicyAssignmentResponse(BuilderImpl builder) {
        super(builder);
        this.assignmentName = builder.assignmentName;
        this.assignmentId = builder.assignmentId;
        this.policyArn = builder.policyArn;
        this.identities = builder.identities;
        this.assignmentStatus = builder.assignmentStatus;
        this.requestId = builder.requestId;
        this.status = builder.status;
    }

    /**
     * 

* The name of the assignment. *

* * @return The name of the assignment. */ public String assignmentName() { return assignmentName; } /** *

* The ID of the assignment. *

* * @return The ID of the assignment. */ public String assignmentId() { return assignmentId; } /** *

* The ARN for the IAM policy applied to the QuickSight users and groups specified in this assignment. *

* * @return The ARN for the IAM policy applied to the QuickSight users and groups specified in this assignment. */ public String policyArn() { return policyArn; } /** * Returns true if the Identities property was specified by the sender (it may be empty), or false if the sender did * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasIdentities() { return identities != null && !(identities instanceof SdkAutoConstructMap); } /** *

* The QuickSight users, groups, or both that the IAM policy is assigned to. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasIdentities()} to see if a value was sent in this field. *

* * @return The QuickSight users, groups, or both that the IAM policy is assigned to. */ public Map> identities() { return identities; } /** *

* The status of the assignment. Possible values are as follows: *

*
    *
  • *

    * ENABLED - Anything specified in this assignment is used when creating the data source. *

    *
  • *
  • *

    * DISABLED - This assignment isn't used when creating the data source. *

    *
  • *
  • *

    * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #assignmentStatus} * will return {@link AssignmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #assignmentStatusAsString}. *

* * @return The status of the assignment. Possible values are as follows:

*
    *
  • *

    * ENABLED - Anything specified in this assignment is used when creating the data source. *

    *
  • *
  • *

    * DISABLED - This assignment isn't used when creating the data source. *

    *
  • *
  • *

    * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

    *
  • * @see AssignmentStatus */ public AssignmentStatus assignmentStatus() { return AssignmentStatus.fromValue(assignmentStatus); } /** *

    * The status of the assignment. Possible values are as follows: *

    *
      *
    • *

      * ENABLED - Anything specified in this assignment is used when creating the data source. *

      *
    • *
    • *

      * DISABLED - This assignment isn't used when creating the data source. *

      *
    • *
    • *

      * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #assignmentStatus} * will return {@link AssignmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #assignmentStatusAsString}. *

    * * @return The status of the assignment. Possible values are as follows:

    *
      *
    • *

      * ENABLED - Anything specified in this assignment is used when creating the data source. *

      *
    • *
    • *

      * DISABLED - This assignment isn't used when creating the data source. *

      *
    • *
    • *

      * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

      *
    • * @see AssignmentStatus */ public String assignmentStatusAsString() { return assignmentStatus; } /** *

      * The AWS request ID for this operation. *

      * * @return The AWS request ID for this operation. */ public String requestId() { return requestId; } /** *

      * The HTTP status of the request. *

      * * @return The HTTP status of the request. */ public Integer status() { return status; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(assignmentName()); hashCode = 31 * hashCode + Objects.hashCode(assignmentId()); hashCode = 31 * hashCode + Objects.hashCode(policyArn()); hashCode = 31 * hashCode + Objects.hashCode(identities()); hashCode = 31 * hashCode + Objects.hashCode(assignmentStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(requestId()); hashCode = 31 * hashCode + Objects.hashCode(status()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateIamPolicyAssignmentResponse)) { return false; } UpdateIamPolicyAssignmentResponse other = (UpdateIamPolicyAssignmentResponse) obj; return Objects.equals(assignmentName(), other.assignmentName()) && Objects.equals(assignmentId(), other.assignmentId()) && Objects.equals(policyArn(), other.policyArn()) && Objects.equals(identities(), other.identities()) && Objects.equals(assignmentStatusAsString(), other.assignmentStatusAsString()) && Objects.equals(requestId(), other.requestId()) && Objects.equals(status(), other.status()); } /** * 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("UpdateIamPolicyAssignmentResponse").add("AssignmentName", assignmentName()) .add("AssignmentId", assignmentId()).add("PolicyArn", policyArn()).add("Identities", identities()) .add("AssignmentStatus", assignmentStatusAsString()).add("RequestId", requestId()).add("Status", status()) .build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AssignmentName": return Optional.ofNullable(clazz.cast(assignmentName())); case "AssignmentId": return Optional.ofNullable(clazz.cast(assignmentId())); case "PolicyArn": return Optional.ofNullable(clazz.cast(policyArn())); case "Identities": return Optional.ofNullable(clazz.cast(identities())); case "AssignmentStatus": return Optional.ofNullable(clazz.cast(assignmentStatusAsString())); case "RequestId": return Optional.ofNullable(clazz.cast(requestId())); case "Status": return Optional.ofNullable(clazz.cast(status())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateIamPolicyAssignmentResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends QuickSightResponse.Builder, SdkPojo, CopyableBuilder { /** *

      * The name of the assignment. *

      * * @param assignmentName * The name of the assignment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assignmentName(String assignmentName); /** *

      * The ID of the assignment. *

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

      * The ARN for the IAM policy applied to the QuickSight users and groups specified in this assignment. *

      * * @param policyArn * The ARN for the IAM policy applied to the QuickSight users and groups specified in this assignment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder policyArn(String policyArn); /** *

      * The QuickSight users, groups, or both that the IAM policy is assigned to. *

      * * @param identities * The QuickSight users, groups, or both that the IAM policy is assigned to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identities(Map> identities); /** *

      * The status of the assignment. Possible values are as follows: *

      *
        *
      • *

        * ENABLED - Anything specified in this assignment is used when creating the data source. *

        *
      • *
      • *

        * DISABLED - This assignment isn't used when creating the data source. *

        *
      • *
      • *

        * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

        *
      • *
      * * @param assignmentStatus * The status of the assignment. Possible values are as follows:

      *
        *
      • *

        * ENABLED - Anything specified in this assignment is used when creating the data source. *

        *
      • *
      • *

        * DISABLED - This assignment isn't used when creating the data source. *

        *
      • *
      • *

        * DRAFT - This assignment is an unfinished draft and isn't used when creating the data * source. *

        *
      • * @see AssignmentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AssignmentStatus */ Builder assignmentStatus(String assignmentStatus); /** *

        * The status of the assignment. Possible values are as follows: *

        *
          *
        • *

          * ENABLED - Anything specified in this assignment is used when creating the data source. *

          *
        • *
        • *

          * DISABLED - This assignment isn't used when creating the data source. *

          *
        • *
        • *

          * DRAFT - This assignment is an unfinished draft and isn't used when creating the data source. *

          *
        • *
        * * @param assignmentStatus * The status of the assignment. Possible values are as follows:

        *
          *
        • *

          * ENABLED - Anything specified in this assignment is used when creating the data source. *

          *
        • *
        • *

          * DISABLED - This assignment isn't used when creating the data source. *

          *
        • *
        • *

          * DRAFT - This assignment is an unfinished draft and isn't used when creating the data * source. *

          *
        • * @see AssignmentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AssignmentStatus */ Builder assignmentStatus(AssignmentStatus assignmentStatus); /** *

          * The AWS request ID for this operation. *

          * * @param requestId * The AWS request ID for this operation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requestId(String requestId); /** *

          * The HTTP status of the request. *

          * * @param status * The HTTP status of the request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(Integer status); } static final class BuilderImpl extends QuickSightResponse.BuilderImpl implements Builder { private String assignmentName; private String assignmentId; private String policyArn; private Map> identities = DefaultSdkAutoConstructMap.getInstance(); private String assignmentStatus; private String requestId; private Integer status; private BuilderImpl() { } private BuilderImpl(UpdateIamPolicyAssignmentResponse model) { super(model); assignmentName(model.assignmentName); assignmentId(model.assignmentId); policyArn(model.policyArn); identities(model.identities); assignmentStatus(model.assignmentStatus); requestId(model.requestId); status(model.status); } public final String getAssignmentName() { return assignmentName; } @Override public final Builder assignmentName(String assignmentName) { this.assignmentName = assignmentName; return this; } public final void setAssignmentName(String assignmentName) { this.assignmentName = assignmentName; } public final String getAssignmentId() { return assignmentId; } @Override public final Builder assignmentId(String assignmentId) { this.assignmentId = assignmentId; return this; } public final void setAssignmentId(String assignmentId) { this.assignmentId = assignmentId; } public final String getPolicyArn() { return policyArn; } @Override public final Builder policyArn(String policyArn) { this.policyArn = policyArn; return this; } public final void setPolicyArn(String policyArn) { this.policyArn = policyArn; } public final Map> getIdentities() { return identities; } @Override public final Builder identities(Map> identities) { this.identities = IdentityMapCopier.copy(identities); return this; } public final void setIdentities(Map> identities) { this.identities = IdentityMapCopier.copy(identities); } public final String getAssignmentStatus() { return assignmentStatus; } @Override public final Builder assignmentStatus(String assignmentStatus) { this.assignmentStatus = assignmentStatus; return this; } @Override public final Builder assignmentStatus(AssignmentStatus assignmentStatus) { this.assignmentStatus(assignmentStatus == null ? null : assignmentStatus.toString()); return this; } public final void setAssignmentStatus(String assignmentStatus) { this.assignmentStatus = assignmentStatus; } public final String getRequestId() { return requestId; } @Override public final Builder requestId(String requestId) { this.requestId = requestId; return this; } public final void setRequestId(String requestId) { this.requestId = requestId; } public final Integer getStatus() { return status; } @Override public final Builder status(Integer status) { this.status = status; return this; } public final void setStatus(Integer status) { this.status = status; } @Override public UpdateIamPolicyAssignmentResponse build() { return new UpdateIamPolicyAssignmentResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy