{-# 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.Connect.DisassociateInstanceStorageConfig
-- 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)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Removes the storage type configurations for the specified resource type
-- and association ID.
module Amazonka.Connect.DisassociateInstanceStorageConfig
  ( -- * Creating a Request
    DisassociateInstanceStorageConfig (..),
    newDisassociateInstanceStorageConfig,

    -- * Request Lenses
    disassociateInstanceStorageConfig_instanceId,
    disassociateInstanceStorageConfig_associationId,
    disassociateInstanceStorageConfig_resourceType,

    -- * Destructuring the Response
    DisassociateInstanceStorageConfigResponse (..),
    newDisassociateInstanceStorageConfigResponse,
  )
where

import Amazonka.Connect.Types
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

-- | /See:/ 'newDisassociateInstanceStorageConfig' smart constructor.
data DisassociateInstanceStorageConfig = DisassociateInstanceStorageConfig'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DisassociateInstanceStorageConfig -> Text
instanceId :: Prelude.Text,
    -- | The existing association identifier that uniquely identifies the
    -- resource type and storage config for the given instance ID.
    DisassociateInstanceStorageConfig -> Text
associationId :: Prelude.Text,
    -- | A valid resource type.
    DisassociateInstanceStorageConfig -> InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
  }
  deriving (DisassociateInstanceStorageConfig
-> DisassociateInstanceStorageConfig -> Bool
(DisassociateInstanceStorageConfig
 -> DisassociateInstanceStorageConfig -> Bool)
-> (DisassociateInstanceStorageConfig
    -> DisassociateInstanceStorageConfig -> Bool)
-> Eq DisassociateInstanceStorageConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateInstanceStorageConfig
-> DisassociateInstanceStorageConfig -> Bool
$c/= :: DisassociateInstanceStorageConfig
-> DisassociateInstanceStorageConfig -> Bool
== :: DisassociateInstanceStorageConfig
-> DisassociateInstanceStorageConfig -> Bool
$c== :: DisassociateInstanceStorageConfig
-> DisassociateInstanceStorageConfig -> Bool
Prelude.Eq, ReadPrec [DisassociateInstanceStorageConfig]
ReadPrec DisassociateInstanceStorageConfig
Int -> ReadS DisassociateInstanceStorageConfig
ReadS [DisassociateInstanceStorageConfig]
(Int -> ReadS DisassociateInstanceStorageConfig)
-> ReadS [DisassociateInstanceStorageConfig]
-> ReadPrec DisassociateInstanceStorageConfig
-> ReadPrec [DisassociateInstanceStorageConfig]
-> Read DisassociateInstanceStorageConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateInstanceStorageConfig]
$creadListPrec :: ReadPrec [DisassociateInstanceStorageConfig]
readPrec :: ReadPrec DisassociateInstanceStorageConfig
$creadPrec :: ReadPrec DisassociateInstanceStorageConfig
readList :: ReadS [DisassociateInstanceStorageConfig]
$creadList :: ReadS [DisassociateInstanceStorageConfig]
readsPrec :: Int -> ReadS DisassociateInstanceStorageConfig
$creadsPrec :: Int -> ReadS DisassociateInstanceStorageConfig
Prelude.Read, Int -> DisassociateInstanceStorageConfig -> ShowS
[DisassociateInstanceStorageConfig] -> ShowS
DisassociateInstanceStorageConfig -> String
(Int -> DisassociateInstanceStorageConfig -> ShowS)
-> (DisassociateInstanceStorageConfig -> String)
-> ([DisassociateInstanceStorageConfig] -> ShowS)
-> Show DisassociateInstanceStorageConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateInstanceStorageConfig] -> ShowS
$cshowList :: [DisassociateInstanceStorageConfig] -> ShowS
show :: DisassociateInstanceStorageConfig -> String
$cshow :: DisassociateInstanceStorageConfig -> String
showsPrec :: Int -> DisassociateInstanceStorageConfig -> ShowS
$cshowsPrec :: Int -> DisassociateInstanceStorageConfig -> ShowS
Prelude.Show, (forall x.
 DisassociateInstanceStorageConfig
 -> Rep DisassociateInstanceStorageConfig x)
-> (forall x.
    Rep DisassociateInstanceStorageConfig x
    -> DisassociateInstanceStorageConfig)
-> Generic DisassociateInstanceStorageConfig
forall x.
Rep DisassociateInstanceStorageConfig x
-> DisassociateInstanceStorageConfig
forall x.
DisassociateInstanceStorageConfig
-> Rep DisassociateInstanceStorageConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateInstanceStorageConfig x
-> DisassociateInstanceStorageConfig
$cfrom :: forall x.
DisassociateInstanceStorageConfig
-> Rep DisassociateInstanceStorageConfig x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateInstanceStorageConfig' 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:
--
-- 'instanceId', 'disassociateInstanceStorageConfig_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'associationId', 'disassociateInstanceStorageConfig_associationId' - The existing association identifier that uniquely identifies the
-- resource type and storage config for the given instance ID.
--
-- 'resourceType', 'disassociateInstanceStorageConfig_resourceType' - A valid resource type.
newDisassociateInstanceStorageConfig ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'associationId'
  Prelude.Text ->
  -- | 'resourceType'
  InstanceStorageResourceType ->
  DisassociateInstanceStorageConfig
newDisassociateInstanceStorageConfig :: Text
-> Text
-> InstanceStorageResourceType
-> DisassociateInstanceStorageConfig
newDisassociateInstanceStorageConfig
  Text
pInstanceId_
  Text
pAssociationId_
  InstanceStorageResourceType
pResourceType_ =
    DisassociateInstanceStorageConfig' :: Text
-> Text
-> InstanceStorageResourceType
-> DisassociateInstanceStorageConfig
DisassociateInstanceStorageConfig'
      { $sel:instanceId:DisassociateInstanceStorageConfig' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:associationId:DisassociateInstanceStorageConfig' :: Text
associationId = Text
pAssociationId_,
        $sel:resourceType:DisassociateInstanceStorageConfig' :: InstanceStorageResourceType
resourceType = InstanceStorageResourceType
pResourceType_
      }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
disassociateInstanceStorageConfig_instanceId :: Lens.Lens' DisassociateInstanceStorageConfig Prelude.Text
disassociateInstanceStorageConfig_instanceId :: (Text -> f Text)
-> DisassociateInstanceStorageConfig
-> f DisassociateInstanceStorageConfig
disassociateInstanceStorageConfig_instanceId = (DisassociateInstanceStorageConfig -> Text)
-> (DisassociateInstanceStorageConfig
    -> Text -> DisassociateInstanceStorageConfig)
-> Lens
     DisassociateInstanceStorageConfig
     DisassociateInstanceStorageConfig
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateInstanceStorageConfig' {Text
instanceId :: Text
$sel:instanceId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
instanceId} -> Text
instanceId) (\s :: DisassociateInstanceStorageConfig
s@DisassociateInstanceStorageConfig' {} Text
a -> DisassociateInstanceStorageConfig
s {$sel:instanceId:DisassociateInstanceStorageConfig' :: Text
instanceId = Text
a} :: DisassociateInstanceStorageConfig)

-- | The existing association identifier that uniquely identifies the
-- resource type and storage config for the given instance ID.
disassociateInstanceStorageConfig_associationId :: Lens.Lens' DisassociateInstanceStorageConfig Prelude.Text
disassociateInstanceStorageConfig_associationId :: (Text -> f Text)
-> DisassociateInstanceStorageConfig
-> f DisassociateInstanceStorageConfig
disassociateInstanceStorageConfig_associationId = (DisassociateInstanceStorageConfig -> Text)
-> (DisassociateInstanceStorageConfig
    -> Text -> DisassociateInstanceStorageConfig)
-> Lens
     DisassociateInstanceStorageConfig
     DisassociateInstanceStorageConfig
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateInstanceStorageConfig' {Text
associationId :: Text
$sel:associationId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
associationId} -> Text
associationId) (\s :: DisassociateInstanceStorageConfig
s@DisassociateInstanceStorageConfig' {} Text
a -> DisassociateInstanceStorageConfig
s {$sel:associationId:DisassociateInstanceStorageConfig' :: Text
associationId = Text
a} :: DisassociateInstanceStorageConfig)

-- | A valid resource type.
disassociateInstanceStorageConfig_resourceType :: Lens.Lens' DisassociateInstanceStorageConfig InstanceStorageResourceType
disassociateInstanceStorageConfig_resourceType :: (InstanceStorageResourceType -> f InstanceStorageResourceType)
-> DisassociateInstanceStorageConfig
-> f DisassociateInstanceStorageConfig
disassociateInstanceStorageConfig_resourceType = (DisassociateInstanceStorageConfig -> InstanceStorageResourceType)
-> (DisassociateInstanceStorageConfig
    -> InstanceStorageResourceType
    -> DisassociateInstanceStorageConfig)
-> Lens
     DisassociateInstanceStorageConfig
     DisassociateInstanceStorageConfig
     InstanceStorageResourceType
     InstanceStorageResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateInstanceStorageConfig' {InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
$sel:resourceType:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> InstanceStorageResourceType
resourceType} -> InstanceStorageResourceType
resourceType) (\s :: DisassociateInstanceStorageConfig
s@DisassociateInstanceStorageConfig' {} InstanceStorageResourceType
a -> DisassociateInstanceStorageConfig
s {$sel:resourceType:DisassociateInstanceStorageConfig' :: InstanceStorageResourceType
resourceType = InstanceStorageResourceType
a} :: DisassociateInstanceStorageConfig)

instance
  Core.AWSRequest
    DisassociateInstanceStorageConfig
  where
  type
    AWSResponse DisassociateInstanceStorageConfig =
      DisassociateInstanceStorageConfigResponse
  request :: DisassociateInstanceStorageConfig
-> Request DisassociateInstanceStorageConfig
request = Service
-> DisassociateInstanceStorageConfig
-> Request DisassociateInstanceStorageConfig
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateInstanceStorageConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateInstanceStorageConfig)))
response =
    AWSResponse DisassociateInstanceStorageConfig
-> Logger
-> Service
-> Proxy DisassociateInstanceStorageConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateInstanceStorageConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DisassociateInstanceStorageConfig
DisassociateInstanceStorageConfigResponse
DisassociateInstanceStorageConfigResponse'

instance
  Prelude.Hashable
    DisassociateInstanceStorageConfig

instance
  Prelude.NFData
    DisassociateInstanceStorageConfig

instance
  Core.ToHeaders
    DisassociateInstanceStorageConfig
  where
  toHeaders :: DisassociateInstanceStorageConfig -> [Header]
toHeaders =
    [Header] -> DisassociateInstanceStorageConfig -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToPath
    DisassociateInstanceStorageConfig
  where
  toPath :: DisassociateInstanceStorageConfig -> ByteString
toPath DisassociateInstanceStorageConfig' {Text
InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
associationId :: Text
instanceId :: Text
$sel:resourceType:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> InstanceStorageResourceType
$sel:associationId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
$sel:instanceId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/storage-config/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
associationId
      ]

instance
  Core.ToQuery
    DisassociateInstanceStorageConfig
  where
  toQuery :: DisassociateInstanceStorageConfig -> QueryString
toQuery DisassociateInstanceStorageConfig' {Text
InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
associationId :: Text
instanceId :: Text
$sel:resourceType:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> InstanceStorageResourceType
$sel:associationId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
$sel:instanceId:DisassociateInstanceStorageConfig' :: DisassociateInstanceStorageConfig -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"resourceType" ByteString -> InstanceStorageResourceType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: InstanceStorageResourceType
resourceType]

-- | /See:/ 'newDisassociateInstanceStorageConfigResponse' smart constructor.
data DisassociateInstanceStorageConfigResponse = DisassociateInstanceStorageConfigResponse'
  {
  }
  deriving (DisassociateInstanceStorageConfigResponse
-> DisassociateInstanceStorageConfigResponse -> Bool
(DisassociateInstanceStorageConfigResponse
 -> DisassociateInstanceStorageConfigResponse -> Bool)
-> (DisassociateInstanceStorageConfigResponse
    -> DisassociateInstanceStorageConfigResponse -> Bool)
-> Eq DisassociateInstanceStorageConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateInstanceStorageConfigResponse
-> DisassociateInstanceStorageConfigResponse -> Bool
$c/= :: DisassociateInstanceStorageConfigResponse
-> DisassociateInstanceStorageConfigResponse -> Bool
== :: DisassociateInstanceStorageConfigResponse
-> DisassociateInstanceStorageConfigResponse -> Bool
$c== :: DisassociateInstanceStorageConfigResponse
-> DisassociateInstanceStorageConfigResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateInstanceStorageConfigResponse]
ReadPrec DisassociateInstanceStorageConfigResponse
Int -> ReadS DisassociateInstanceStorageConfigResponse
ReadS [DisassociateInstanceStorageConfigResponse]
(Int -> ReadS DisassociateInstanceStorageConfigResponse)
-> ReadS [DisassociateInstanceStorageConfigResponse]
-> ReadPrec DisassociateInstanceStorageConfigResponse
-> ReadPrec [DisassociateInstanceStorageConfigResponse]
-> Read DisassociateInstanceStorageConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateInstanceStorageConfigResponse]
$creadListPrec :: ReadPrec [DisassociateInstanceStorageConfigResponse]
readPrec :: ReadPrec DisassociateInstanceStorageConfigResponse
$creadPrec :: ReadPrec DisassociateInstanceStorageConfigResponse
readList :: ReadS [DisassociateInstanceStorageConfigResponse]
$creadList :: ReadS [DisassociateInstanceStorageConfigResponse]
readsPrec :: Int -> ReadS DisassociateInstanceStorageConfigResponse
$creadsPrec :: Int -> ReadS DisassociateInstanceStorageConfigResponse
Prelude.Read, Int -> DisassociateInstanceStorageConfigResponse -> ShowS
[DisassociateInstanceStorageConfigResponse] -> ShowS
DisassociateInstanceStorageConfigResponse -> String
(Int -> DisassociateInstanceStorageConfigResponse -> ShowS)
-> (DisassociateInstanceStorageConfigResponse -> String)
-> ([DisassociateInstanceStorageConfigResponse] -> ShowS)
-> Show DisassociateInstanceStorageConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateInstanceStorageConfigResponse] -> ShowS
$cshowList :: [DisassociateInstanceStorageConfigResponse] -> ShowS
show :: DisassociateInstanceStorageConfigResponse -> String
$cshow :: DisassociateInstanceStorageConfigResponse -> String
showsPrec :: Int -> DisassociateInstanceStorageConfigResponse -> ShowS
$cshowsPrec :: Int -> DisassociateInstanceStorageConfigResponse -> ShowS
Prelude.Show, (forall x.
 DisassociateInstanceStorageConfigResponse
 -> Rep DisassociateInstanceStorageConfigResponse x)
-> (forall x.
    Rep DisassociateInstanceStorageConfigResponse x
    -> DisassociateInstanceStorageConfigResponse)
-> Generic DisassociateInstanceStorageConfigResponse
forall x.
Rep DisassociateInstanceStorageConfigResponse x
-> DisassociateInstanceStorageConfigResponse
forall x.
DisassociateInstanceStorageConfigResponse
-> Rep DisassociateInstanceStorageConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateInstanceStorageConfigResponse x
-> DisassociateInstanceStorageConfigResponse
$cfrom :: forall x.
DisassociateInstanceStorageConfigResponse
-> Rep DisassociateInstanceStorageConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateInstanceStorageConfigResponse' 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.
newDisassociateInstanceStorageConfigResponse ::
  DisassociateInstanceStorageConfigResponse
newDisassociateInstanceStorageConfigResponse :: DisassociateInstanceStorageConfigResponse
newDisassociateInstanceStorageConfigResponse =
  DisassociateInstanceStorageConfigResponse
DisassociateInstanceStorageConfigResponse'

instance
  Prelude.NFData
    DisassociateInstanceStorageConfigResponse