// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.compute.outputs;

import com.pulumi.azure.compute.outputs.SharedImageGallerySharingCommunityGallery;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class SharedImageGallerySharing {
    /**
     * @return A `community_gallery` block as defined below. Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** `community_gallery` must be set when `permission` is set to `Community`.
     * 
     */
    private @Nullable SharedImageGallerySharingCommunityGallery communityGallery;
    /**
     * @return The permission of the Shared Image Gallery when sharing. The only possible value now is `Community`. Changing this forces a new resource to be created.
     * 
     * &gt; **Note:** This requires that the Preview Feature `Microsoft.Compute/CommunityGalleries` is enabled, see [the documentation](https://learn.microsoft.com/azure/virtual-machines/share-gallery-community?tabs=cli) for more information.
     * 
     */
    private String permission;

    private SharedImageGallerySharing() {}
    /**
     * @return A `community_gallery` block as defined below. Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** `community_gallery` must be set when `permission` is set to `Community`.
     * 
     */
    public Optional<SharedImageGallerySharingCommunityGallery> communityGallery() {
        return Optional.ofNullable(this.communityGallery);
    }
    /**
     * @return The permission of the Shared Image Gallery when sharing. The only possible value now is `Community`. Changing this forces a new resource to be created.
     * 
     * &gt; **Note:** This requires that the Preview Feature `Microsoft.Compute/CommunityGalleries` is enabled, see [the documentation](https://learn.microsoft.com/azure/virtual-machines/share-gallery-community?tabs=cli) for more information.
     * 
     */
    public String permission() {
        return this.permission;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(SharedImageGallerySharing defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable SharedImageGallerySharingCommunityGallery communityGallery;
        private String permission;
        public Builder() {}
        public Builder(SharedImageGallerySharing defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.communityGallery = defaults.communityGallery;
    	      this.permission = defaults.permission;
        }

        @CustomType.Setter
        public Builder communityGallery(@Nullable SharedImageGallerySharingCommunityGallery communityGallery) {
            this.communityGallery = communityGallery;
            return this;
        }
        @CustomType.Setter
        public Builder permission(String permission) {
            this.permission = Objects.requireNonNull(permission);
            return this;
        }
        public SharedImageGallerySharing build() {
            final var o = new SharedImageGallerySharing();
            o.communityGallery = communityGallery;
            o.permission = permission;
            return o;
        }
    }
}
