{-# 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.Lens as Lens
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
(DisassociateRepository -> DisassociateRepository -> Bool)
-> (DisassociateRepository -> DisassociateRepository -> Bool)
-> Eq DisassociateRepository
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]
(Int -> ReadS DisassociateRepository)
-> ReadS [DisassociateRepository]
-> ReadPrec DisassociateRepository
-> ReadPrec [DisassociateRepository]
-> Read 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
(Int -> DisassociateRepository -> ShowS)
-> (DisassociateRepository -> String)
-> ([DisassociateRepository] -> ShowS)
-> Show DisassociateRepository
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. DisassociateRepository -> Rep DisassociateRepository x)
-> (forall x.
Rep DisassociateRepository x -> DisassociateRepository)
-> Generic DisassociateRepository
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' :: Text -> DisassociateRepository
DisassociateRepository'
{ $sel:associationArn:DisassociateRepository' :: Text
associationArn =
Text
pAssociationArn_
}
disassociateRepository_associationArn :: Lens.Lens' DisassociateRepository Prelude.Text
disassociateRepository_associationArn :: (Text -> f Text)
-> DisassociateRepository -> f DisassociateRepository
disassociateRepository_associationArn = (DisassociateRepository -> Text)
-> (DisassociateRepository -> Text -> DisassociateRepository)
-> Lens DisassociateRepository DisassociateRepository Text Text
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 :: DisassociateRepository -> Request DisassociateRepository
request = Service -> DisassociateRepository -> Request DisassociateRepository
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateRepository
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateRepository)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateRepository))
-> Logger
-> Service
-> Proxy DisassociateRepository
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateRepository)))
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 RepositoryAssociation
-> Maybe (HashMap Text Text)
-> Int
-> DisassociateRepositoryResponse
DisassociateRepositoryResponse'
(Maybe RepositoryAssociation
-> Maybe (HashMap Text Text)
-> Int
-> DisassociateRepositoryResponse)
-> Either String (Maybe RepositoryAssociation)
-> Either
String
(Maybe (HashMap Text Text)
-> Int -> DisassociateRepositoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RepositoryAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RepositoryAssociation")
Either
String
(Maybe (HashMap Text Text)
-> Int -> DisassociateRepositoryResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> DisassociateRepositoryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DisassociateRepositoryResponse)
-> Either String Int
-> Either String DisassociateRepositoryResponse
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 DisassociateRepository
instance Prelude.NFData DisassociateRepository
instance Core.ToHeaders DisassociateRepository where
toHeaders :: DisassociateRepository -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateRepository -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DisassociateRepository where
toPath :: DisassociateRepository -> ByteString
toPath DisassociateRepository' {Text
associationArn :: Text
$sel:associationArn:DisassociateRepository' :: DisassociateRepository -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/associations/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
associationArn]
instance Core.ToQuery DisassociateRepository where
toQuery :: DisassociateRepository -> QueryString
toQuery = QueryString -> DisassociateRepository -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool)
-> (DisassociateRepositoryResponse
-> DisassociateRepositoryResponse -> Bool)
-> Eq DisassociateRepositoryResponse
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]
(Int -> ReadS DisassociateRepositoryResponse)
-> ReadS [DisassociateRepositoryResponse]
-> ReadPrec DisassociateRepositoryResponse
-> ReadPrec [DisassociateRepositoryResponse]
-> Read 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
(Int -> DisassociateRepositoryResponse -> ShowS)
-> (DisassociateRepositoryResponse -> String)
-> ([DisassociateRepositoryResponse] -> ShowS)
-> Show DisassociateRepositoryResponse
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.
DisassociateRepositoryResponse
-> Rep DisassociateRepositoryResponse x)
-> (forall x.
Rep DisassociateRepositoryResponse x
-> DisassociateRepositoryResponse)
-> Generic DisassociateRepositoryResponse
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' :: Maybe RepositoryAssociation
-> Maybe (HashMap Text Text)
-> Int
-> DisassociateRepositoryResponse
DisassociateRepositoryResponse'
{ $sel:repositoryAssociation:DisassociateRepositoryResponse' :: Maybe RepositoryAssociation
repositoryAssociation =
Maybe RepositoryAssociation
forall a. Maybe a
Prelude.Nothing,
$sel:tags:DisassociateRepositoryResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateRepositoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateRepositoryResponse_repositoryAssociation :: Lens.Lens' DisassociateRepositoryResponse (Prelude.Maybe RepositoryAssociation)
disassociateRepositoryResponse_repositoryAssociation :: (Maybe RepositoryAssociation -> f (Maybe RepositoryAssociation))
-> DisassociateRepositoryResponse
-> f DisassociateRepositoryResponse
disassociateRepositoryResponse_repositoryAssociation = (DisassociateRepositoryResponse -> Maybe RepositoryAssociation)
-> (DisassociateRepositoryResponse
-> Maybe RepositoryAssociation -> DisassociateRepositoryResponse)
-> Lens
DisassociateRepositoryResponse
DisassociateRepositoryResponse
(Maybe RepositoryAssociation)
(Maybe 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DisassociateRepositoryResponse
-> f DisassociateRepositoryResponse
disassociateRepositoryResponse_tags = (DisassociateRepositoryResponse -> Maybe (HashMap Text Text))
-> (DisassociateRepositoryResponse
-> Maybe (HashMap Text Text) -> DisassociateRepositoryResponse)
-> Lens
DisassociateRepositoryResponse
DisassociateRepositoryResponse
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DisassociateRepositoryResponse
-> f DisassociateRepositoryResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DisassociateRepositoryResponse
-> f DisassociateRepositoryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
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 :: (Int -> f Int)
-> DisassociateRepositoryResponse
-> f DisassociateRepositoryResponse
disassociateRepositoryResponse_httpStatus = (DisassociateRepositoryResponse -> Int)
-> (DisassociateRepositoryResponse
-> Int -> DisassociateRepositoryResponse)
-> Lens
DisassociateRepositoryResponse
DisassociateRepositoryResponse
Int
Int
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