packages feed

amazonka-emr-containers-2.0: gen/Amazonka/EMRContainers/Types/Endpoint.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.EMRContainers.Types.Endpoint
-- 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.EMRContainers.Types.Endpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMRContainers.Types.Certificate
import Amazonka.EMRContainers.Types.ConfigurationOverrides
import Amazonka.EMRContainers.Types.EndpointState
import Amazonka.EMRContainers.Types.FailureReason
import qualified Amazonka.Prelude as Prelude

-- | This entity represents the endpoint that is managed by Amazon EMR on
-- EKS.
--
-- /See:/ 'newEndpoint' smart constructor.
data Endpoint = Endpoint'
  { -- | The ARN of the endpoint.
    arn :: Prelude.Maybe Prelude.Text,
    -- | The certificate ARN of the endpoint. This field is under deprecation and
    -- will be removed in future.
    certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The certificate generated by emr control plane on customer behalf to
    -- secure the managed endpoint.
    certificateAuthority :: Prelude.Maybe Certificate,
    -- | The configuration settings that are used to override existing
    -- configurations for endpoints.
    configurationOverrides :: Prelude.Maybe ConfigurationOverrides,
    -- | The date and time when the endpoint was created.
    createdAt :: Prelude.Maybe Data.ISO8601,
    -- | The execution role ARN of the endpoint.
    executionRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The reasons why the endpoint has failed.
    failureReason :: Prelude.Maybe FailureReason,
    -- | The ID of the endpoint.
    id :: Prelude.Maybe Prelude.Text,
    -- | The name of the endpoint.
    name :: Prelude.Maybe Prelude.Text,
    -- | The EMR release version to be used for the endpoint.
    releaseLabel :: Prelude.Maybe Prelude.Text,
    -- | The security group configuration of the endpoint.
    securityGroup :: Prelude.Maybe Prelude.Text,
    -- | The server URL of the endpoint.
    serverUrl :: Prelude.Maybe Prelude.Text,
    -- | The state of the endpoint.
    state :: Prelude.Maybe EndpointState,
    -- | Additional details of the endpoint state.
    stateDetails :: Prelude.Maybe Prelude.Text,
    -- | The subnet IDs of the endpoint.
    subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The tags of the endpoint.
    tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The type of the endpoint.
    type' :: Prelude.Maybe Prelude.Text,
    -- | The ID of the endpoint\'s virtual cluster.
    virtualClusterId :: Prelude.Maybe Prelude.Text
  }
  deriving (Prelude.Eq, Prelude.Show, Prelude.Generic)

-- |
-- Create a value of 'Endpoint' 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', 'endpoint_arn' - The ARN of the endpoint.
--
-- 'certificateArn', 'endpoint_certificateArn' - The certificate ARN of the endpoint. This field is under deprecation and
-- will be removed in future.
--
-- 'certificateAuthority', 'endpoint_certificateAuthority' - The certificate generated by emr control plane on customer behalf to
-- secure the managed endpoint.
--
-- 'configurationOverrides', 'endpoint_configurationOverrides' - The configuration settings that are used to override existing
-- configurations for endpoints.
--
-- 'createdAt', 'endpoint_createdAt' - The date and time when the endpoint was created.
--
-- 'executionRoleArn', 'endpoint_executionRoleArn' - The execution role ARN of the endpoint.
--
-- 'failureReason', 'endpoint_failureReason' - The reasons why the endpoint has failed.
--
-- 'id', 'endpoint_id' - The ID of the endpoint.
--
-- 'name', 'endpoint_name' - The name of the endpoint.
--
-- 'releaseLabel', 'endpoint_releaseLabel' - The EMR release version to be used for the endpoint.
--
-- 'securityGroup', 'endpoint_securityGroup' - The security group configuration of the endpoint.
--
-- 'serverUrl', 'endpoint_serverUrl' - The server URL of the endpoint.
--
-- 'state', 'endpoint_state' - The state of the endpoint.
--
-- 'stateDetails', 'endpoint_stateDetails' - Additional details of the endpoint state.
--
-- 'subnetIds', 'endpoint_subnetIds' - The subnet IDs of the endpoint.
--
-- 'tags', 'endpoint_tags' - The tags of the endpoint.
--
-- 'type'', 'endpoint_type' - The type of the endpoint.
--
-- 'virtualClusterId', 'endpoint_virtualClusterId' - The ID of the endpoint\'s virtual cluster.
newEndpoint ::
  Endpoint
newEndpoint =
  Endpoint'
    { arn = Prelude.Nothing,
      certificateArn = Prelude.Nothing,
      certificateAuthority = Prelude.Nothing,
      configurationOverrides = Prelude.Nothing,
      createdAt = Prelude.Nothing,
      executionRoleArn = Prelude.Nothing,
      failureReason = Prelude.Nothing,
      id = Prelude.Nothing,
      name = Prelude.Nothing,
      releaseLabel = Prelude.Nothing,
      securityGroup = Prelude.Nothing,
      serverUrl = Prelude.Nothing,
      state = Prelude.Nothing,
      stateDetails = Prelude.Nothing,
      subnetIds = Prelude.Nothing,
      tags = Prelude.Nothing,
      type' = Prelude.Nothing,
      virtualClusterId = Prelude.Nothing
    }

-- | The ARN of the endpoint.
endpoint_arn :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_arn = Lens.lens (\Endpoint' {arn} -> arn) (\s@Endpoint' {} a -> s {arn = a} :: Endpoint)

-- | The certificate ARN of the endpoint. This field is under deprecation and
-- will be removed in future.
endpoint_certificateArn :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_certificateArn = Lens.lens (\Endpoint' {certificateArn} -> certificateArn) (\s@Endpoint' {} a -> s {certificateArn = a} :: Endpoint)

-- | The certificate generated by emr control plane on customer behalf to
-- secure the managed endpoint.
endpoint_certificateAuthority :: Lens.Lens' Endpoint (Prelude.Maybe Certificate)
endpoint_certificateAuthority = Lens.lens (\Endpoint' {certificateAuthority} -> certificateAuthority) (\s@Endpoint' {} a -> s {certificateAuthority = a} :: Endpoint)

-- | The configuration settings that are used to override existing
-- configurations for endpoints.
endpoint_configurationOverrides :: Lens.Lens' Endpoint (Prelude.Maybe ConfigurationOverrides)
endpoint_configurationOverrides = Lens.lens (\Endpoint' {configurationOverrides} -> configurationOverrides) (\s@Endpoint' {} a -> s {configurationOverrides = a} :: Endpoint)

-- | The date and time when the endpoint was created.
endpoint_createdAt :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.UTCTime)
endpoint_createdAt = Lens.lens (\Endpoint' {createdAt} -> createdAt) (\s@Endpoint' {} a -> s {createdAt = a} :: Endpoint) Prelude.. Lens.mapping Data._Time

-- | The execution role ARN of the endpoint.
endpoint_executionRoleArn :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_executionRoleArn = Lens.lens (\Endpoint' {executionRoleArn} -> executionRoleArn) (\s@Endpoint' {} a -> s {executionRoleArn = a} :: Endpoint)

-- | The reasons why the endpoint has failed.
endpoint_failureReason :: Lens.Lens' Endpoint (Prelude.Maybe FailureReason)
endpoint_failureReason = Lens.lens (\Endpoint' {failureReason} -> failureReason) (\s@Endpoint' {} a -> s {failureReason = a} :: Endpoint)

-- | The ID of the endpoint.
endpoint_id :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_id = Lens.lens (\Endpoint' {id} -> id) (\s@Endpoint' {} a -> s {id = a} :: Endpoint)

-- | The name of the endpoint.
endpoint_name :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_name = Lens.lens (\Endpoint' {name} -> name) (\s@Endpoint' {} a -> s {name = a} :: Endpoint)

-- | The EMR release version to be used for the endpoint.
endpoint_releaseLabel :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_releaseLabel = Lens.lens (\Endpoint' {releaseLabel} -> releaseLabel) (\s@Endpoint' {} a -> s {releaseLabel = a} :: Endpoint)

-- | The security group configuration of the endpoint.
endpoint_securityGroup :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_securityGroup = Lens.lens (\Endpoint' {securityGroup} -> securityGroup) (\s@Endpoint' {} a -> s {securityGroup = a} :: Endpoint)

-- | The server URL of the endpoint.
endpoint_serverUrl :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_serverUrl = Lens.lens (\Endpoint' {serverUrl} -> serverUrl) (\s@Endpoint' {} a -> s {serverUrl = a} :: Endpoint)

-- | The state of the endpoint.
endpoint_state :: Lens.Lens' Endpoint (Prelude.Maybe EndpointState)
endpoint_state = Lens.lens (\Endpoint' {state} -> state) (\s@Endpoint' {} a -> s {state = a} :: Endpoint)

-- | Additional details of the endpoint state.
endpoint_stateDetails :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_stateDetails = Lens.lens (\Endpoint' {stateDetails} -> stateDetails) (\s@Endpoint' {} a -> s {stateDetails = a} :: Endpoint)

-- | The subnet IDs of the endpoint.
endpoint_subnetIds :: Lens.Lens' Endpoint (Prelude.Maybe [Prelude.Text])
endpoint_subnetIds = Lens.lens (\Endpoint' {subnetIds} -> subnetIds) (\s@Endpoint' {} a -> s {subnetIds = a} :: Endpoint) Prelude.. Lens.mapping Lens.coerced

-- | The tags of the endpoint.
endpoint_tags :: Lens.Lens' Endpoint (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
endpoint_tags = Lens.lens (\Endpoint' {tags} -> tags) (\s@Endpoint' {} a -> s {tags = a} :: Endpoint) Prelude.. Lens.mapping Lens.coerced

-- | The type of the endpoint.
endpoint_type :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_type = Lens.lens (\Endpoint' {type'} -> type') (\s@Endpoint' {} a -> s {type' = a} :: Endpoint)

-- | The ID of the endpoint\'s virtual cluster.
endpoint_virtualClusterId :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_virtualClusterId = Lens.lens (\Endpoint' {virtualClusterId} -> virtualClusterId) (\s@Endpoint' {} a -> s {virtualClusterId = a} :: Endpoint)

instance Data.FromJSON Endpoint where
  parseJSON =
    Data.withObject
      "Endpoint"
      ( \x ->
          Endpoint'
            Prelude.<$> (x Data..:? "arn")
            Prelude.<*> (x Data..:? "certificateArn")
            Prelude.<*> (x Data..:? "certificateAuthority")
            Prelude.<*> (x Data..:? "configurationOverrides")
            Prelude.<*> (x Data..:? "createdAt")
            Prelude.<*> (x Data..:? "executionRoleArn")
            Prelude.<*> (x Data..:? "failureReason")
            Prelude.<*> (x Data..:? "id")
            Prelude.<*> (x Data..:? "name")
            Prelude.<*> (x Data..:? "releaseLabel")
            Prelude.<*> (x Data..:? "securityGroup")
            Prelude.<*> (x Data..:? "serverUrl")
            Prelude.<*> (x Data..:? "state")
            Prelude.<*> (x Data..:? "stateDetails")
            Prelude.<*> (x Data..:? "subnetIds" Data..!= Prelude.mempty)
            Prelude.<*> (x Data..:? "tags" Data..!= Prelude.mempty)
            Prelude.<*> (x Data..:? "type")
            Prelude.<*> (x Data..:? "virtualClusterId")
      )

instance Prelude.Hashable Endpoint where
  hashWithSalt _salt Endpoint' {..} =
    _salt
      `Prelude.hashWithSalt` arn
      `Prelude.hashWithSalt` certificateArn
      `Prelude.hashWithSalt` certificateAuthority
      `Prelude.hashWithSalt` configurationOverrides
      `Prelude.hashWithSalt` createdAt
      `Prelude.hashWithSalt` executionRoleArn
      `Prelude.hashWithSalt` failureReason
      `Prelude.hashWithSalt` id
      `Prelude.hashWithSalt` name
      `Prelude.hashWithSalt` releaseLabel
      `Prelude.hashWithSalt` securityGroup
      `Prelude.hashWithSalt` serverUrl
      `Prelude.hashWithSalt` state
      `Prelude.hashWithSalt` stateDetails
      `Prelude.hashWithSalt` subnetIds
      `Prelude.hashWithSalt` tags
      `Prelude.hashWithSalt` type'
      `Prelude.hashWithSalt` virtualClusterId

instance Prelude.NFData Endpoint where
  rnf Endpoint' {..} =
    Prelude.rnf arn
      `Prelude.seq` Prelude.rnf certificateArn
      `Prelude.seq` Prelude.rnf certificateAuthority
      `Prelude.seq` Prelude.rnf configurationOverrides
      `Prelude.seq` Prelude.rnf createdAt
      `Prelude.seq` Prelude.rnf executionRoleArn
      `Prelude.seq` Prelude.rnf failureReason
      `Prelude.seq` Prelude.rnf id
      `Prelude.seq` Prelude.rnf name
      `Prelude.seq` Prelude.rnf releaseLabel
      `Prelude.seq` Prelude.rnf securityGroup
      `Prelude.seq` Prelude.rnf serverUrl
      `Prelude.seq` Prelude.rnf state
      `Prelude.seq` Prelude.rnf stateDetails
      `Prelude.seq` Prelude.rnf subnetIds
      `Prelude.seq` Prelude.rnf tags
      `Prelude.seq` Prelude.rnf type'
      `Prelude.seq` Prelude.rnf virtualClusterId