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

software.amazon.awssdk.services.appstream.model.SharedImagePermissions Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.appstream.model;

import java.io.Serializable;
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.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;

/**
 * 

* Describes the permissions that are available to the specified AWS account for a shared image. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SharedImagePermissions implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SHARED_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("sharedAccountId").getter(getter(SharedImagePermissions::sharedAccountId)) .setter(setter(Builder::sharedAccountId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sharedAccountId").build()).build(); private static final SdkField IMAGE_PERMISSIONS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("imagePermissions") .getter(getter(SharedImagePermissions::imagePermissions)).setter(setter(Builder::imagePermissions)) .constructor(ImagePermissions::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imagePermissions").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SHARED_ACCOUNT_ID_FIELD, IMAGE_PERMISSIONS_FIELD)); private static final long serialVersionUID = 1L; private final String sharedAccountId; private final ImagePermissions imagePermissions; private SharedImagePermissions(BuilderImpl builder) { this.sharedAccountId = builder.sharedAccountId; this.imagePermissions = builder.imagePermissions; } /** *

* The 12-digit identifier of the AWS account with which the image is shared. *

* * @return The 12-digit identifier of the AWS account with which the image is shared. */ public final String sharedAccountId() { return sharedAccountId; } /** *

* Describes the permissions for a shared image. *

* * @return Describes the permissions for a shared image. */ public final ImagePermissions imagePermissions() { return imagePermissions; } @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 + Objects.hashCode(sharedAccountId()); hashCode = 31 * hashCode + Objects.hashCode(imagePermissions()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SharedImagePermissions)) { return false; } SharedImagePermissions other = (SharedImagePermissions) obj; return Objects.equals(sharedAccountId(), other.sharedAccountId()) && Objects.equals(imagePermissions(), other.imagePermissions()); } /** * 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("SharedImagePermissions").add("SharedAccountId", sharedAccountId()) .add("ImagePermissions", imagePermissions()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "sharedAccountId": return Optional.ofNullable(clazz.cast(sharedAccountId())); case "imagePermissions": return Optional.ofNullable(clazz.cast(imagePermissions())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SharedImagePermissions) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The 12-digit identifier of the AWS account with which the image is shared. *

* * @param sharedAccountId * The 12-digit identifier of the AWS account with which the image is shared. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sharedAccountId(String sharedAccountId); /** *

* Describes the permissions for a shared image. *

* * @param imagePermissions * Describes the permissions for a shared image. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imagePermissions(ImagePermissions imagePermissions); /** *

* Describes the permissions for a shared image. *

* This is a convenience that creates an instance of the {@link ImagePermissions.Builder} avoiding the need to * create one manually via {@link ImagePermissions#builder()}. * * When the {@link Consumer} completes, {@link ImagePermissions.Builder#build()} is called immediately and its * result is passed to {@link #imagePermissions(ImagePermissions)}. * * @param imagePermissions * a consumer that will call methods on {@link ImagePermissions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #imagePermissions(ImagePermissions) */ default Builder imagePermissions(Consumer imagePermissions) { return imagePermissions(ImagePermissions.builder().applyMutation(imagePermissions).build()); } } static final class BuilderImpl implements Builder { private String sharedAccountId; private ImagePermissions imagePermissions; private BuilderImpl() { } private BuilderImpl(SharedImagePermissions model) { sharedAccountId(model.sharedAccountId); imagePermissions(model.imagePermissions); } public final String getSharedAccountId() { return sharedAccountId; } @Override public final Builder sharedAccountId(String sharedAccountId) { this.sharedAccountId = sharedAccountId; return this; } public final void setSharedAccountId(String sharedAccountId) { this.sharedAccountId = sharedAccountId; } public final ImagePermissions.Builder getImagePermissions() { return imagePermissions != null ? imagePermissions.toBuilder() : null; } @Override public final Builder imagePermissions(ImagePermissions imagePermissions) { this.imagePermissions = imagePermissions; return this; } public final void setImagePermissions(ImagePermissions.BuilderImpl imagePermissions) { this.imagePermissions = imagePermissions != null ? imagePermissions.build() : null; } @Override public SharedImagePermissions build() { return new SharedImagePermissions(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy