{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AppStream.Types.Image
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AppStream.Types.Image where

import Amazonka.AppStream.Types.Application
import Amazonka.AppStream.Types.ImagePermissions
import Amazonka.AppStream.Types.ImageState
import Amazonka.AppStream.Types.ImageStateChangeReason
import Amazonka.AppStream.Types.PlatformType
import Amazonka.AppStream.Types.ResourceError
import Amazonka.AppStream.Types.VisibilityType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an image.
--
-- /See:/ 'newImage' smart constructor.
data Image = Image'
  { -- | The image starts in the @PENDING@ state. If image creation succeeds, the
    -- state is @AVAILABLE@. If image creation fails, the state is @FAILED@.
    Image -> Maybe ImageState
state :: Prelude.Maybe ImageState,
    -- | The permissions to provide to the destination AWS account for the
    -- specified image.
    Image -> Maybe ImagePermissions
imagePermissions :: Prelude.Maybe ImagePermissions,
    -- | The operating system platform of the image.
    Image -> Maybe PlatformType
platform :: Prelude.Maybe PlatformType,
    -- | The release date of the public base image. For private images, this date
    -- is the release date of the base image from which the image was created.
    Image -> Maybe POSIX
publicBaseImageReleasedDate :: Prelude.Maybe Core.POSIX,
    -- | The reason why the last state change occurred.
    Image -> Maybe ImageStateChangeReason
stateChangeReason :: Prelude.Maybe ImageStateChangeReason,
    -- | The ARN of the image.
    Image -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time the image was created.
    Image -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates whether an image builder can be launched from this image.
    Image -> Maybe Bool
imageBuilderSupported :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether the image is public or private.
    Image -> Maybe VisibilityType
visibility :: Prelude.Maybe VisibilityType,
    -- | The name of the image builder that was used to create the private image.
    -- If the image is shared, this value is null.
    Image -> Maybe Text
imageBuilderName :: Prelude.Maybe Prelude.Text,
    -- | Describes the errors that are returned when a new image can\'t be
    -- created.
    Image -> Maybe [ResourceError]
imageErrors :: Prelude.Maybe [ResourceError],
    -- | The ARN of the image from which this image was created.
    Image -> Maybe Text
baseImageArn :: Prelude.Maybe Prelude.Text,
    -- | The image name to display.
    Image -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The description to display.
    Image -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The version of the AppStream 2.0 agent to use for instances that are
    -- launched from this image.
    Image -> Maybe Text
appstreamAgentVersion :: Prelude.Maybe Prelude.Text,
    -- | The applications associated with the image.
    Image -> Maybe [Application]
applications :: Prelude.Maybe [Application],
    -- | The name of the image.
    Image -> Text
name :: Prelude.Text
  }
  deriving (Image -> Image -> Bool
(Image -> Image -> Bool) -> (Image -> Image -> Bool) -> Eq Image
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Image -> Image -> Bool
$c/= :: Image -> Image -> Bool
== :: Image -> Image -> Bool
$c== :: Image -> Image -> Bool
Prelude.Eq, ReadPrec [Image]
ReadPrec Image
Int -> ReadS Image
ReadS [Image]
(Int -> ReadS Image)
-> ReadS [Image]
-> ReadPrec Image
-> ReadPrec [Image]
-> Read Image
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Image]
$creadListPrec :: ReadPrec [Image]
readPrec :: ReadPrec Image
$creadPrec :: ReadPrec Image
readList :: ReadS [Image]
$creadList :: ReadS [Image]
readsPrec :: Int -> ReadS Image
$creadsPrec :: Int -> ReadS Image
Prelude.Read, Int -> Image -> ShowS
[Image] -> ShowS
Image -> String
(Int -> Image -> ShowS)
-> (Image -> String) -> ([Image] -> ShowS) -> Show Image
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Image] -> ShowS
$cshowList :: [Image] -> ShowS
show :: Image -> String
$cshow :: Image -> String
showsPrec :: Int -> Image -> ShowS
$cshowsPrec :: Int -> Image -> ShowS
Prelude.Show, (forall x. Image -> Rep Image x)
-> (forall x. Rep Image x -> Image) -> Generic Image
forall x. Rep Image x -> Image
forall x. Image -> Rep Image x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Image x -> Image
$cfrom :: forall x. Image -> Rep Image x
Prelude.Generic)

-- |
-- Create a value of 'Image' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'state', 'image_state' - The image starts in the @PENDING@ state. If image creation succeeds, the
-- state is @AVAILABLE@. If image creation fails, the state is @FAILED@.
--
-- 'imagePermissions', 'image_imagePermissions' - The permissions to provide to the destination AWS account for the
-- specified image.
--
-- 'platform', 'image_platform' - The operating system platform of the image.
--
-- 'publicBaseImageReleasedDate', 'image_publicBaseImageReleasedDate' - The release date of the public base image. For private images, this date
-- is the release date of the base image from which the image was created.
--
-- 'stateChangeReason', 'image_stateChangeReason' - The reason why the last state change occurred.
--
-- 'arn', 'image_arn' - The ARN of the image.
--
-- 'createdTime', 'image_createdTime' - The time the image was created.
--
-- 'imageBuilderSupported', 'image_imageBuilderSupported' - Indicates whether an image builder can be launched from this image.
--
-- 'visibility', 'image_visibility' - Indicates whether the image is public or private.
--
-- 'imageBuilderName', 'image_imageBuilderName' - The name of the image builder that was used to create the private image.
-- If the image is shared, this value is null.
--
-- 'imageErrors', 'image_imageErrors' - Describes the errors that are returned when a new image can\'t be
-- created.
--
-- 'baseImageArn', 'image_baseImageArn' - The ARN of the image from which this image was created.
--
-- 'displayName', 'image_displayName' - The image name to display.
--
-- 'description', 'image_description' - The description to display.
--
-- 'appstreamAgentVersion', 'image_appstreamAgentVersion' - The version of the AppStream 2.0 agent to use for instances that are
-- launched from this image.
--
-- 'applications', 'image_applications' - The applications associated with the image.
--
-- 'name', 'image_name' - The name of the image.
newImage ::
  -- | 'name'
  Prelude.Text ->
  Image
newImage :: Text -> Image
newImage Text
pName_ =
  Image' :: Maybe ImageState
-> Maybe ImagePermissions
-> Maybe PlatformType
-> Maybe POSIX
-> Maybe ImageStateChangeReason
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe VisibilityType
-> Maybe Text
-> Maybe [ResourceError]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Application]
-> Text
-> Image
Image'
    { $sel:state:Image' :: Maybe ImageState
state = Maybe ImageState
forall a. Maybe a
Prelude.Nothing,
      $sel:imagePermissions:Image' :: Maybe ImagePermissions
imagePermissions = Maybe ImagePermissions
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:Image' :: Maybe PlatformType
platform = Maybe PlatformType
forall a. Maybe a
Prelude.Nothing,
      $sel:publicBaseImageReleasedDate:Image' :: Maybe POSIX
publicBaseImageReleasedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:stateChangeReason:Image' :: Maybe ImageStateChangeReason
stateChangeReason = Maybe ImageStateChangeReason
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Image' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:Image' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:imageBuilderSupported:Image' :: Maybe Bool
imageBuilderSupported = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:visibility:Image' :: Maybe VisibilityType
visibility = Maybe VisibilityType
forall a. Maybe a
Prelude.Nothing,
      $sel:imageBuilderName:Image' :: Maybe Text
imageBuilderName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageErrors:Image' :: Maybe [ResourceError]
imageErrors = Maybe [ResourceError]
forall a. Maybe a
Prelude.Nothing,
      $sel:baseImageArn:Image' :: Maybe Text
baseImageArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:Image' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Image' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appstreamAgentVersion:Image' :: Maybe Text
appstreamAgentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applications:Image' :: Maybe [Application]
applications = Maybe [Application]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Image' :: Text
name = Text
pName_
    }

-- | The image starts in the @PENDING@ state. If image creation succeeds, the
-- state is @AVAILABLE@. If image creation fails, the state is @FAILED@.
image_state :: Lens.Lens' Image (Prelude.Maybe ImageState)
image_state :: (Maybe ImageState -> f (Maybe ImageState)) -> Image -> f Image
image_state = (Image -> Maybe ImageState)
-> (Image -> Maybe ImageState -> Image)
-> Lens Image Image (Maybe ImageState) (Maybe ImageState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe ImageState
state :: Maybe ImageState
$sel:state:Image' :: Image -> Maybe ImageState
state} -> Maybe ImageState
state) (\s :: Image
s@Image' {} Maybe ImageState
a -> Image
s {$sel:state:Image' :: Maybe ImageState
state = Maybe ImageState
a} :: Image)

-- | The permissions to provide to the destination AWS account for the
-- specified image.
image_imagePermissions :: Lens.Lens' Image (Prelude.Maybe ImagePermissions)
image_imagePermissions :: (Maybe ImagePermissions -> f (Maybe ImagePermissions))
-> Image -> f Image
image_imagePermissions = (Image -> Maybe ImagePermissions)
-> (Image -> Maybe ImagePermissions -> Image)
-> Lens
     Image Image (Maybe ImagePermissions) (Maybe ImagePermissions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe ImagePermissions
imagePermissions :: Maybe ImagePermissions
$sel:imagePermissions:Image' :: Image -> Maybe ImagePermissions
imagePermissions} -> Maybe ImagePermissions
imagePermissions) (\s :: Image
s@Image' {} Maybe ImagePermissions
a -> Image
s {$sel:imagePermissions:Image' :: Maybe ImagePermissions
imagePermissions = Maybe ImagePermissions
a} :: Image)

-- | The operating system platform of the image.
image_platform :: Lens.Lens' Image (Prelude.Maybe PlatformType)
image_platform :: (Maybe PlatformType -> f (Maybe PlatformType)) -> Image -> f Image
image_platform = (Image -> Maybe PlatformType)
-> (Image -> Maybe PlatformType -> Image)
-> Lens Image Image (Maybe PlatformType) (Maybe PlatformType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe PlatformType
platform :: Maybe PlatformType
$sel:platform:Image' :: Image -> Maybe PlatformType
platform} -> Maybe PlatformType
platform) (\s :: Image
s@Image' {} Maybe PlatformType
a -> Image
s {$sel:platform:Image' :: Maybe PlatformType
platform = Maybe PlatformType
a} :: Image)

-- | The release date of the public base image. For private images, this date
-- is the release date of the base image from which the image was created.
image_publicBaseImageReleasedDate :: Lens.Lens' Image (Prelude.Maybe Prelude.UTCTime)
image_publicBaseImageReleasedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Image -> f Image
image_publicBaseImageReleasedDate = (Image -> Maybe POSIX)
-> (Image -> Maybe POSIX -> Image)
-> Lens Image Image (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe POSIX
publicBaseImageReleasedDate :: Maybe POSIX
$sel:publicBaseImageReleasedDate:Image' :: Image -> Maybe POSIX
publicBaseImageReleasedDate} -> Maybe POSIX
publicBaseImageReleasedDate) (\s :: Image
s@Image' {} Maybe POSIX
a -> Image
s {$sel:publicBaseImageReleasedDate:Image' :: Maybe POSIX
publicBaseImageReleasedDate = Maybe POSIX
a} :: Image) ((Maybe POSIX -> f (Maybe POSIX)) -> Image -> f Image)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The reason why the last state change occurred.
image_stateChangeReason :: Lens.Lens' Image (Prelude.Maybe ImageStateChangeReason)
image_stateChangeReason :: (Maybe ImageStateChangeReason -> f (Maybe ImageStateChangeReason))
-> Image -> f Image
image_stateChangeReason = (Image -> Maybe ImageStateChangeReason)
-> (Image -> Maybe ImageStateChangeReason -> Image)
-> Lens
     Image
     Image
     (Maybe ImageStateChangeReason)
     (Maybe ImageStateChangeReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe ImageStateChangeReason
stateChangeReason :: Maybe ImageStateChangeReason
$sel:stateChangeReason:Image' :: Image -> Maybe ImageStateChangeReason
stateChangeReason} -> Maybe ImageStateChangeReason
stateChangeReason) (\s :: Image
s@Image' {} Maybe ImageStateChangeReason
a -> Image
s {$sel:stateChangeReason:Image' :: Maybe ImageStateChangeReason
stateChangeReason = Maybe ImageStateChangeReason
a} :: Image)

-- | The ARN of the image.
image_arn :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_arn :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_arn = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
arn :: Maybe Text
$sel:arn:Image' :: Image -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:arn:Image' :: Maybe Text
arn = Maybe Text
a} :: Image)

-- | The time the image was created.
image_createdTime :: Lens.Lens' Image (Prelude.Maybe Prelude.UTCTime)
image_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Image -> f Image
image_createdTime = (Image -> Maybe POSIX)
-> (Image -> Maybe POSIX -> Image)
-> Lens Image Image (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:Image' :: Image -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: Image
s@Image' {} Maybe POSIX
a -> Image
s {$sel:createdTime:Image' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: Image) ((Maybe POSIX -> f (Maybe POSIX)) -> Image -> f Image)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Indicates whether an image builder can be launched from this image.
image_imageBuilderSupported :: Lens.Lens' Image (Prelude.Maybe Prelude.Bool)
image_imageBuilderSupported :: (Maybe Bool -> f (Maybe Bool)) -> Image -> f Image
image_imageBuilderSupported = (Image -> Maybe Bool)
-> (Image -> Maybe Bool -> Image)
-> Lens Image Image (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Bool
imageBuilderSupported :: Maybe Bool
$sel:imageBuilderSupported:Image' :: Image -> Maybe Bool
imageBuilderSupported} -> Maybe Bool
imageBuilderSupported) (\s :: Image
s@Image' {} Maybe Bool
a -> Image
s {$sel:imageBuilderSupported:Image' :: Maybe Bool
imageBuilderSupported = Maybe Bool
a} :: Image)

-- | Indicates whether the image is public or private.
image_visibility :: Lens.Lens' Image (Prelude.Maybe VisibilityType)
image_visibility :: (Maybe VisibilityType -> f (Maybe VisibilityType))
-> Image -> f Image
image_visibility = (Image -> Maybe VisibilityType)
-> (Image -> Maybe VisibilityType -> Image)
-> Lens Image Image (Maybe VisibilityType) (Maybe VisibilityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe VisibilityType
visibility :: Maybe VisibilityType
$sel:visibility:Image' :: Image -> Maybe VisibilityType
visibility} -> Maybe VisibilityType
visibility) (\s :: Image
s@Image' {} Maybe VisibilityType
a -> Image
s {$sel:visibility:Image' :: Maybe VisibilityType
visibility = Maybe VisibilityType
a} :: Image)

-- | The name of the image builder that was used to create the private image.
-- If the image is shared, this value is null.
image_imageBuilderName :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_imageBuilderName :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_imageBuilderName = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
imageBuilderName :: Maybe Text
$sel:imageBuilderName:Image' :: Image -> Maybe Text
imageBuilderName} -> Maybe Text
imageBuilderName) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:imageBuilderName:Image' :: Maybe Text
imageBuilderName = Maybe Text
a} :: Image)

-- | Describes the errors that are returned when a new image can\'t be
-- created.
image_imageErrors :: Lens.Lens' Image (Prelude.Maybe [ResourceError])
image_imageErrors :: (Maybe [ResourceError] -> f (Maybe [ResourceError]))
-> Image -> f Image
image_imageErrors = (Image -> Maybe [ResourceError])
-> (Image -> Maybe [ResourceError] -> Image)
-> Lens Image Image (Maybe [ResourceError]) (Maybe [ResourceError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe [ResourceError]
imageErrors :: Maybe [ResourceError]
$sel:imageErrors:Image' :: Image -> Maybe [ResourceError]
imageErrors} -> Maybe [ResourceError]
imageErrors) (\s :: Image
s@Image' {} Maybe [ResourceError]
a -> Image
s {$sel:imageErrors:Image' :: Maybe [ResourceError]
imageErrors = Maybe [ResourceError]
a} :: Image) ((Maybe [ResourceError] -> f (Maybe [ResourceError]))
 -> Image -> f Image)
-> ((Maybe [ResourceError] -> f (Maybe [ResourceError]))
    -> Maybe [ResourceError] -> f (Maybe [ResourceError]))
-> (Maybe [ResourceError] -> f (Maybe [ResourceError]))
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceError] [ResourceError] [ResourceError] [ResourceError]
-> Iso
     (Maybe [ResourceError])
     (Maybe [ResourceError])
     (Maybe [ResourceError])
     (Maybe [ResourceError])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ResourceError] [ResourceError] [ResourceError] [ResourceError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the image from which this image was created.
image_baseImageArn :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_baseImageArn :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_baseImageArn = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
baseImageArn :: Maybe Text
$sel:baseImageArn:Image' :: Image -> Maybe Text
baseImageArn} -> Maybe Text
baseImageArn) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:baseImageArn:Image' :: Maybe Text
baseImageArn = Maybe Text
a} :: Image)

-- | The image name to display.
image_displayName :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_displayName :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_displayName = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
displayName :: Maybe Text
$sel:displayName:Image' :: Image -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:displayName:Image' :: Maybe Text
displayName = Maybe Text
a} :: Image)

-- | The description to display.
image_description :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_description :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_description = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
description :: Maybe Text
$sel:description:Image' :: Image -> Maybe Text
description} -> Maybe Text
description) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:description:Image' :: Maybe Text
description = Maybe Text
a} :: Image)

-- | The version of the AppStream 2.0 agent to use for instances that are
-- launched from this image.
image_appstreamAgentVersion :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_appstreamAgentVersion :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_appstreamAgentVersion = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
appstreamAgentVersion :: Maybe Text
$sel:appstreamAgentVersion:Image' :: Image -> Maybe Text
appstreamAgentVersion} -> Maybe Text
appstreamAgentVersion) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:appstreamAgentVersion:Image' :: Maybe Text
appstreamAgentVersion = Maybe Text
a} :: Image)

-- | The applications associated with the image.
image_applications :: Lens.Lens' Image (Prelude.Maybe [Application])
image_applications :: (Maybe [Application] -> f (Maybe [Application]))
-> Image -> f Image
image_applications = (Image -> Maybe [Application])
-> (Image -> Maybe [Application] -> Image)
-> Lens Image Image (Maybe [Application]) (Maybe [Application])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe [Application]
applications :: Maybe [Application]
$sel:applications:Image' :: Image -> Maybe [Application]
applications} -> Maybe [Application]
applications) (\s :: Image
s@Image' {} Maybe [Application]
a -> Image
s {$sel:applications:Image' :: Maybe [Application]
applications = Maybe [Application]
a} :: Image) ((Maybe [Application] -> f (Maybe [Application]))
 -> Image -> f Image)
-> ((Maybe [Application] -> f (Maybe [Application]))
    -> Maybe [Application] -> f (Maybe [Application]))
-> (Maybe [Application] -> f (Maybe [Application]))
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Application] [Application] [Application] [Application]
-> Iso
     (Maybe [Application])
     (Maybe [Application])
     (Maybe [Application])
     (Maybe [Application])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Application] [Application] [Application] [Application]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the image.
image_name :: Lens.Lens' Image Prelude.Text
image_name :: (Text -> f Text) -> Image -> f Image
image_name = (Image -> Text)
-> (Image -> Text -> Image) -> Lens Image Image Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Text
name :: Text
$sel:name:Image' :: Image -> Text
name} -> Text
name) (\s :: Image
s@Image' {} Text
a -> Image
s {$sel:name:Image' :: Text
name = Text
a} :: Image)

instance Core.FromJSON Image where
  parseJSON :: Value -> Parser Image
parseJSON =
    String -> (Object -> Parser Image) -> Value -> Parser Image
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Image"
      ( \Object
x ->
          Maybe ImageState
-> Maybe ImagePermissions
-> Maybe PlatformType
-> Maybe POSIX
-> Maybe ImageStateChangeReason
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe VisibilityType
-> Maybe Text
-> Maybe [ResourceError]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Application]
-> Text
-> Image
Image'
            (Maybe ImageState
 -> Maybe ImagePermissions
 -> Maybe PlatformType
 -> Maybe POSIX
 -> Maybe ImageStateChangeReason
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe VisibilityType
 -> Maybe Text
 -> Maybe [ResourceError]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Application]
 -> Text
 -> Image)
-> Parser (Maybe ImageState)
-> Parser
     (Maybe ImagePermissions
      -> Maybe PlatformType
      -> Maybe POSIX
      -> Maybe ImageStateChangeReason
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ImageState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe ImagePermissions
   -> Maybe PlatformType
   -> Maybe POSIX
   -> Maybe ImageStateChangeReason
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe ImagePermissions)
-> Parser
     (Maybe PlatformType
      -> Maybe POSIX
      -> Maybe ImageStateChangeReason
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImagePermissions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImagePermissions")
            Parser
  (Maybe PlatformType
   -> Maybe POSIX
   -> Maybe ImageStateChangeReason
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe PlatformType)
-> Parser
     (Maybe POSIX
      -> Maybe ImageStateChangeReason
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PlatformType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Platform")
            Parser
  (Maybe POSIX
   -> Maybe ImageStateChangeReason
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ImageStateChangeReason
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PublicBaseImageReleasedDate")
            Parser
  (Maybe ImageStateChangeReason
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe ImageStateChangeReason)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageStateChangeReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StateChangeReason")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe POSIX
   -> Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser
  (Maybe Bool
   -> Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe Bool)
-> Parser
     (Maybe VisibilityType
      -> Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageBuilderSupported")
            Parser
  (Maybe VisibilityType
   -> Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe VisibilityType)
-> Parser
     (Maybe Text
      -> Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VisibilityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Visibility")
            Parser
  (Maybe Text
   -> Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ResourceError]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageBuilderName")
            Parser
  (Maybe [ResourceError]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe [ResourceError])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ResourceError]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageErrors" Parser (Maybe (Maybe [ResourceError]))
-> Maybe [ResourceError] -> Parser (Maybe [ResourceError])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ResourceError]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Application]
      -> Text
      -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BaseImageArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Application]
   -> Text
   -> Image)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe [Application] -> Text -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisplayName")
            Parser
  (Maybe Text -> Maybe Text -> Maybe [Application] -> Text -> Image)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Application] -> Text -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Text -> Maybe [Application] -> Text -> Image)
-> Parser (Maybe Text)
-> Parser (Maybe [Application] -> Text -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppstreamAgentVersion")
            Parser (Maybe [Application] -> Text -> Image)
-> Parser (Maybe [Application]) -> Parser (Text -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Application]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Applications" Parser (Maybe (Maybe [Application]))
-> Maybe [Application] -> Parser (Maybe [Application])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Application]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Image) -> Parser Text -> Parser Image
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
      )

instance Prelude.Hashable Image

instance Prelude.NFData Image