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

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

-- |
-- Module      : Amazonka.SSM.AssociateOpsItemRelatedItem
-- 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)
--
-- Associates a related item to a Systems Manager OpsCenter OpsItem. For
-- example, you can associate an Incident Manager incident or analysis with
-- an OpsItem. Incident Manager and OpsCenter are capabilities of Amazon
-- Web Services Systems Manager.
module Amazonka.SSM.AssociateOpsItemRelatedItem
  ( -- * Creating a Request
    AssociateOpsItemRelatedItem (..),
    newAssociateOpsItemRelatedItem,

    -- * Request Lenses
    associateOpsItemRelatedItem_opsItemId,
    associateOpsItemRelatedItem_associationType,
    associateOpsItemRelatedItem_resourceType,
    associateOpsItemRelatedItem_resourceUri,

    -- * Destructuring the Response
    AssociateOpsItemRelatedItemResponse (..),
    newAssociateOpsItemRelatedItemResponse,

    -- * Response Lenses
    associateOpsItemRelatedItemResponse_associationId,
    associateOpsItemRelatedItemResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newAssociateOpsItemRelatedItem' smart constructor.
data AssociateOpsItemRelatedItem = AssociateOpsItemRelatedItem'
  { -- | The ID of the OpsItem to which you want to associate a resource as a
    -- related item.
    AssociateOpsItemRelatedItem -> Text
opsItemId :: Prelude.Text,
    -- | The type of association that you want to create between an OpsItem and a
    -- resource. OpsCenter supports @IsParentOf@ and @RelatesTo@ association
    -- types.
    AssociateOpsItemRelatedItem -> Text
associationType :: Prelude.Text,
    -- | The type of resource that you want to associate with an OpsItem.
    -- OpsCenter supports the following types:
    --
    -- @AWS::SSMIncidents::IncidentRecord@: an Incident Manager incident.
    --
    -- @AWS::SSM::Document@: a Systems Manager (SSM) document.
    AssociateOpsItemRelatedItem -> Text
resourceType :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon Web Services resource that
    -- you want to associate with the OpsItem.
    AssociateOpsItemRelatedItem -> Text
resourceUri :: Prelude.Text
  }
  deriving (AssociateOpsItemRelatedItem -> AssociateOpsItemRelatedItem -> Bool
(AssociateOpsItemRelatedItem
 -> AssociateOpsItemRelatedItem -> Bool)
-> (AssociateOpsItemRelatedItem
    -> AssociateOpsItemRelatedItem -> Bool)
-> Eq AssociateOpsItemRelatedItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateOpsItemRelatedItem -> AssociateOpsItemRelatedItem -> Bool
$c/= :: AssociateOpsItemRelatedItem -> AssociateOpsItemRelatedItem -> Bool
== :: AssociateOpsItemRelatedItem -> AssociateOpsItemRelatedItem -> Bool
$c== :: AssociateOpsItemRelatedItem -> AssociateOpsItemRelatedItem -> Bool
Prelude.Eq, ReadPrec [AssociateOpsItemRelatedItem]
ReadPrec AssociateOpsItemRelatedItem
Int -> ReadS AssociateOpsItemRelatedItem
ReadS [AssociateOpsItemRelatedItem]
(Int -> ReadS AssociateOpsItemRelatedItem)
-> ReadS [AssociateOpsItemRelatedItem]
-> ReadPrec AssociateOpsItemRelatedItem
-> ReadPrec [AssociateOpsItemRelatedItem]
-> Read AssociateOpsItemRelatedItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateOpsItemRelatedItem]
$creadListPrec :: ReadPrec [AssociateOpsItemRelatedItem]
readPrec :: ReadPrec AssociateOpsItemRelatedItem
$creadPrec :: ReadPrec AssociateOpsItemRelatedItem
readList :: ReadS [AssociateOpsItemRelatedItem]
$creadList :: ReadS [AssociateOpsItemRelatedItem]
readsPrec :: Int -> ReadS AssociateOpsItemRelatedItem
$creadsPrec :: Int -> ReadS AssociateOpsItemRelatedItem
Prelude.Read, Int -> AssociateOpsItemRelatedItem -> ShowS
[AssociateOpsItemRelatedItem] -> ShowS
AssociateOpsItemRelatedItem -> String
(Int -> AssociateOpsItemRelatedItem -> ShowS)
-> (AssociateOpsItemRelatedItem -> String)
-> ([AssociateOpsItemRelatedItem] -> ShowS)
-> Show AssociateOpsItemRelatedItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateOpsItemRelatedItem] -> ShowS
$cshowList :: [AssociateOpsItemRelatedItem] -> ShowS
show :: AssociateOpsItemRelatedItem -> String
$cshow :: AssociateOpsItemRelatedItem -> String
showsPrec :: Int -> AssociateOpsItemRelatedItem -> ShowS
$cshowsPrec :: Int -> AssociateOpsItemRelatedItem -> ShowS
Prelude.Show, (forall x.
 AssociateOpsItemRelatedItem -> Rep AssociateOpsItemRelatedItem x)
-> (forall x.
    Rep AssociateOpsItemRelatedItem x -> AssociateOpsItemRelatedItem)
-> Generic AssociateOpsItemRelatedItem
forall x.
Rep AssociateOpsItemRelatedItem x -> AssociateOpsItemRelatedItem
forall x.
AssociateOpsItemRelatedItem -> Rep AssociateOpsItemRelatedItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateOpsItemRelatedItem x -> AssociateOpsItemRelatedItem
$cfrom :: forall x.
AssociateOpsItemRelatedItem -> Rep AssociateOpsItemRelatedItem x
Prelude.Generic)

-- |
-- Create a value of 'AssociateOpsItemRelatedItem' 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:
--
-- 'opsItemId', 'associateOpsItemRelatedItem_opsItemId' - The ID of the OpsItem to which you want to associate a resource as a
-- related item.
--
-- 'associationType', 'associateOpsItemRelatedItem_associationType' - The type of association that you want to create between an OpsItem and a
-- resource. OpsCenter supports @IsParentOf@ and @RelatesTo@ association
-- types.
--
-- 'resourceType', 'associateOpsItemRelatedItem_resourceType' - The type of resource that you want to associate with an OpsItem.
-- OpsCenter supports the following types:
--
-- @AWS::SSMIncidents::IncidentRecord@: an Incident Manager incident.
--
-- @AWS::SSM::Document@: a Systems Manager (SSM) document.
--
-- 'resourceUri', 'associateOpsItemRelatedItem_resourceUri' - The Amazon Resource Name (ARN) of the Amazon Web Services resource that
-- you want to associate with the OpsItem.
newAssociateOpsItemRelatedItem ::
  -- | 'opsItemId'
  Prelude.Text ->
  -- | 'associationType'
  Prelude.Text ->
  -- | 'resourceType'
  Prelude.Text ->
  -- | 'resourceUri'
  Prelude.Text ->
  AssociateOpsItemRelatedItem
newAssociateOpsItemRelatedItem :: Text -> Text -> Text -> Text -> AssociateOpsItemRelatedItem
newAssociateOpsItemRelatedItem
  Text
pOpsItemId_
  Text
pAssociationType_
  Text
pResourceType_
  Text
pResourceUri_ =
    AssociateOpsItemRelatedItem' :: Text -> Text -> Text -> Text -> AssociateOpsItemRelatedItem
AssociateOpsItemRelatedItem'
      { $sel:opsItemId:AssociateOpsItemRelatedItem' :: Text
opsItemId =
          Text
pOpsItemId_,
        $sel:associationType:AssociateOpsItemRelatedItem' :: Text
associationType = Text
pAssociationType_,
        $sel:resourceType:AssociateOpsItemRelatedItem' :: Text
resourceType = Text
pResourceType_,
        $sel:resourceUri:AssociateOpsItemRelatedItem' :: Text
resourceUri = Text
pResourceUri_
      }

-- | The ID of the OpsItem to which you want to associate a resource as a
-- related item.
associateOpsItemRelatedItem_opsItemId :: Lens.Lens' AssociateOpsItemRelatedItem Prelude.Text
associateOpsItemRelatedItem_opsItemId :: (Text -> f Text)
-> AssociateOpsItemRelatedItem -> f AssociateOpsItemRelatedItem
associateOpsItemRelatedItem_opsItemId = (AssociateOpsItemRelatedItem -> Text)
-> (AssociateOpsItemRelatedItem
    -> Text -> AssociateOpsItemRelatedItem)
-> Lens
     AssociateOpsItemRelatedItem AssociateOpsItemRelatedItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItem' {Text
opsItemId :: Text
$sel:opsItemId:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
opsItemId} -> Text
opsItemId) (\s :: AssociateOpsItemRelatedItem
s@AssociateOpsItemRelatedItem' {} Text
a -> AssociateOpsItemRelatedItem
s {$sel:opsItemId:AssociateOpsItemRelatedItem' :: Text
opsItemId = Text
a} :: AssociateOpsItemRelatedItem)

-- | The type of association that you want to create between an OpsItem and a
-- resource. OpsCenter supports @IsParentOf@ and @RelatesTo@ association
-- types.
associateOpsItemRelatedItem_associationType :: Lens.Lens' AssociateOpsItemRelatedItem Prelude.Text
associateOpsItemRelatedItem_associationType :: (Text -> f Text)
-> AssociateOpsItemRelatedItem -> f AssociateOpsItemRelatedItem
associateOpsItemRelatedItem_associationType = (AssociateOpsItemRelatedItem -> Text)
-> (AssociateOpsItemRelatedItem
    -> Text -> AssociateOpsItemRelatedItem)
-> Lens
     AssociateOpsItemRelatedItem AssociateOpsItemRelatedItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItem' {Text
associationType :: Text
$sel:associationType:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
associationType} -> Text
associationType) (\s :: AssociateOpsItemRelatedItem
s@AssociateOpsItemRelatedItem' {} Text
a -> AssociateOpsItemRelatedItem
s {$sel:associationType:AssociateOpsItemRelatedItem' :: Text
associationType = Text
a} :: AssociateOpsItemRelatedItem)

-- | The type of resource that you want to associate with an OpsItem.
-- OpsCenter supports the following types:
--
-- @AWS::SSMIncidents::IncidentRecord@: an Incident Manager incident.
--
-- @AWS::SSM::Document@: a Systems Manager (SSM) document.
associateOpsItemRelatedItem_resourceType :: Lens.Lens' AssociateOpsItemRelatedItem Prelude.Text
associateOpsItemRelatedItem_resourceType :: (Text -> f Text)
-> AssociateOpsItemRelatedItem -> f AssociateOpsItemRelatedItem
associateOpsItemRelatedItem_resourceType = (AssociateOpsItemRelatedItem -> Text)
-> (AssociateOpsItemRelatedItem
    -> Text -> AssociateOpsItemRelatedItem)
-> Lens
     AssociateOpsItemRelatedItem AssociateOpsItemRelatedItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItem' {Text
resourceType :: Text
$sel:resourceType:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
resourceType} -> Text
resourceType) (\s :: AssociateOpsItemRelatedItem
s@AssociateOpsItemRelatedItem' {} Text
a -> AssociateOpsItemRelatedItem
s {$sel:resourceType:AssociateOpsItemRelatedItem' :: Text
resourceType = Text
a} :: AssociateOpsItemRelatedItem)

-- | The Amazon Resource Name (ARN) of the Amazon Web Services resource that
-- you want to associate with the OpsItem.
associateOpsItemRelatedItem_resourceUri :: Lens.Lens' AssociateOpsItemRelatedItem Prelude.Text
associateOpsItemRelatedItem_resourceUri :: (Text -> f Text)
-> AssociateOpsItemRelatedItem -> f AssociateOpsItemRelatedItem
associateOpsItemRelatedItem_resourceUri = (AssociateOpsItemRelatedItem -> Text)
-> (AssociateOpsItemRelatedItem
    -> Text -> AssociateOpsItemRelatedItem)
-> Lens
     AssociateOpsItemRelatedItem AssociateOpsItemRelatedItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItem' {Text
resourceUri :: Text
$sel:resourceUri:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
resourceUri} -> Text
resourceUri) (\s :: AssociateOpsItemRelatedItem
s@AssociateOpsItemRelatedItem' {} Text
a -> AssociateOpsItemRelatedItem
s {$sel:resourceUri:AssociateOpsItemRelatedItem' :: Text
resourceUri = Text
a} :: AssociateOpsItemRelatedItem)

instance Core.AWSRequest AssociateOpsItemRelatedItem where
  type
    AWSResponse AssociateOpsItemRelatedItem =
      AssociateOpsItemRelatedItemResponse
  request :: AssociateOpsItemRelatedItem -> Request AssociateOpsItemRelatedItem
request = Service
-> AssociateOpsItemRelatedItem
-> Request AssociateOpsItemRelatedItem
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociateOpsItemRelatedItem
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateOpsItemRelatedItem)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AssociateOpsItemRelatedItem))
-> Logger
-> Service
-> Proxy AssociateOpsItemRelatedItem
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateOpsItemRelatedItem)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> AssociateOpsItemRelatedItemResponse
AssociateOpsItemRelatedItemResponse'
            (Maybe Text -> Int -> AssociateOpsItemRelatedItemResponse)
-> Either String (Maybe Text)
-> Either String (Int -> AssociateOpsItemRelatedItemResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssociationId")
            Either String (Int -> AssociateOpsItemRelatedItemResponse)
-> Either String Int
-> Either String AssociateOpsItemRelatedItemResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable AssociateOpsItemRelatedItem

instance Prelude.NFData AssociateOpsItemRelatedItem

instance Core.ToHeaders AssociateOpsItemRelatedItem where
  toHeaders :: AssociateOpsItemRelatedItem -> ResponseHeaders
toHeaders =
    ResponseHeaders -> AssociateOpsItemRelatedItem -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.AssociateOpsItemRelatedItem" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON AssociateOpsItemRelatedItem where
  toJSON :: AssociateOpsItemRelatedItem -> Value
toJSON AssociateOpsItemRelatedItem' {Text
resourceUri :: Text
resourceType :: Text
associationType :: Text
opsItemId :: Text
$sel:resourceUri:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
$sel:resourceType:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
$sel:associationType:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
$sel:opsItemId:AssociateOpsItemRelatedItem' :: AssociateOpsItemRelatedItem -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OpsItemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
opsItemId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AssociationType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
associationType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceUri)
          ]
      )

instance Core.ToPath AssociateOpsItemRelatedItem where
  toPath :: AssociateOpsItemRelatedItem -> ByteString
toPath = ByteString -> AssociateOpsItemRelatedItem -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery AssociateOpsItemRelatedItem where
  toQuery :: AssociateOpsItemRelatedItem -> QueryString
toQuery = QueryString -> AssociateOpsItemRelatedItem -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newAssociateOpsItemRelatedItemResponse' smart constructor.
data AssociateOpsItemRelatedItemResponse = AssociateOpsItemRelatedItemResponse'
  { -- | The association ID.
    AssociateOpsItemRelatedItemResponse -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    AssociateOpsItemRelatedItemResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateOpsItemRelatedItemResponse
-> AssociateOpsItemRelatedItemResponse -> Bool
(AssociateOpsItemRelatedItemResponse
 -> AssociateOpsItemRelatedItemResponse -> Bool)
-> (AssociateOpsItemRelatedItemResponse
    -> AssociateOpsItemRelatedItemResponse -> Bool)
-> Eq AssociateOpsItemRelatedItemResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateOpsItemRelatedItemResponse
-> AssociateOpsItemRelatedItemResponse -> Bool
$c/= :: AssociateOpsItemRelatedItemResponse
-> AssociateOpsItemRelatedItemResponse -> Bool
== :: AssociateOpsItemRelatedItemResponse
-> AssociateOpsItemRelatedItemResponse -> Bool
$c== :: AssociateOpsItemRelatedItemResponse
-> AssociateOpsItemRelatedItemResponse -> Bool
Prelude.Eq, ReadPrec [AssociateOpsItemRelatedItemResponse]
ReadPrec AssociateOpsItemRelatedItemResponse
Int -> ReadS AssociateOpsItemRelatedItemResponse
ReadS [AssociateOpsItemRelatedItemResponse]
(Int -> ReadS AssociateOpsItemRelatedItemResponse)
-> ReadS [AssociateOpsItemRelatedItemResponse]
-> ReadPrec AssociateOpsItemRelatedItemResponse
-> ReadPrec [AssociateOpsItemRelatedItemResponse]
-> Read AssociateOpsItemRelatedItemResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateOpsItemRelatedItemResponse]
$creadListPrec :: ReadPrec [AssociateOpsItemRelatedItemResponse]
readPrec :: ReadPrec AssociateOpsItemRelatedItemResponse
$creadPrec :: ReadPrec AssociateOpsItemRelatedItemResponse
readList :: ReadS [AssociateOpsItemRelatedItemResponse]
$creadList :: ReadS [AssociateOpsItemRelatedItemResponse]
readsPrec :: Int -> ReadS AssociateOpsItemRelatedItemResponse
$creadsPrec :: Int -> ReadS AssociateOpsItemRelatedItemResponse
Prelude.Read, Int -> AssociateOpsItemRelatedItemResponse -> ShowS
[AssociateOpsItemRelatedItemResponse] -> ShowS
AssociateOpsItemRelatedItemResponse -> String
(Int -> AssociateOpsItemRelatedItemResponse -> ShowS)
-> (AssociateOpsItemRelatedItemResponse -> String)
-> ([AssociateOpsItemRelatedItemResponse] -> ShowS)
-> Show AssociateOpsItemRelatedItemResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateOpsItemRelatedItemResponse] -> ShowS
$cshowList :: [AssociateOpsItemRelatedItemResponse] -> ShowS
show :: AssociateOpsItemRelatedItemResponse -> String
$cshow :: AssociateOpsItemRelatedItemResponse -> String
showsPrec :: Int -> AssociateOpsItemRelatedItemResponse -> ShowS
$cshowsPrec :: Int -> AssociateOpsItemRelatedItemResponse -> ShowS
Prelude.Show, (forall x.
 AssociateOpsItemRelatedItemResponse
 -> Rep AssociateOpsItemRelatedItemResponse x)
