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

software.amazon.awssdk.services.verifiedpermissions.model.GetPolicyResponse 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.verifiedpermissions.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 GetPolicyResponse extends VerifiedPermissionsResponse implements
        ToCopyableBuilder {
    private static final SdkField POLICY_STORE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("policyStoreId").getter(getter(GetPolicyResponse::policyStoreId)).setter(setter(Builder::policyStoreId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("policyStoreId").build()).build();

    private static final SdkField POLICY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("policyId").getter(getter(GetPolicyResponse::policyId)).setter(setter(Builder::policyId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("policyId").build()).build();

    private static final SdkField POLICY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("policyType").getter(getter(GetPolicyResponse::policyTypeAsString)).setter(setter(Builder::policyType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("policyType").build()).build();

    private static final SdkField PRINCIPAL_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("principal")
            .getter(getter(GetPolicyResponse::principal)).setter(setter(Builder::principal))
            .constructor(EntityIdentifier::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("principal").build()).build();

    private static final SdkField RESOURCE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("resource")
            .getter(getter(GetPolicyResponse::resource)).setter(setter(Builder::resource)).constructor(EntityIdentifier::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resource").build()).build();

    private static final SdkField> ACTIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("actions")
            .getter(getter(GetPolicyResponse::actions))
            .setter(setter(Builder::actions))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actions").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ActionIdentifier::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField DEFINITION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("definition")
            .getter(getter(GetPolicyResponse::definition)).setter(setter(Builder::definition))
            .constructor(PolicyDefinitionDetail::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("definition").build()).build();

    private static final SdkField CREATED_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("createdDate")
            .getter(getter(GetPolicyResponse::createdDate))
            .setter(setter(Builder::createdDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdDate").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField LAST_UPDATED_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("lastUpdatedDate")
            .getter(getter(GetPolicyResponse::lastUpdatedDate))
            .setter(setter(Builder::lastUpdatedDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedDate").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField EFFECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("effect")
            .getter(getter(GetPolicyResponse::effectAsString)).setter(setter(Builder::effect))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("effect").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(POLICY_STORE_ID_FIELD,
            POLICY_ID_FIELD, POLICY_TYPE_FIELD, PRINCIPAL_FIELD, RESOURCE_FIELD, ACTIONS_FIELD, DEFINITION_FIELD,
            CREATED_DATE_FIELD, LAST_UPDATED_DATE_FIELD, EFFECT_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final String policyStoreId;

    private final String policyId;

    private final String policyType;

    private final EntityIdentifier principal;

    private final EntityIdentifier resource;

    private final List actions;

    private final PolicyDefinitionDetail definition;

    private final Instant createdDate;

    private final Instant lastUpdatedDate;

    private final String effect;

    private GetPolicyResponse(BuilderImpl builder) {
        super(builder);
        this.policyStoreId = builder.policyStoreId;
        this.policyId = builder.policyId;
        this.policyType = builder.policyType;
        this.principal = builder.principal;
        this.resource = builder.resource;
        this.actions = builder.actions;
        this.definition = builder.definition;
        this.createdDate = builder.createdDate;
        this.lastUpdatedDate = builder.lastUpdatedDate;
        this.effect = builder.effect;
    }

    /**
     * 

* The ID of the policy store that contains the policy that you want information about. *

* * @return The ID of the policy store that contains the policy that you want information about. */ public final String policyStoreId() { return policyStoreId; } /** *

* The unique ID of the policy that you want information about. *

* * @return The unique ID of the policy that you want information about. */ public final String policyId() { return policyId; } /** *

* The type of the policy. *

*

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

* * @return The type of the policy. * @see PolicyType */ public final PolicyType policyType() { return PolicyType.fromValue(policyType); } /** *

* The type of the policy. *

*

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

* * @return The type of the policy. * @see PolicyType */ public final String policyTypeAsString() { return policyType; } /** *

* The principal specified in the policy's scope. This element isn't included in the response when * Principal isn't present in the policy content. *

* * @return The principal specified in the policy's scope. This element isn't included in the response when * Principal isn't present in the policy content. */ public final EntityIdentifier principal() { return principal; } /** *

* The resource specified in the policy's scope. This element isn't included in the response when * Resource isn't present in the policy content. *

* * @return The resource specified in the policy's scope. This element isn't included in the response when * Resource isn't present in the policy content. */ public final EntityIdentifier resource() { return resource; } /** * For responses, this returns true if the service returned a value for the Actions property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasActions() { return actions != null && !(actions instanceof SdkAutoConstructList); } /** *

* The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . *

*

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

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasActions} method. *

* * @return The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . */ public final List actions() { return actions; } /** *

* The definition of the requested policy. *

* * @return The definition of the requested policy. */ public final PolicyDefinitionDetail definition() { return definition; } /** *

* The date and time that the policy was originally created. *

* * @return The date and time that the policy was originally created. */ public final Instant createdDate() { return createdDate; } /** *

* The date and time that the policy was last updated. *

* * @return The date and time that the policy was last updated. */ public final Instant lastUpdatedDate() { return lastUpdatedDate; } /** *

* The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". *

*

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

* * @return The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". * @see PolicyEffect */ public final PolicyEffect effect() { return PolicyEffect.fromValue(effect); } /** *

* The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". *

*

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

* * @return The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". * @see PolicyEffect */ public final String effectAsString() { return effect; } @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(policyStoreId()); hashCode = 31 * hashCode + Objects.hashCode(policyId()); hashCode = 31 * hashCode + Objects.hashCode(policyTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(principal()); hashCode = 31 * hashCode + Objects.hashCode(resource()); hashCode = 31 * hashCode + Objects.hashCode(hasActions() ? actions() : null); hashCode = 31 * hashCode + Objects.hashCode(definition()); hashCode = 31 * hashCode + Objects.hashCode(createdDate()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDate()); hashCode = 31 * hashCode + Objects.hashCode(effectAsString()); 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 GetPolicyResponse)) { return false; } GetPolicyResponse other = (GetPolicyResponse) obj; return Objects.equals(policyStoreId(), other.policyStoreId()) && Objects.equals(policyId(), other.policyId()) && Objects.equals(policyTypeAsString(), other.policyTypeAsString()) && Objects.equals(principal(), other.principal()) && Objects.equals(resource(), other.resource()) && hasActions() == other.hasActions() && Objects.equals(actions(), other.actions()) && Objects.equals(definition(), other.definition()) && Objects.equals(createdDate(), other.createdDate()) && Objects.equals(lastUpdatedDate(), other.lastUpdatedDate()) && Objects.equals(effectAsString(), other.effectAsString()); } /** * 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("GetPolicyResponse").add("PolicyStoreId", policyStoreId()).add("PolicyId", policyId()) .add("PolicyType", policyTypeAsString()).add("Principal", principal()).add("Resource", resource()) .add("Actions", hasActions() ? actions() : null).add("Definition", definition()) .add("CreatedDate", createdDate()).add("LastUpdatedDate", lastUpdatedDate()).add("Effect", effectAsString()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "policyStoreId": return Optional.ofNullable(clazz.cast(policyStoreId())); case "policyId": return Optional.ofNullable(clazz.cast(policyId())); case "policyType": return Optional.ofNullable(clazz.cast(policyTypeAsString())); case "principal": return Optional.ofNullable(clazz.cast(principal())); case "resource": return Optional.ofNullable(clazz.cast(resource())); case "actions": return Optional.ofNullable(clazz.cast(actions())); case "definition": return Optional.ofNullable(clazz.cast(definition())); case "createdDate": return Optional.ofNullable(clazz.cast(createdDate())); case "lastUpdatedDate": return Optional.ofNullable(clazz.cast(lastUpdatedDate())); case "effect": return Optional.ofNullable(clazz.cast(effectAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("policyStoreId", POLICY_STORE_ID_FIELD); map.put("policyId", POLICY_ID_FIELD); map.put("policyType", POLICY_TYPE_FIELD); map.put("principal", PRINCIPAL_FIELD); map.put("resource", RESOURCE_FIELD); map.put("actions", ACTIONS_FIELD); map.put("definition", DEFINITION_FIELD); map.put("createdDate", CREATED_DATE_FIELD); map.put("lastUpdatedDate", LAST_UPDATED_DATE_FIELD); map.put("effect", EFFECT_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((GetPolicyResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends VerifiedPermissionsResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the policy store that contains the policy that you want information about. *

* * @param policyStoreId * The ID of the policy store that contains the policy that you want information about. * @return Returns a reference to this object so that method calls can be chained together. */ Builder policyStoreId(String policyStoreId); /** *

* The unique ID of the policy that you want information about. *

* * @param policyId * The unique ID of the policy that you want information about. * @return Returns a reference to this object so that method calls can be chained together. */ Builder policyId(String policyId); /** *

* The type of the policy. *

* * @param policyType * The type of the policy. * @see PolicyType * @return Returns a reference to this object so that method calls can be chained together. * @see PolicyType */ Builder policyType(String policyType); /** *

* The type of the policy. *

* * @param policyType * The type of the policy. * @see PolicyType * @return Returns a reference to this object so that method calls can be chained together. * @see PolicyType */ Builder policyType(PolicyType policyType); /** *

* The principal specified in the policy's scope. This element isn't included in the response when * Principal isn't present in the policy content. *

* * @param principal * The principal specified in the policy's scope. This element isn't included in the response when * Principal isn't present in the policy content. * @return Returns a reference to this object so that method calls can be chained together. */ Builder principal(EntityIdentifier principal); /** *

* The principal specified in the policy's scope. This element isn't included in the response when * Principal isn't present in the policy content. *

* This is a convenience method that creates an instance of the {@link EntityIdentifier.Builder} avoiding the * need to create one manually via {@link EntityIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link EntityIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #principal(EntityIdentifier)}. * * @param principal * a consumer that will call methods on {@link EntityIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #principal(EntityIdentifier) */ default Builder principal(Consumer principal) { return principal(EntityIdentifier.builder().applyMutation(principal).build()); } /** *

* The resource specified in the policy's scope. This element isn't included in the response when * Resource isn't present in the policy content. *

* * @param resource * The resource specified in the policy's scope. This element isn't included in the response when * Resource isn't present in the policy content. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resource(EntityIdentifier resource); /** *

* The resource specified in the policy's scope. This element isn't included in the response when * Resource isn't present in the policy content. *

* This is a convenience method that creates an instance of the {@link EntityIdentifier.Builder} avoiding the * need to create one manually via {@link EntityIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link EntityIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #resource(EntityIdentifier)}. * * @param resource * a consumer that will call methods on {@link EntityIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resource(EntityIdentifier) */ default Builder resource(Consumer resource) { return resource(EntityIdentifier.builder().applyMutation(resource).build()); } /** *

* The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . *

* * @param actions * The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(Collection actions); /** *

* The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . *

* * @param actions * The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(ActionIdentifier... actions); /** *

* The action that a policy permits or forbids. For example, * {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} * . *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.verifiedpermissions.model.ActionIdentifier.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.verifiedpermissions.model.ActionIdentifier#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.verifiedpermissions.model.ActionIdentifier.Builder#build()} is called * immediately and its result is passed to {@link #actions(List)}. * * @param actions * a consumer that will call methods on * {@link software.amazon.awssdk.services.verifiedpermissions.model.ActionIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #actions(java.util.Collection) */ Builder actions(Consumer... actions); /** *

* The definition of the requested policy. *

* * @param definition * The definition of the requested policy. * @return Returns a reference to this object so that method calls can be chained together. */ Builder definition(PolicyDefinitionDetail definition); /** *

* The definition of the requested policy. *

* This is a convenience method that creates an instance of the {@link PolicyDefinitionDetail.Builder} avoiding * the need to create one manually via {@link PolicyDefinitionDetail#builder()}. * *

* When the {@link Consumer} completes, {@link PolicyDefinitionDetail.Builder#build()} is called immediately and * its result is passed to {@link #definition(PolicyDefinitionDetail)}. * * @param definition * a consumer that will call methods on {@link PolicyDefinitionDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #definition(PolicyDefinitionDetail) */ default Builder definition(Consumer definition) { return definition(PolicyDefinitionDetail.builder().applyMutation(definition).build()); } /** *

* The date and time that the policy was originally created. *

* * @param createdDate * The date and time that the policy was originally created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdDate(Instant createdDate); /** *

* The date and time that the policy was last updated. *

* * @param lastUpdatedDate * The date and time that the policy was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedDate(Instant lastUpdatedDate); /** *

* The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". *

* * @param effect * The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". * @see PolicyEffect * @return Returns a reference to this object so that method calls can be chained together. * @see PolicyEffect */ Builder effect(String effect); /** *

* The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". *

* * @param effect * The effect of the decision that a policy returns to an authorization request. For example, * "effect": "Permit". * @see PolicyEffect * @return Returns a reference to this object so that method calls can be chained together. * @see PolicyEffect */ Builder effect(PolicyEffect effect); } static final class BuilderImpl extends VerifiedPermissionsResponse.BuilderImpl implements Builder { private String policyStoreId; private String policyId; private String policyType; private EntityIdentifier principal; private EntityIdentifier resource; private List actions = DefaultSdkAutoConstructList.getInstance(); private PolicyDefinitionDetail definition; private Instant createdDate; private Instant lastUpdatedDate; private String effect; private BuilderImpl() { } private BuilderImpl(GetPolicyResponse model) { super(model); policyStoreId(model.policyStoreId); policyId(model.policyId); policyType(model.policyType); principal(model.principal); resource(model.resource); actions(model.actions); definition(model.definition); createdDate(model.createdDate); lastUpdatedDate(model.lastUpdatedDate); effect(model.effect); } public final String getPolicyStoreId() { return policyStoreId; } public final void setPolicyStoreId(String policyStoreId) { this.policyStoreId = policyStoreId; } @Override public final Builder policyStoreId(String policyStoreId) { this.policyStoreId = policyStoreId; return this; } public final String getPolicyId() { return policyId; } public final void setPolicyId(String policyId) { this.policyId = policyId; } @Override public final Builder policyId(String policyId) { this.policyId = policyId; return this; } public final String getPolicyType() { return policyType; } public final void setPolicyType(String policyType) { this.policyType = policyType; } @Override public final Builder policyType(String policyType) { this.policyType = policyType; return this; } @Override public final Builder policyType(PolicyType policyType) { this.policyType(policyType == null ? null : policyType.toString()); return this; } public final EntityIdentifier.Builder getPrincipal() { return principal != null ? principal.toBuilder() : null; } public final void setPrincipal(EntityIdentifier.BuilderImpl principal) { this.principal = principal != null ? principal.build() : null; } @Override public final Builder principal(EntityIdentifier principal) { this.principal = principal; return this; } public final EntityIdentifier.Builder getResource() { return resource != null ? resource.toBuilder() : null; } public final void setResource(EntityIdentifier.BuilderImpl resource) { this.resource = resource != null ? resource.build() : null; } @Override public final Builder resource(EntityIdentifier resource) { this.resource = resource; return this; } public final List getActions() { List result = ActionIdentifierListCopier.copyToBuilder(this.actions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setActions(Collection actions) { this.actions = ActionIdentifierListCopier.copyFromBuilder(actions); } @Override public final Builder actions(Collection actions) { this.actions = ActionIdentifierListCopier.copy(actions); return this; } @Override @SafeVarargs public final Builder actions(ActionIdentifier... actions) { actions(Arrays.asList(actions)); return this; } @Override @SafeVarargs public final Builder actions(Consumer... actions) { actions(Stream.of(actions).map(c -> ActionIdentifier.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final PolicyDefinitionDetail.Builder getDefinition() { return definition != null ? definition.toBuilder() : null; } public final void setDefinition(PolicyDefinitionDetail.BuilderImpl definition) { this.definition = definition != null ? definition.build() : null; } @Override public final Builder definition(PolicyDefinitionDetail definition) { this.definition = definition; return this; } public final Instant getCreatedDate() { return createdDate; } public final void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } @Override public final Builder createdDate(Instant createdDate) { this.createdDate = createdDate; return this; } public final Instant getLastUpdatedDate() { return lastUpdatedDate; } public final void setLastUpdatedDate(Instant lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; } @Override public final Builder lastUpdatedDate(Instant lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } public final String getEffect() { return effect; } public final void setEffect(String effect) { this.effect = effect; } @Override public final Builder effect(String effect) { this.effect = effect; return this; } @Override public final Builder effect(PolicyEffect effect) { this.effect(effect == null ? null : effect.toString()); return this; } @Override public GetPolicyResponse build() { return new GetPolicyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy