{-# 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 #-}
module Amazonka.CodeGuruReviewer.DisassociateRepository
(
DisassociateRepository (..),
newDisassociateRepository,
disassociateRepository_associationArn,
DisassociateRepositoryResponse (..),
newDisassociateRepositoryResponse,
disassociateRepositoryResponse_repositoryAssociation,
disassociateRepositoryResponse_tags,
disassociateRepositoryResponse_httpStatus,
)
where
import Amazonka.CodeGuruReviewer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisassociateRepository = DisassociateRepository'
{
DisassociateRepository -> Text
associationArn :: Prelude.Text
}
deriving (DisassociateRepository -> DisassociateRepository -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateRepository -> DisassociateRepository -> Bool
$c/= :: DisassociateRepository -> DisassociateRepository -> Bool
== :: DisassociateRepository -> DisassociateRepository -> Bool
$c== :: DisassociateRepository -> DisassociateRepository -> Bool
Prelude.Eq, ReadPrec [DisassociateRepository]
ReadPrec DisassociateRepository
Int -> ReadS DisassociateRepository
ReadS [DisassociateRepository]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateRepository]
$creadListPrec :: ReadPrec [DisassociateRepository]
readPrec :: ReadPrec DisassociateRepository
$creadPrec :: ReadPrec DisassociateRepository
readList :: ReadS [DisassociateRepository]
$creadList :: ReadS [DisassociateRepository]
readsPrec :: Int -> ReadS DisassociateRepository
$creadsPrec :: Int -> ReadS DisassociateRepository
Prelude.Read, Int -> DisassociateRepository -> ShowS
[DisassociateRepository] -> ShowS
DisassociateRepository -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateRepository] -> ShowS
$cshowList :: [DisassociateRepository] -> ShowS
show :: DisassociateRepository -> String
$cshow :: DisassociateRepository -> String
showsPrec :: Int -> DisassociateRepository -> ShowS
$cshowsPrec :: Int -> DisassociateRepository -> ShowS
Prelude.Show, forall x. Rep DisassociateRepository x -> DisassociateRepository
forall x. DisassociateRepository -> Rep DisassociateRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateRepository x -> DisassociateRepository
$cfrom :: forall x. DisassociateRepository -> Rep DisassociateRepository x
Prelude.Generic)
newDisassociateRepository ::
Prelude.Text ->
DisassociateRepository
newDisassociateRepository :: Text -> DisassociateRepository
newDisassociateRepository Text
pAssociationArn_ =
DisassociateRepository'
{ $sel:associationArn:DisassociateRepository' :: Text
associationArn =
Text
pAssociationArn_
}
disassociateRepository_associationArn :: Lens.Lens' DisassociateRepository Prelude.Text
disassociateRepository_associationArn :: Lens' DisassociateRepository Text
disassociateRepository_associationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRepository' {Text
associationArn :: Text
$sel:associationArn:DisassociateRepository' :: DisassociateRepository -> Text
associationArn} -> Text
associationArn) (\s :: DisassociateRepository
s@DisassociateRepository' {} Text
a -> DisassociateRepository
s {$sel:associationArn:DisassociateRepository' :: Text
associationArn = Text
a} :: DisassociateRepository)
instance Core.AWSRequest DisassociateRepository where
type
AWSResponse DisassociateRepository =
DisassociateRepositoryResponse
request :: (Service -> Service)
-> DisassociateRepository -> Request DisassociateRepository
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateRepository
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateRepository)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RepositoryAssociation
-> Maybe (HashMap Text Text)
-> Int
-> DisassociateRepositoryResponse
DisassociateRepositoryResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RepositoryAssociation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DisassociateRepository where
hashWithSalt :: Int -> DisassociateRepository -> Int
hashWithSalt Int
_salt DisassociateRepository' {Text
associationArn :: Text
$sel:associationArn:DisassociateRepository' :: DisassociateRepository -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
associationArn
instance Prelude.NFData DisassociateRepository where
rnf :: DisassociateRepository -> ()
rnf DisassociateRepository' {Text
associationArn :: Text
$sel:associationArn:DisassociateRepository' :: DisassociateRepository -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
associationArn
instance Data.ToHeaders DisassociateRepository where
toHeaders :: DisassociateRepository -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DisassociateRepository where
toPath :: DisassociateRepository -> ByteString
toPath DisassociateRepository' {Text
associationArn :: Text
$sel:associationArn:DisassociateRepository' :: DisassociateRepository -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/associations/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
associationArn]
instance Data.ToQuery DisassociateRepository where
toQuery :: DisassociateRepository -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateRepositoryResponse = DisassociateRepositoryResponse'
{
DisassociateRepositoryResponse -> Maybe RepositoryAssociation
repositoryAssociation :: Prelude.Maybe RepositoryAssociation,
DisassociateRepositoryResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DisassociateRepositoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool
$c/= :: DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool
== :: DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool
$c== :: DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateRepositoryResponse]
ReadPrec DisassociateRepositoryResponse
Int -> ReadS DisassociateRepositoryResponse
ReadS [DisassociateRepositoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateRepositoryResponse]
$creadListPrec :: ReadPrec [DisassociateRepositoryResponse]
readPrec :: ReadPrec DisassociateRepositoryResponse
$creadPrec :: ReadPrec DisassociateRepositoryResponse
readList :: ReadS [DisassociateRepositoryResponse]
$creadList :: ReadS [DisassociateRepositoryResponse]
readsPrec :: Int -> ReadS DisassociateRepositoryResponse
$creadsPrec :: Int -> ReadS DisassociateRepositoryResponse
Prelude.Read, Int -> DisassociateRepositoryResponse -> ShowS
[DisassociateRepositoryResponse] -> ShowS
DisassociateRepositoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateRepositoryResponse] -> ShowS
$cshowList :: [DisassociateRepositoryResponse] -> ShowS
show :: DisassociateRepositoryResponse -> String
$cshow :: DisassociateRepositoryResponse -> String
showsPrec :: Int -> DisassociateRepositoryResponse -> ShowS
$cshowsPrec :: Int -> DisassociateRepositoryResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateRepositoryResponse x
-> DisassociateRepositoryResponse
forall x.
DisassociateRepositoryResponse
-> Rep DisassociateRepositoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateRepositoryResponse x
-> DisassociateRepositoryResponse
$cfrom :: forall x.
DisassociateRepositoryResponse
-> Rep DisassociateRepositoryResponse x
Prelude.Generic)
newDisassociateRepositoryResponse ::
Prelude.Int ->
DisassociateRepositoryResponse
newDisassociateRepositoryResponse :: Int -> DisassociateRepositoryResponse
newDisassociateRepositoryResponse Int
pHttpStatus_ =
DisassociateRepositoryResponse'
{ $sel:repositoryAssociation:DisassociateRepositoryResponse' :: Maybe RepositoryAssociation
repositoryAssociation =
forall a. Maybe a
Prelude.Nothing,
$sel:tags:DisassociateRepositoryResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateRepositoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateRepositoryResponse_repositoryAssociation :: Lens.Lens' DisassociateRepositoryResponse (Prelude.Maybe RepositoryAssociation)
disassociateRepositoryResponse_repositoryAssociation :: Lens' DisassociateRepositoryResponse (Maybe RepositoryAssociation)
disassociateRepositoryResponse_repositoryAssociation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRepositoryResponse' {Maybe RepositoryAssociation
repositoryAssociation :: Maybe RepositoryAssociation
$sel:repositoryAssociation:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Maybe RepositoryAssociation
repositoryAssociation} -> Maybe RepositoryAssociation
repositoryAssociation) (\s :: DisassociateRepositoryResponse
s@DisassociateRepositoryResponse' {} Maybe RepositoryAssociation
a -> DisassociateRepositoryResponse
s {$sel:repositoryAssociation:DisassociateRepositoryResponse' :: Maybe RepositoryAssociation
repositoryAssociation = Maybe RepositoryAssociation
a} :: DisassociateRepositoryResponse)
disassociateRepositoryResponse_tags :: Lens.Lens' DisassociateRepositoryResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
disassociateRepositoryResponse_tags :: Lens' DisassociateRepositoryResponse (Maybe (HashMap Text Text))
disassociateRepositoryResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRepositoryResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: DisassociateRepositoryResponse
s@DisassociateRepositoryResponse' {} Maybe (HashMap Text Text)
a -> DisassociateRepositoryResponse
s {$sel:tags:DisassociateRepositoryResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: DisassociateRepositoryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
disassociateRepositoryResponse_httpStatus :: Lens.Lens' DisassociateRepositoryResponse Prelude.Int
disassociateRepositoryResponse_httpStatus :: Lens' DisassociateRepositoryResponse Int
disassociateRepositoryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRepositoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateRepositoryResponse
s@DisassociateRepositoryResponse' {} Int
a -> DisassociateRepositoryResponse
s {$sel:httpStatus:DisassociateRepositoryResponse' :: Int
httpStatus = Int
a} :: DisassociateRepositoryResponse)
instance
Prelude.NFData
DisassociateRepositoryResponse
where
rnf :: DisassociateRepositoryResponse -> ()
rnf DisassociateRepositoryResponse' {Int
Maybe (HashMap Text Text)
Maybe RepositoryAssociation
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
repositoryAssociation :: Maybe RepositoryAssociation
$sel:httpStatus:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Int
$sel:tags:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Maybe (HashMap Text Text)
$sel:repositoryAssociation:DisassociateRepositoryResponse' :: DisassociateRepositoryResponse -> Maybe RepositoryAssociation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RepositoryAssociation
repositoryAssociation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus