packages feed

amazonka-devicefarm-2.0: gen/Amazonka/DeviceFarm/Types/Artifact.hs

{-# 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.DeviceFarm.Types.Artifact
-- 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.DeviceFarm.Types.Artifact where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types.ArtifactType
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a test. Examples of artifacts include logs and
-- screenshots.
--
-- /See:/ 'newArtifact' smart constructor.
data Artifact = Artifact'
  { -- | The artifact\'s ARN.
    arn :: Prelude.Maybe Prelude.Text,
    -- | The artifact\'s file extension.
    extension :: Prelude.Maybe Prelude.Text,
    -- | The artifact\'s name.
    name :: Prelude.Maybe Prelude.Text,
    -- | The artifact\'s type.
    --
    -- Allowed values include the following:
    --
    -- -   UNKNOWN
    --
    -- -   SCREENSHOT
    --
    -- -   DEVICE_LOG
    --
    -- -   MESSAGE_LOG
    --
    -- -   VIDEO_LOG
    --
    -- -   RESULT_LOG
    --
    -- -   SERVICE_LOG
    --
    -- -   WEBKIT_LOG
    --
    -- -   INSTRUMENTATION_OUTPUT
    --
    -- -   EXERCISER_MONKEY_OUTPUT: the artifact (log) generated by an Android
    --     fuzz test.
    --
    -- -   CALABASH_JSON_OUTPUT
    --
    -- -   CALABASH_PRETTY_OUTPUT
    --
    -- -   CALABASH_STANDARD_OUTPUT
    --
    -- -   CALABASH_JAVA_XML_OUTPUT
    --
    -- -   AUTOMATION_OUTPUT
    --
    -- -   APPIUM_SERVER_OUTPUT
    --
    -- -   APPIUM_JAVA_OUTPUT
    --
    -- -   APPIUM_JAVA_XML_OUTPUT
    --
    -- -   APPIUM_PYTHON_OUTPUT
    --
    -- -   APPIUM_PYTHON_XML_OUTPUT
    --
    -- -   EXPLORER_EVENT_LOG
    --
    -- -   EXPLORER_SUMMARY_LOG
    --
    -- -   APPLICATION_CRASH_REPORT
    --
    -- -   XCTEST_LOG
    --
    -- -   VIDEO
    --
    -- -   CUSTOMER_ARTIFACT
    --
    -- -   CUSTOMER_ARTIFACT_LOG
    --
    -- -   TESTSPEC_OUTPUT
    type' :: Prelude.Maybe ArtifactType,
    -- | The presigned Amazon S3 URL that can be used with a GET request to
    -- download the artifact\'s file.
    url :: Prelude.Maybe Prelude.Text
  }
  deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)

-- |
-- Create a value of 'Artifact' 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:
--
-- 'arn', 'artifact_arn' - The artifact\'s ARN.
--
-- 'extension', 'artifact_extension' - The artifact\'s file extension.
--
-- 'name', 'artifact_name' - The artifact\'s name.
--
-- 'type'', 'artifact_type' - The artifact\'s type.
--
-- Allowed values include the following:
--
-- -   UNKNOWN
--
-- -   SCREENSHOT
--
-- -   DEVICE_LOG
--
-- -   MESSAGE_LOG
--
-- -   VIDEO_LOG
--
-- -   RESULT_LOG
--
-- -   SERVICE_LOG
--
-- -   WEBKIT_LOG
--
-- -   INSTRUMENTATION_OUTPUT
--
-- -   EXERCISER_MONKEY_OUTPUT: the artifact (log) generated by an Android
--     fuzz test.
--
-- -   CALABASH_JSON_OUTPUT
--
-- -   CALABASH_PRETTY_OUTPUT
--
-- -   CALABASH_STANDARD_OUTPUT
--
-- -   CALABASH_JAVA_XML_OUTPUT
--
-- -   AUTOMATION_OUTPUT
--
-- -   APPIUM_SERVER_OUTPUT
--
-- -   APPIUM_JAVA_OUTPUT
--
-- -   APPIUM_JAVA_XML_OUTPUT
--
-- -   APPIUM_PYTHON_OUTPUT
--
-- -   APPIUM_PYTHON_XML_OUTPUT
--
-- -   EXPLORER_EVENT_LOG
--
-- -   EXPLORER_SUMMARY_LOG
--
-- -   APPLICATION_CRASH_REPORT
--
-- -   XCTEST_LOG
--
-- -   VIDEO
--
-- -   CUSTOMER_ARTIFACT
--
-- -   CUSTOMER_ARTIFACT_LOG
--
-- -   TESTSPEC_OUTPUT
--
-- 'url', 'artifact_url' - The presigned Amazon S3 URL that can be used with a GET request to
-- download the artifact\'s file.
newArtifact ::
  Artifact