-> (forall x.
    Rep AssociateOpsItemRelatedItemResponse x
    -> AssociateOpsItemRelatedItemResponse)
-> Generic AssociateOpsItemRelatedItemResponse
forall x.
Rep AssociateOpsItemRelatedItemResponse x
-> AssociateOpsItemRelatedItemResponse
forall x.
AssociateOpsItemRelatedItemResponse
-> Rep AssociateOpsItemRelatedItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateOpsItemRelatedItemResponse x
-> AssociateOpsItemRelatedItemResponse
$cfrom :: forall x.
AssociateOpsItemRelatedItemResponse
-> Rep AssociateOpsItemRelatedItemResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateOpsItemRelatedItemResponse' 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:
--
-- 'associationId', 'associateOpsItemRelatedItemResponse_associationId' - The association ID.
--
-- 'httpStatus', 'associateOpsItemRelatedItemResponse_httpStatus' - The response's http status code.
newAssociateOpsItemRelatedItemResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateOpsItemRelatedItemResponse
newAssociateOpsItemRelatedItemResponse :: Int -> AssociateOpsItemRelatedItemResponse
newAssociateOpsItemRelatedItemResponse Int
pHttpStatus_ =
  AssociateOpsItemRelatedItemResponse' :: Maybe Text -> Int -> AssociateOpsItemRelatedItemResponse
AssociateOpsItemRelatedItemResponse'
    { $sel:associationId:AssociateOpsItemRelatedItemResponse' :: Maybe Text
associationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AssociateOpsItemRelatedItemResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The association ID.
associateOpsItemRelatedItemResponse_associationId :: Lens.Lens' AssociateOpsItemRelatedItemResponse (Prelude.Maybe Prelude.Text)
associateOpsItemRelatedItemResponse_associationId :: (Maybe Text -> f (Maybe Text))
-> AssociateOpsItemRelatedItemResponse
-> f AssociateOpsItemRelatedItemResponse
associateOpsItemRelatedItemResponse_associationId = (AssociateOpsItemRelatedItemResponse -> Maybe Text)
-> (AssociateOpsItemRelatedItemResponse
    -> Maybe Text -> AssociateOpsItemRelatedItemResponse)
-> Lens
     AssociateOpsItemRelatedItemResponse
     AssociateOpsItemRelatedItemResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItemResponse' {Maybe Text
associationId :: Maybe Text
$sel:associationId:AssociateOpsItemRelatedItemResponse' :: AssociateOpsItemRelatedItemResponse -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: AssociateOpsItemRelatedItemResponse
s@AssociateOpsItemRelatedItemResponse' {} Maybe Text
a -> AssociateOpsItemRelatedItemResponse
s {$sel:associationId:AssociateOpsItemRelatedItemResponse' :: Maybe Text
associationId = Maybe Text
a} :: AssociateOpsItemRelatedItemResponse)

-- | The response's http status code.
associateOpsItemRelatedItemResponse_httpStatus :: Lens.Lens' AssociateOpsItemRelatedItemResponse Prelude.Int
associateOpsItemRelatedItemResponse_httpStatus :: (Int -> f Int)
-> AssociateOpsItemRelatedItemResponse
-> f AssociateOpsItemRelatedItemResponse
associateOpsItemRelatedItemResponse_httpStatus = (AssociateOpsItemRelatedItemResponse -> Int)
-> (AssociateOpsItemRelatedItemResponse
    -> Int -> AssociateOpsItemRelatedItemResponse)
-> Lens
     AssociateOpsItemRelatedItemResponse
     AssociateOpsItemRelatedItemResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOpsItemRelatedItemResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateOpsItemRelatedItemResponse' :: AssociateOpsItemRelatedItemResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateOpsItemRelatedItemResponse
s@AssociateOpsItemRelatedItemResponse' {} Int
a -> AssociateOpsItemRelatedItemResponse
s {$sel:httpStatus:AssociateOpsItemRelatedItemResponse' :: Int
httpStatus = Int
a} :: AssociateOpsItemRelatedItemResponse)

instance
  Prelude.NFData
    AssociateOpsItemRelatedItemResponse