{-# 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.EC2.Types.ImportSnapshotTask -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.EC2.Types.ImportSnapshotTask where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.EC2.Internal import Amazonka.EC2.Types.SnapshotTaskDetail import Amazonka.EC2.Types.Tag import qualified Amazonka.Prelude as Prelude -- | Describes an import snapshot task. -- -- /See:/ 'newImportSnapshotTask' smart constructor. data ImportSnapshotTask = ImportSnapshotTask' { -- | A description of the import snapshot task. description :: Prelude.Maybe Prelude.Text, -- | The ID of the import snapshot task. importTaskId :: Prelude.Maybe Prelude.Text, -- | Describes an import snapshot task. snapshotTaskDetail :: Prelude.Maybe SnapshotTaskDetail, -- | The tags for the import snapshot task. tags :: Prelude.Maybe [Tag] } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ImportSnapshotTask' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'description', 'importSnapshotTask_description' - A description of the import snapshot task. -- -- 'importTaskId', 'importSnapshotTask_importTaskId' - The ID of the import snapshot task. -- -- 'snapshotTaskDetail', 'importSnapshotTask_snapshotTaskDetail' - Describes an import snapshot task. -- -- 'tags', 'importSnapshotTask_tags' - The tags for the import snapshot task. newImportSnapshotTask :: ImportSnapshotTask newImportSnapshotTask = ImportSnapshotTask' { description = Prelude.Nothing, importTaskId = Prelude.Nothing, snapshotTaskDetail = Prelude.Nothing, tags = Prelude.Nothing } -- | A description of the import snapshot task. importSnapshotTask_description :: Lens.Lens' ImportSnapshotTask (Prelude.Maybe Prelude.Text) importSnapshotTask_description = Lens.lens (\ImportSnapshotTask' {description} -> description) (\s@ImportSnapshotTask' {} a -> s {description = a} :: ImportSnapshotTask) -- | The ID of the import snapshot task. importSnapshotTask_importTaskId :: Lens.Lens' ImportSnapshotTask (Prelude.Maybe Prelude.Text) importSnapshotTask_importTaskId = Lens.lens (\ImportSnapshotTask' {importTaskId} -> importTaskId) (\s@ImportSnapshotTask' {} a -> s {importTaskId = a} :: ImportSnapshotTask) -- | Describes an import snapshot task. importSnapshotTask_snapshotTaskDetail :: Lens.Lens' ImportSnapshotTask (Prelude.Maybe SnapshotTaskDetail) importSnapshotTask_snapshotTaskDetail = Lens.lens (\ImportSnapshotTask' {snapshotTaskDetail} -> snapshotTaskDetail) (\s@ImportSnapshotTask' {} a -> s {snapshotTaskDetail = a} :: ImportSnapshotTask) -- | The tags for the import snapshot task. importSnapshotTask_tags :: Lens.Lens' ImportSnapshotTask (Prelude.Maybe [Tag]) importSnapshotTask_tags = Lens.lens (\ImportSnapshotTask' {tags} -> tags) (\s@ImportSnapshotTask' {} a -> s {tags = a} :: ImportSnapshotTask) Prelude.. Lens.mapping Lens.coerced instance Data.FromXML ImportSnapshotTask where parseXML x = ImportSnapshotTask' Prelude.<$> (x Data..@? "description") Prelude.<*> (x Data..@? "importTaskId") Prelude.<*> (x Data..@? "snapshotTaskDetail") Prelude.<*> ( x Data..@? "tagSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) instance Prelude.Hashable ImportSnapshotTask where hashWithSalt _salt ImportSnapshotTask' {..} = _salt `Prelude.hashWithSalt` description `Prelude.hashWithSalt` importTaskId `Prelude.hashWithSalt` snapshotTaskDetail `Prelude.hashWithSalt` tags instance Prelude.NFData ImportSnapshotTask where rnf ImportSnapshotTask' {..} = Prelude.rnf description `Prelude.seq` Prelude.rnf importTaskId `Prelude.seq` Prelude.rnf snapshotTaskDetail `Prelude.seq` Prelude.rnf tags