newArtifact =
  Artifact'
    { arn = Prelude.Nothing,
      extension = Prelude.Nothing,
      name = Prelude.Nothing,
      type' = Prelude.Nothing,
      url = Prelude.Nothing
    }

-- | The artifact\'s ARN.
artifact_arn :: Lens.Lens' Artifact (Prelude.Maybe Prelude.Text)
artifact_arn = Lens.lens (\Artifact' {arn} -> arn) (\s@Artifact' {} a -> s {arn = a} :: Artifact)

-- | The artifact\'s file extension.
artifact_extension :: Lens.Lens' Artifact (Prelude.Maybe Prelude.Text)
artifact_extension = Lens.lens (\Artifact' {extension} -> extension) (\s@Artifact' {} a -> s {extension = a} :: Artifact)

-- | The artifact\'s name.
artifact_name :: Lens.Lens' Artifact (Prelude.Maybe Prelude.Text)
artifact_name = Lens.lens (\Artifact' {name} -> name) (\s@Artifact' {} a -> s {name = a} :: Artifact)

-- | The artifact\'s type.
--
-- Allowed values include the following:
--
-- -   UNKNOWN
--
-- -   SCREENSHOT
--
-- -   DEVICE_LOG
--
-- -   MESSAGE_LOG
--
-- -   VIDEO_LOG
--
-- -   RESULT_LOG
--
-- -   SERVICE_LOG
--
-- -   WEBKIT_LOG
--
-- -   INSTRUMENTATION_OUTPUT
--
-- -   EXERCISER_MONKEY_OUTPUT: the artifact (log) generated by an Android
--     fuzz test.
--
-- -   CALABASH_JSON_OUTPUT
--
-- -   CALABASH_PRETTY_OUTPUT
--
-- -   CALABASH_STANDARD_OUTPUT
--
-- -   CALABASH_JAVA_XML_OUTPUT
--
-- -   AUTOMATION_OUTPUT
--
-- -   APPIUM_SERVER_OUTPUT
--
-- -   APPIUM_JAVA_OUTPUT
--
-- -   APPIUM_JAVA_XML_OUTPUT
--
-- -   APPIUM_PYTHON_OUTPUT
--
-- -   APPIUM_PYTHON_XML_OUTPUT
--
-- -   EXPLORER_EVENT_LOG
--
-- -   EXPLORER_SUMMARY_LOG
--
-- -   APPLICATION_CRASH_REPORT
--
-- -   XCTEST_LOG
--
-- -   VIDEO
--
-- -   CUSTOMER_ARTIFACT
--
-- -   CUSTOMER_ARTIFACT_LOG
--
-- -   TESTSPEC_OUTPUT
artifact_type :: Lens.Lens' Artifact (Prelude.Maybe ArtifactType)
artifact_type = Lens.lens (\Artifact' {type'} -> type') (\s@Artifact' {} a -> s {type' = a} :: Artifact)

-- | The presigned Amazon S3 URL that can be used with a GET request to
-- download the artifact\'s file.
artifact_url :: Lens.Lens' Artifact (Prelude.Maybe Prelude.Text)
artifact_url = Lens.lens (\Artifact' {url} -> url) (\s@Artifact' {} a -> s {url = a} :: Artifact)

instance Data.FromJSON Artifact where
  parseJSON =
    Data.withObject
      "Artifact"
      ( \x ->
          Artifact'
            Prelude.<$> (x Data..:? "arn")
            Prelude.<*> (x Data..:? "extension")
            Prelude.<*> (x Data..:? "name")
            Prelude.<*> (x Data..:? "type")
            Prelude.<*> (x Data..:? "url")
      )

instance Prelude.Hashable Artifact where
  hashWithSalt _salt Artifact' {..} =
    _salt
      `Prelude.hashWithSalt` arn
      `Prelude.hashWithSalt` extension
      `Prelude.hashWithSalt` name
      `Prelude.hashWithSalt` type'
      `Prelude.hashWithSalt` url

instance Prelude.NFData Artifact where
  rnf Artifact' {..} =
    Prelude.rnf arn
      `Prelude.seq` Prelude.rnf extension
      `Prelude.seq` Prelude.rnf name
      `Prelude.seq` Prelude.rnf type'
      `Prelude.seq` Prelude.rnf url