-- Copyright (c) 2019  Herbert Valerio Riedel <hvr@gnu.org>
--
--  This file is free software: you may copy, redistribute and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation, either version 2 of the License, or (at your
--  option) any later version.
--
--  This file is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--  General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program (see `LICENSE`).  If not, see
--  <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>.

{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase                 #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE TypeOperators              #-}

-- | This module provides a pure Haskell implementation of the /Lightweight Directory Access Protocol (LDAP)/ version 3 as specified in <https://tools.ietf.org/html/rfc4511 RFC4511>.
--
-- Serializing and deserializing to and from the wire <https://en.wikipedia.org/wiki/ASN.1 ASN.1> encoding is provided via the 'Bin.Binary' instance of 'LDAPMessage'. For the purpose of implementing network clients and servers, the operations
--
-- * 'Bin.encode'
-- * 'Data.Binary.Get.runGetIncremental'
--
-- are most useful.
--
module LDAPv3
    ( -- * LDAPv3 Protocol data structures
      --
      -- | The Haskell data structures defined in this module closely follow the protocol specification as laid out in <https://tools.ietf.org/html/rfc4511 RFC4511>.
      --
      -- For convenience, the normative <https://en.wikipedia.org/wiki/ASN.1 ASN.1> definitions for each Haskell data type are quoted.

      -- ** Common Elements (<https://tools.ietf.org/html/rfc4511#section-4.1 RFC4511 Section 4.1>)

      -- 4.1.1.  Message Envelope
      LDAPMessage(..)
    , MessageID(..)
    , MaxInt
    , ProtocolOp(..)

      -- 4.1.2.  String Types
    , LDAPString
    , LDAPOID
      -- 4.1.3.  Distinguished Name and Relative Distinguished Name
    , LDAPDN
    , RelativeLDAPDN
      -- 4.1.4.  Attribute Descriptions
    , AttributeDescription
      -- 4.1.5.  Attribute Value
    , AttributeValue
      -- 4.1.6.  Attribute Value Assertion
    , AttributeValueAssertion(..)
    , AssertionValue
      -- 4.1.7.  Attribute and PartialAttribute
    , PartialAttribute(..)
    , Attribute(..)
      -- 4.1.8.  Matching Rule Identifier
    , MatchingRuleId
      -- 4.1.9.  Result Message
    , LDAPResult(..)
    , ResultCode(..)
      -- 4.1.10.  Referral
    , Referral
    , URI
      -- 4.1.11.  Controls
    , Controls
    , Control(..)

      -- ** Bind Operation  (<https://tools.ietf.org/html/rfc4511#section-4.2 RFC4511 Section 4.2>)

    , BindRequest(..)
    , AuthenticationChoice(..)
    , SaslCredentials(..)
    , BindResponse(..)

      -- ** Unbind Operation  (<https://tools.ietf.org/html/rfc4511#section-4.3 RFC4511 Section 4.3>)

    , UnbindRequest

      -- ** Unsolicited Notification  (<https://tools.ietf.org/html/rfc4511#section-4.4 RFC4511 Section 4.4>)
      --
      -- | Unsolicited notifications are represented by an 'ExtendedResponse' message with its 'MessageID' set to @0@.

      -- ** Search Operation  (<https://tools.ietf.org/html/rfc4511#section-4.5 RFC4511 Section 4.5>)

    , SearchRequest(..)
    , Scope(..)
    , DerefAliases(..)
    , AttributeSelection
    , Filter(..)
    , SubstringFilter(..)
    , Substring(..)
    , MatchingRuleAssertion(..)

      -- *** Search Result   (<https://tools.ietf.org/html/rfc4511#section-4.5.2 RFC4511 Section 4.5.2>)

    , SearchResultEntry(..)
    , PartialAttributeList
    , SearchResultReference(..)
    , SearchResultDone

      -- ** Modify Operation   (<https://tools.ietf.org/html/rfc4511#section-4.6 RFC4511 Section 4.6>)

    , ModifyRequest(..)
    , Change(..)
    , Operation(..)
    , ModifyResponse

      -- ** Add Operation   (<https://tools.ietf.org/html/rfc4511#section-4.7 RFC4511 Section 4.7>)

    , AddRequest(..)
    , AttributeList
    , AddResponse

      -- ** Delete Operation   (<https://tools.ietf.org/html/rfc4511#section-4.8 RFC4511 Section 4.8>)

    , DelRequest
    , DelResponse

      -- ** Modify DN Operation   (<https://tools.ietf.org/html/rfc4511#section-4.9 RFC4511 Section 4.9>)

    , ModifyDNRequest(..)
    , ModifyDNResponse

      -- ** Compare Operation   (<https://tools.ietf.org/html/rfc4511#section-4.10 RFC4511 Section 4.10>)

    , CompareRequest(..)
    , CompareResponse

      -- ** Abandon Operation   (<https://tools.ietf.org/html/rfc4511#section-4.11 RFC4511 Section 4.11>)

    , AbandonRequest

      -- ** Extended Operation   (<https://tools.ietf.org/html/rfc4511#section-4.12 RFC4511 Section 4.12>)

    , ExtendedRequest(..)
    , ExtendedResponse(..)

      -- ** Intermediate Response  (<https://tools.ietf.org/html/rfc4511#section-4.13 RFC4511 Section 4.13>)

    , IntermediateResponse(..)

      -- * ASN.1 Helpers
    , NULL
    , OCTET_STRING
    , BOOLEAN_DEFAULT_FALSE(..)
    , SET(..)
    , SET1(..)

      -- ** ASN.1 type-level tagging
    , EXPLICIT(..)
    , IMPLICIT(..)
    , TagK(..)

      -- * Unsigned integer sub-type
    , UIntBounds
    , UInt
    , fromUInt
    , toUInt
    ) where

import           Common
import           Data.ASN1
import           Data.ASN1.Prim
import           Data.Int.Subtypes
import           LDAPv3.ResultCode

import qualified Data.Binary       as Bin

----------------------------------------------------------------------------
-- LDAPv3 protocol

{- | Message Envelope (<https://tools.ietf.org/html/rfc4511#section-4.1.1 RFC4511 Section 4.1.1>)

> LDAPMessage ::= SEQUENCE {
>      messageID       MessageID,
>      protocolOp      CHOICE {
>           bindRequest           BindRequest,
>           bindResponse          BindResponse,
>           unbindRequest         UnbindRequest,
>           searchRequest         SearchRequest,
>           searchResEntry        SearchResultEntry,
>           searchResDone         SearchResultDone,
>           searchResRef          SearchResultReference,
>           modifyRequest         ModifyRequest,
>           modifyResponse        ModifyResponse,
>           addRequest            AddRequest,
>           addResponse           AddResponse,
>           delRequest            DelRequest,
>           delResponse           DelResponse,
>           modDNRequest          ModifyDNRequest,
>           modDNResponse         ModifyDNResponse,
>           compareRequest        CompareRequest,
>           compareResponse       CompareResponse,
>           abandonRequest        AbandonRequest,
>           extendedReq           ExtendedRequest,
>           extendedResp          ExtendedResponse,
>           ...,
>           intermediateResponse  IntermediateResponse },
>      controls       [0] Controls OPTIONAL }

-}
data LDAPMessage = LDAPMessage
  { LDAPMessage -> MessageID
_LDAPMessage'messageID  :: MessageID
  , LDAPMessage -> ProtocolOp
_LDAPMessage'protocolOp :: ProtocolOp
  , LDAPMessage -> Maybe (IMPLICIT ('CONTEXTUAL 0) Controls)
_LDAPMessage'controls   :: Maybe ('CONTEXTUAL 0 `IMPLICIT` Controls)
  } deriving ((forall x. LDAPMessage -> Rep LDAPMessage x)
-> (forall x. Rep LDAPMessage x -> LDAPMessage)
-> Generic LDAPMessage
forall x. Rep LDAPMessage x -> LDAPMessage
forall x. LDAPMessage -> Rep LDAPMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LDAPMessage x -> LDAPMessage
$cfrom :: forall x. LDAPMessage -> Rep LDAPMessage x
Generic,Int -> LDAPMessage -> ShowS
[LDAPMessage] -> ShowS
LDAPMessage -> String
(Int -> LDAPMessage -> ShowS)
-> (LDAPMessage -> String)
-> ([LDAPMessage] -> ShowS)
-> Show LDAPMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LDAPMessage] -> ShowS
$cshowList :: [LDAPMessage] -> ShowS
show :: LDAPMessage -> String
$cshow :: LDAPMessage -> String
showsPrec :: Int -> LDAPMessage -> ShowS
$cshowsPrec :: Int -> LDAPMessage -> ShowS
Show,LDAPMessage -> LDAPMessage -> Bool
(LDAPMessage -> LDAPMessage -> Bool)
-> (LDAPMessage -> LDAPMessage -> Bool) -> Eq LDAPMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LDAPMessage -> LDAPMessage -> Bool
$c/= :: LDAPMessage -> LDAPMessage -> Bool
== :: LDAPMessage -> LDAPMessage -> Bool
$c== :: LDAPMessage -> LDAPMessage -> Bool
Eq)

-- | Encodes to\/from ASN.1 as per <https://tools.ietf.org/html/rfc4511#section-5.1 RFC4511 Section 5.1>
instance Bin.Binary LDAPMessage where
  put :: LDAPMessage -> Put
put = PutM Word64 -> Put
forall (f :: * -> *) a. Functor f => f a -> f ()
void (PutM Word64 -> Put)
-> (LDAPMessage -> PutM Word64) -> LDAPMessage -> Put
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ASN1Encode Word64 -> PutM Word64
forall a. ASN1Encode a -> PutM a
toBinaryPut (ASN1Encode Word64 -> PutM Word64)
-> (LDAPMessage -> ASN1Encode Word64) -> LDAPMessage -> PutM Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LDAPMessage -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode
  get :: Get LDAPMessage
get = ASN1Decode LDAPMessage -> Get LDAPMessage
forall x. ASN1Decode x -> Get x
toBinaryGet ASN1Decode LDAPMessage
forall t. ASN1 t => ASN1Decode t
asn1decode

instance ASN1 LDAPMessage where
  asn1decodeCompOf :: ASN1Decode LDAPMessage
asn1decodeCompOf = MessageID
-> ProtocolOp
-> Maybe (IMPLICIT ('CONTEXTUAL 0) Controls)
-> LDAPMessage
LDAPMessage (MessageID
 -> ProtocolOp
 -> Maybe (IMPLICIT ('CONTEXTUAL 0) Controls)
 -> LDAPMessage)
-> ASN1Decode MessageID
-> ASN1Decode
     (ProtocolOp
      -> Maybe (IMPLICIT ('CONTEXTUAL 0) Controls) -> LDAPMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode MessageID
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (ProtocolOp
   -> Maybe (IMPLICIT ('CONTEXTUAL 0) Controls) -> LDAPMessage)
-> ASN1Decode ProtocolOp
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 0) Controls) -> LDAPMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode ProtocolOp
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 0) Controls) -> LDAPMessage)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) Controls))
-> ASN1Decode LDAPMessage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) Controls))
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: LDAPMessage -> ASN1Encode Word64
asn1encodeCompOf (LDAPMessage v1 :: MessageID
v1 v2 :: ProtocolOp
v2 v3 :: Maybe (IMPLICIT ('CONTEXTUAL 0) Controls)
v3) = (MessageID, ProtocolOp, Maybe (IMPLICIT ('CONTEXTUAL 0) Controls))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (MessageID
v1,ProtocolOp
v2,Maybe (IMPLICIT ('CONTEXTUAL 0) Controls)
v3)

{- | Message ID (<https://tools.ietf.org/html/rfc4511#section-4.1.1.1 RFC4511 Section 4.1.1.1>)

> MessageID ::= INTEGER (0 ..  maxInt)

-}
newtype MessageID = MessageID (UInt 0 MaxInt Int32)
                  deriving ((forall x. MessageID -> Rep MessageID x)
-> (forall x. Rep MessageID x -> MessageID) -> Generic MessageID
forall x. Rep MessageID x -> MessageID
forall x. MessageID -> Rep MessageID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageID x -> MessageID
$cfrom :: forall x. MessageID -> Rep MessageID x
Generic,MessageID -> ()
(MessageID -> ()) -> NFData MessageID
forall a. (a -> ()) -> NFData a
rnf :: MessageID -> ()
$crnf :: MessageID -> ()
NFData,Eq MessageID
Eq MessageID =>
(MessageID -> MessageID -> Ordering)
-> (MessageID -> MessageID -> Bool)
-> (MessageID -> MessageID -> Bool)
-> (MessageID -> MessageID -> Bool)
-> (MessageID -> MessageID -> Bool)
-> (MessageID -> MessageID -> MessageID)
-> (MessageID -> MessageID -> MessageID)
-> Ord MessageID
MessageID -> MessageID -> Bool
MessageID -> MessageID -> Ordering
MessageID -> MessageID -> MessageID
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MessageID -> MessageID -> MessageID
$cmin :: MessageID -> MessageID -> MessageID
max :: MessageID -> MessageID -> MessageID
$cmax :: MessageID -> MessageID -> MessageID
>= :: MessageID -> MessageID -> Bool
$c>= :: MessageID -> MessageID -> Bool
> :: MessageID -> MessageID -> Bool
$c> :: MessageID -> MessageID -> Bool
<= :: MessageID -> MessageID -> Bool
$c<= :: MessageID -> MessageID -> Bool
< :: MessageID -> MessageID -> Bool
$c< :: MessageID -> MessageID -> Bool
compare :: MessageID -> MessageID -> Ordering
$ccompare :: MessageID -> MessageID -> Ordering
$cp1Ord :: Eq MessageID
Ord,MessageID
MessageID -> MessageID -> Bounded MessageID
forall a. a -> a -> Bounded a
maxBound :: MessageID
$cmaxBound :: MessageID
minBound :: MessageID
$cminBound :: MessageID
Bounded,ASN1Decode MessageID
Proxy MessageID -> Tag
ASN1Decode MessageID
-> ASN1Decode MessageID
-> (MessageID -> ASN1Encode Word64)
-> (MessageID -> ASN1Encode Word64)
-> (Proxy MessageID -> Tag)
-> ASN1 MessageID
MessageID -> ASN1Encode Word64
forall t.
ASN1Decode t
-> ASN1Decode t
-> (t -> ASN1Encode Word64)
-> (t -> ASN1Encode Word64)
-> (Proxy t -> Tag)
-> ASN1 t
asn1defTag :: Proxy MessageID -> Tag
$casn1defTag :: Proxy MessageID -> Tag
asn1encodeCompOf :: MessageID -> ASN1Encode Word64
$casn1encodeCompOf :: MessageID -> ASN1Encode Word64
asn1encode :: MessageID -> ASN1Encode Word64
$casn1encode :: MessageID -> ASN1Encode Word64
asn1decodeCompOf :: ASN1Decode MessageID
$casn1decodeCompOf :: ASN1Decode MessageID
asn1decode :: ASN1Decode MessageID
$casn1decode :: ASN1Decode MessageID
ASN1,Int -> MessageID -> ShowS
[MessageID] -> ShowS
MessageID -> String
(Int -> MessageID -> ShowS)
-> (MessageID -> String)
-> ([MessageID] -> ShowS)
-> Show MessageID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageID] -> ShowS
$cshowList :: [MessageID] -> ShowS
show :: MessageID -> String
$cshow :: MessageID -> String
showsPrec :: Int -> MessageID -> ShowS
$cshowsPrec :: Int -> MessageID -> ShowS
Show,MessageID -> MessageID -> Bool
(MessageID -> MessageID -> Bool)
-> (MessageID -> MessageID -> Bool) -> Eq MessageID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageID -> MessageID -> Bool
$c/= :: MessageID -> MessageID -> Bool
== :: MessageID -> MessageID -> Bool
$c== :: MessageID -> MessageID -> Bool
Eq)

{- | LDAPv3 protocol ASN.1 constant as per <https://tools.ietf.org/html/rfc4511#section-4.1.1 RFC4511 Section 4.1.1>

> maxInt INTEGER ::= 2147483647 -- (2^^31 - 1)

-}
type MaxInt = 2147483647

-- | @CHOICE@ type inlined in @LDAPMessage.protocolOp@  (<https://tools.ietf.org/html/rfc4511#section-4.1.1 RFC4511 Section 4.1.1>)
--
data ProtocolOp
  = ProtocolOp'bindRequest     BindRequest
  | ProtocolOp'bindResponse    BindResponse
  | ProtocolOp'unbindRequest   UnbindRequest
  | ProtocolOp'searchRequest   SearchRequest
  | ProtocolOp'searchResEntry  SearchResultEntry
  | ProtocolOp'searchResDone   SearchResultDone
  | ProtocolOp'searchResRef    SearchResultReference
  | ProtocolOp'modifyRequest   ModifyRequest
  | ProtocolOp'modifyResponse  ModifyResponse
  | ProtocolOp'addRequest      AddRequest
  | ProtocolOp'addResponse     AddResponse
  | ProtocolOp'delRequest      DelRequest
  | ProtocolOp'delResponse     DelResponse
  | ProtocolOp'modDNRequest    ModifyDNRequest
  | ProtocolOp'modDNResponse   ModifyDNResponse
  | ProtocolOp'compareRequest  CompareRequest
  | ProtocolOp'compareResponse CompareResponse
  | ProtocolOp'abandonRequest  AbandonRequest
  | ProtocolOp'extendedReq     ExtendedRequest
  | ProtocolOp'extendedResp    ExtendedResponse
  | ProtocolOp'intermediateResponse  IntermediateResponse
  deriving ((forall x. ProtocolOp -> Rep ProtocolOp x)
-> (forall x. Rep ProtocolOp x -> ProtocolOp) -> Generic ProtocolOp
forall x. Rep ProtocolOp x -> ProtocolOp
forall x. ProtocolOp -> Rep ProtocolOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProtocolOp x -> ProtocolOp
$cfrom :: forall x. ProtocolOp -> Rep ProtocolOp x
Generic,Int -> ProtocolOp -> ShowS
[ProtocolOp] -> ShowS
ProtocolOp -> String
(Int -> ProtocolOp -> ShowS)
-> (ProtocolOp -> String)
-> ([ProtocolOp] -> ShowS)
-> Show ProtocolOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtocolOp] -> ShowS
$cshowList :: [ProtocolOp] -> ShowS
show :: ProtocolOp -> String
$cshow :: ProtocolOp -> String
showsPrec :: Int -> ProtocolOp -> ShowS
$cshowsPrec :: Int -> ProtocolOp -> ShowS
Show,ProtocolOp -> ProtocolOp -> Bool
(ProtocolOp -> ProtocolOp -> Bool)
-> (ProtocolOp -> ProtocolOp -> Bool) -> Eq ProtocolOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtocolOp -> ProtocolOp -> Bool
$c/= :: ProtocolOp -> ProtocolOp -> Bool
== :: ProtocolOp -> ProtocolOp -> Bool
$c== :: ProtocolOp -> ProtocolOp -> Bool
Eq)

instance NFData ProtocolOp

instance ASN1 ProtocolOp where
  asn1decode :: ASN1Decode ProtocolOp
asn1decode = [ASN1Decode ProtocolOp] -> ASN1Decode ProtocolOp
forall x. [ASN1Decode x] -> ASN1Decode x
with'CHOICE
    [ BindRequest -> ProtocolOp
ProtocolOp'bindRequest    (BindRequest -> ProtocolOp)
-> ASN1Decode BindRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode BindRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , BindResponse -> ProtocolOp
ProtocolOp'bindResponse   (BindResponse -> ProtocolOp)
-> ASN1Decode BindResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode BindResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , UnbindRequest -> ProtocolOp
ProtocolOp'unbindRequest  (UnbindRequest -> ProtocolOp)
-> ASN1Decode UnbindRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode UnbindRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , SearchRequest -> ProtocolOp
ProtocolOp'searchRequest  (SearchRequest -> ProtocolOp)
-> ASN1Decode SearchRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode SearchRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , SearchResultEntry -> ProtocolOp
ProtocolOp'searchResEntry (SearchResultEntry -> ProtocolOp)
-> ASN1Decode SearchResultEntry -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode SearchResultEntry
forall t. ASN1 t => ASN1Decode t
asn1decode
    , SearchResultDone -> ProtocolOp
ProtocolOp'searchResDone  (SearchResultDone -> ProtocolOp)
-> ASN1Decode SearchResultDone -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode SearchResultDone
forall t. ASN1 t => ASN1Decode t
asn1decode
    , SearchResultReference -> ProtocolOp
ProtocolOp'searchResRef   (SearchResultReference -> ProtocolOp)
-> ASN1Decode SearchResultReference -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode SearchResultReference
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ModifyRequest -> ProtocolOp
ProtocolOp'modifyRequest  (ModifyRequest -> ProtocolOp)
-> ASN1Decode ModifyRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ModifyRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ModifyResponse -> ProtocolOp
ProtocolOp'modifyResponse (ModifyResponse -> ProtocolOp)
-> ASN1Decode ModifyResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ModifyResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , AddRequest -> ProtocolOp
ProtocolOp'addRequest     (AddRequest -> ProtocolOp)
-> ASN1Decode AddRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode AddRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , AddResponse -> ProtocolOp
ProtocolOp'addResponse    (AddResponse -> ProtocolOp)
-> ASN1Decode AddResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode AddResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , DelRequest -> ProtocolOp
ProtocolOp'delRequest     (DelRequest -> ProtocolOp)
-> ASN1Decode DelRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode DelRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , DelResponse -> ProtocolOp
ProtocolOp'delResponse    (DelResponse -> ProtocolOp)
-> ASN1Decode DelResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode DelResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ModifyDNRequest -> ProtocolOp
ProtocolOp'modDNRequest   (ModifyDNRequest -> ProtocolOp)
-> ASN1Decode ModifyDNRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ModifyDNRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ModifyDNResponse -> ProtocolOp
ProtocolOp'modDNResponse  (ModifyDNResponse -> ProtocolOp)
-> ASN1Decode ModifyDNResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ModifyDNResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , CompareRequest -> ProtocolOp
ProtocolOp'compareRequest (CompareRequest -> ProtocolOp)
-> ASN1Decode CompareRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode CompareRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , CompareResponse -> ProtocolOp
ProtocolOp'compareResponse (CompareResponse -> ProtocolOp)
-> ASN1Decode CompareResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode CompareResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , AbandonRequest -> ProtocolOp
ProtocolOp'abandonRequest (AbandonRequest -> ProtocolOp)
-> ASN1Decode AbandonRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode AbandonRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ExtendedRequest -> ProtocolOp
ProtocolOp'extendedReq    (ExtendedRequest -> ProtocolOp)
-> ASN1Decode ExtendedRequest -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ExtendedRequest
forall t. ASN1 t => ASN1Decode t
asn1decode
    , ExtendedResponse -> ProtocolOp
ProtocolOp'extendedResp   (ExtendedResponse -> ProtocolOp)
-> ASN1Decode ExtendedResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode ExtendedResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IntermediateResponse -> ProtocolOp
ProtocolOp'intermediateResponse (IntermediateResponse -> ProtocolOp)
-> ASN1Decode IntermediateResponse -> ASN1Decode ProtocolOp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode IntermediateResponse
forall t. ASN1 t => ASN1Decode t
asn1decode
    ]

  asn1encode :: ProtocolOp -> ASN1Encode Word64
asn1encode = \case
    ProtocolOp'bindRequest    v :: BindRequest
v -> BindRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode BindRequest
v
    ProtocolOp'bindResponse   v :: BindResponse
v -> BindResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode BindResponse
v
    ProtocolOp'unbindRequest  v :: UnbindRequest
v -> UnbindRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode UnbindRequest
v
    ProtocolOp'searchRequest  v :: SearchRequest
v -> SearchRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode SearchRequest
v
    ProtocolOp'searchResEntry v :: SearchResultEntry
v -> SearchResultEntry -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode SearchResultEntry
v
    ProtocolOp'searchResDone  v :: SearchResultDone
v -> SearchResultDone -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode SearchResultDone
v
    ProtocolOp'searchResRef   v :: SearchResultReference
v -> SearchResultReference -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode SearchResultReference
v
    ProtocolOp'modifyRequest  v :: ModifyRequest
v -> ModifyRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ModifyRequest
v
    ProtocolOp'modifyResponse v :: ModifyResponse
v -> ModifyResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ModifyResponse
v
    ProtocolOp'addRequest     v :: AddRequest
v -> AddRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode AddRequest
v
    ProtocolOp'addResponse    v :: AddResponse
v -> AddResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode AddResponse
v
    ProtocolOp'delRequest     v :: DelRequest
v -> DelRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode DelRequest
v
    ProtocolOp'delResponse    v :: DelResponse
v -> DelResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode DelResponse
v
    ProtocolOp'modDNRequest   v :: ModifyDNRequest
v -> ModifyDNRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ModifyDNRequest
v
    ProtocolOp'modDNResponse  v :: ModifyDNResponse
v -> ModifyDNResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ModifyDNResponse
v
    ProtocolOp'compareRequest v :: CompareRequest
v -> CompareRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode CompareRequest
v
    ProtocolOp'compareResponse v :: CompareResponse
v -> CompareResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode CompareResponse
v
    ProtocolOp'abandonRequest v :: AbandonRequest
v -> AbandonRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode AbandonRequest
v
    ProtocolOp'extendedReq    v :: ExtendedRequest
v -> ExtendedRequest -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ExtendedRequest
v
    ProtocolOp'extendedResp   v :: ExtendedResponse
v -> ExtendedResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode ExtendedResponse
v
    ProtocolOp'intermediateResponse v :: IntermediateResponse
v -> IntermediateResponse -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IntermediateResponse
v

----------------------------------------------------------------------------

{- | Controls  (<https://tools.ietf.org/html/rfc4511#section-4.1.11 RFC4511 Section 4.1.11>)

> Controls ::= SEQUENCE OF control Control

-}
type Controls = [Control]

{- | Control Entry  (<https://tools.ietf.org/html/rfc4511#section-4.1.11 RFC4511 Section 4.1.11>)

> Control ::= SEQUENCE {
>      controlType             LDAPOID,
>      criticality             BOOLEAN DEFAULT FALSE,
>      controlValue            OCTET STRING OPTIONAL }

-}
data Control = Control
  { Control -> LDAPOID
_Control'controlType  :: LDAPOID
  , Control -> Maybe BOOLEAN_DEFAULT_FALSE
_Control'criticality  :: Maybe BOOLEAN_DEFAULT_FALSE
  , Control -> Maybe LDAPOID
_Control'controlValue :: Maybe OCTET_STRING
  } deriving ((forall x. Control -> Rep Control x)
-> (forall x. Rep Control x -> Control) -> Generic Control
forall x. Rep Control x -> Control
forall x. Control -> Rep Control x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Control x -> Control
$cfrom :: forall x. Control -> Rep Control x
Generic,Int -> Control -> ShowS
Controls -> ShowS
Control -> String
(Int -> Control -> ShowS)
-> (Control -> String) -> (Controls -> ShowS) -> Show Control
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: Controls -> ShowS
$cshowList :: Controls -> ShowS
show :: Control -> String
$cshow :: Control -> String
showsPrec :: Int -> Control -> ShowS
$cshowsPrec :: Int -> Control -> ShowS
Show,Control -> Control -> Bool
(Control -> Control -> Bool)
-> (Control -> Control -> Bool) -> Eq Control
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Control -> Control -> Bool
$c/= :: Control -> Control -> Bool
== :: Control -> Control -> Bool
$c== :: Control -> Control -> Bool
Eq)

instance NFData Control

instance ASN1 Control where
  asn1decodeCompOf :: ASN1Decode Control
asn1decodeCompOf = LDAPOID -> Maybe BOOLEAN_DEFAULT_FALSE -> Maybe LDAPOID -> Control
Control (LDAPOID
 -> Maybe BOOLEAN_DEFAULT_FALSE -> Maybe LDAPOID -> Control)
-> ASN1Decode LDAPOID
-> ASN1Decode
     (Maybe BOOLEAN_DEFAULT_FALSE -> Maybe LDAPOID -> Control)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPOID
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe BOOLEAN_DEFAULT_FALSE -> Maybe LDAPOID -> Control)
-> ASN1Decode (Maybe BOOLEAN_DEFAULT_FALSE)
-> ASN1Decode (Maybe LDAPOID -> Control)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe BOOLEAN_DEFAULT_FALSE)
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (Maybe LDAPOID -> Control)
-> ASN1Decode (Maybe LDAPOID) -> ASN1Decode Control
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: Control -> ASN1Encode Word64
asn1encodeCompOf (Control v1 :: LDAPOID
v1 v2 :: Maybe BOOLEAN_DEFAULT_FALSE
v2 v3 :: Maybe LDAPOID
v3) = (LDAPOID, Maybe BOOLEAN_DEFAULT_FALSE, Maybe LDAPOID)
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPOID
v1,Maybe BOOLEAN_DEFAULT_FALSE
v2,Maybe LDAPOID
v3)

{- | Object identifier  (<https://tools.ietf.org/html/rfc4511#section-4.1.2 RFC4511 Section 4.1.2>)

> LDAPOID ::= OCTET STRING -- Constrained to <numericoid>
>                          -- [RFC4512]

-}
type LDAPOID = OCTET_STRING

----------------------------------------------------------------------------

{- | Bind Request  (<https://tools.ietf.org/html/rfc4511#section-4.2 RFC4511 Section 4.2>)

> BindRequest ::= [APPLICATION 0] SEQUENCE {
>      version                 INTEGER (1 ..  127),
>      name                    LDAPDN,
>      authentication          AuthenticationChoice }

-}

data BindRequest = BindRequest
  { BindRequest -> UInt 1 127 Int8
bindRequest'version        :: UInt 1 127 Int8
  , BindRequest -> LDAPDN
bindRequest'name           :: LDAPDN
  , BindRequest -> AuthenticationChoice
bindRequest'authentication :: AuthenticationChoice
  } deriving ((forall x. BindRequest -> Rep BindRequest x)
-> (forall x. Rep BindRequest x -> BindRequest)
-> Generic BindRequest
forall x. Rep BindRequest x -> BindRequest
forall x. BindRequest -> Rep BindRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BindRequest x -> BindRequest
$cfrom :: forall x. BindRequest -> Rep BindRequest x
Generic,Int -> BindRequest -> ShowS
[BindRequest] -> ShowS
BindRequest -> String
(Int -> BindRequest -> ShowS)
-> (BindRequest -> String)
-> ([BindRequest] -> ShowS)
-> Show BindRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BindRequest] -> ShowS
$cshowList :: [BindRequest] -> ShowS
show :: BindRequest -> String
$cshow :: BindRequest -> String
showsPrec :: Int -> BindRequest -> ShowS
$cshowsPrec :: Int -> BindRequest -> ShowS
Show,BindRequest -> BindRequest -> Bool
(BindRequest -> BindRequest -> Bool)
-> (BindRequest -> BindRequest -> Bool) -> Eq BindRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BindRequest -> BindRequest -> Bool
$c/= :: BindRequest -> BindRequest -> Bool
== :: BindRequest -> BindRequest -> Bool
$c== :: BindRequest -> BindRequest -> Bool
Eq)

instance NFData BindRequest

instance ASN1 BindRequest where
  asn1defTag :: Proxy BindRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 0
  asn1decodeCompOf :: ASN1Decode BindRequest
asn1decodeCompOf = UInt 1 127 Int8 -> LDAPDN -> AuthenticationChoice -> BindRequest
BindRequest (UInt 1 127 Int8 -> LDAPDN -> AuthenticationChoice -> BindRequest)
-> ASN1Decode (UInt 1 127 Int8)
-> ASN1Decode (LDAPDN -> AuthenticationChoice -> BindRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (UInt 1 127 Int8)
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (LDAPDN -> AuthenticationChoice -> BindRequest)
-> ASN1Decode LDAPDN
-> ASN1Decode (AuthenticationChoice -> BindRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (AuthenticationChoice -> BindRequest)
-> ASN1Decode AuthenticationChoice -> ASN1Decode BindRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode AuthenticationChoice
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: BindRequest -> ASN1Encode Word64
asn1encodeCompOf (BindRequest v1 :: UInt 1 127 Int8
v1 v2 :: LDAPDN
v2 v3 :: AuthenticationChoice
v3) = (UInt 1 127 Int8, LDAPDN, AuthenticationChoice)
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (UInt 1 127 Int8
v1,LDAPDN
v2,AuthenticationChoice
v3)

----------------------------------------------------------------------------

{- | See 'BindRequest'

> AuthenticationChoice ::= CHOICE {
>      simple                  [0] OCTET STRING,
>                              -- 1 and 2 reserved
>      sasl                    [3] SaslCredentials,
>      ...  }

-}
data AuthenticationChoice
  = AuthenticationChoice'simple  ('CONTEXTUAL 0 `IMPLICIT` OCTET_STRING)
  | AuthenticationChoice'sasl    ('CONTEXTUAL 3 `IMPLICIT` SaslCredentials)
  deriving ((forall x. AuthenticationChoice -> Rep AuthenticationChoice x)
-> (forall x. Rep AuthenticationChoice x -> AuthenticationChoice)
-> Generic AuthenticationChoice
forall x. Rep AuthenticationChoice x -> AuthenticationChoice
forall x. AuthenticationChoice -> Rep AuthenticationChoice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthenticationChoice x -> AuthenticationChoice
$cfrom :: forall x. AuthenticationChoice -> Rep AuthenticationChoice x
Generic,Int -> AuthenticationChoice -> ShowS
[AuthenticationChoice] -> ShowS
AuthenticationChoice -> String
(Int -> AuthenticationChoice -> ShowS)
-> (AuthenticationChoice -> String)
-> ([AuthenticationChoice] -> ShowS)
-> Show AuthenticationChoice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationChoice] -> ShowS
$cshowList :: [AuthenticationChoice] -> ShowS
show :: AuthenticationChoice -> String
$cshow :: AuthenticationChoice -> String
showsPrec :: Int -> AuthenticationChoice -> ShowS
$cshowsPrec :: Int -> AuthenticationChoice -> ShowS
Show,AuthenticationChoice -> AuthenticationChoice -> Bool
(AuthenticationChoice -> AuthenticationChoice -> Bool)
-> (AuthenticationChoice -> AuthenticationChoice -> Bool)
-> Eq AuthenticationChoice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationChoice -> AuthenticationChoice -> Bool
$c/= :: AuthenticationChoice -> AuthenticationChoice -> Bool
== :: AuthenticationChoice -> AuthenticationChoice -> Bool
$c== :: AuthenticationChoice -> AuthenticationChoice -> Bool
Eq)

instance NFData AuthenticationChoice

instance ASN1 AuthenticationChoice where
  asn1decode :: ASN1Decode AuthenticationChoice
asn1decode = [ASN1Decode AuthenticationChoice]
-> ASN1Decode AuthenticationChoice
forall x. [ASN1Decode x] -> ASN1Decode x
with'CHOICE
    [ IMPLICIT ('CONTEXTUAL 0) LDAPOID -> AuthenticationChoice
AuthenticationChoice'simple (IMPLICIT ('CONTEXTUAL 0) LDAPOID -> AuthenticationChoice)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
-> ASN1Decode AuthenticationChoice
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 3) SaslCredentials -> AuthenticationChoice
AuthenticationChoice'sasl   (IMPLICIT ('CONTEXTUAL 3) SaslCredentials -> AuthenticationChoice)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) SaslCredentials)
-> ASN1Decode AuthenticationChoice
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) SaslCredentials)
forall t. ASN1 t => ASN1Decode t
asn1decode
    ]

  asn1encode :: AuthenticationChoice -> ASN1Encode Word64
asn1encode = \case
    AuthenticationChoice'simple v :: IMPLICIT ('CONTEXTUAL 0) LDAPOID
v -> IMPLICIT ('CONTEXTUAL 0) LDAPOID -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 0) LDAPOID
v
    AuthenticationChoice'sasl   v :: IMPLICIT ('CONTEXTUAL 3) SaslCredentials
v -> IMPLICIT ('CONTEXTUAL 3) SaslCredentials -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 3) SaslCredentials
v

{- | See 'AuthenticationChoice'

> SaslCredentials ::= SEQUENCE {
>      mechanism               LDAPString,
>      credentials             OCTET STRING OPTIONAL }

-}
data SaslCredentials = SaslCredentials
  { SaslCredentials -> LDAPDN
_SaslCredentials'mechanism   :: LDAPString
  , SaslCredentials -> Maybe LDAPOID
_SaslCredentials'credentials :: Maybe OCTET_STRING
  } deriving ((forall x. SaslCredentials -> Rep SaslCredentials x)
-> (forall x. Rep SaslCredentials x -> SaslCredentials)
-> Generic SaslCredentials
forall x. Rep SaslCredentials x -> SaslCredentials
forall x. SaslCredentials -> Rep SaslCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SaslCredentials x -> SaslCredentials
$cfrom :: forall x. SaslCredentials -> Rep SaslCredentials x
Generic,Int -> SaslCredentials -> ShowS
[SaslCredentials] -> ShowS
SaslCredentials -> String
(Int -> SaslCredentials -> ShowS)
-> (SaslCredentials -> String)
-> ([SaslCredentials] -> ShowS)
-> Show SaslCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SaslCredentials] -> ShowS
$cshowList :: [SaslCredentials] -> ShowS
show :: SaslCredentials -> String
$cshow :: SaslCredentials -> String
showsPrec :: Int -> SaslCredentials -> ShowS
$cshowsPrec :: Int -> SaslCredentials -> ShowS
Show,SaslCredentials -> SaslCredentials -> Bool
(SaslCredentials -> SaslCredentials -> Bool)
-> (SaslCredentials -> SaslCredentials -> Bool)
-> Eq SaslCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SaslCredentials -> SaslCredentials -> Bool
$c/= :: SaslCredentials -> SaslCredentials -> Bool
== :: SaslCredentials -> SaslCredentials -> Bool
$c== :: SaslCredentials -> SaslCredentials -> Bool
Eq)

instance NFData SaslCredentials

instance ASN1 SaslCredentials where
  asn1decodeCompOf :: ASN1Decode SaslCredentials
asn1decodeCompOf = LDAPDN -> Maybe LDAPOID -> SaslCredentials
SaslCredentials (LDAPDN -> Maybe LDAPOID -> SaslCredentials)
-> ASN1Decode LDAPDN
-> ASN1Decode (Maybe LDAPOID -> SaslCredentials)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (Maybe LDAPOID -> SaslCredentials)
-> ASN1Decode (Maybe LDAPOID) -> ASN1Decode SaslCredentials
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: SaslCredentials -> ASN1Encode Word64
asn1encodeCompOf (SaslCredentials v1 :: LDAPDN
v1 v2 :: Maybe LDAPOID
v2) = (LDAPDN, Maybe LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,Maybe LDAPOID
v2)

----------------------------------------------------------------------------

{- | Bind Response  (<https://tools.ietf.org/html/rfc4511#section-4.2 RFC4511 Section 4.2>)

> BindResponse ::= [APPLICATION 1] SEQUENCE {
>      COMPONENTS OF LDAPResult,
>      serverSaslCreds    [7] OCTET STRING OPTIONAL }

-}

data BindResponse = BindResponse
  { BindResponse -> LDAPResult
_BindResponse'LDAPResult      :: LDAPResult
  , BindResponse -> Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID)
_BindResponse'serverSaslCreds :: Maybe ('CONTEXTUAL 7 `IMPLICIT` OCTET_STRING)
  } deriving ((forall x. BindResponse -> Rep BindResponse x)
-> (forall x. Rep BindResponse x -> BindResponse)
-> Generic BindResponse
forall x. Rep BindResponse x -> BindResponse
forall x. BindResponse -> Rep BindResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BindResponse x -> BindResponse
$cfrom :: forall x. BindResponse -> Rep BindResponse x
Generic,Int -> BindResponse -> ShowS
[BindResponse] -> ShowS
BindResponse -> String
(Int -> BindResponse -> ShowS)
-> (BindResponse -> String)
-> ([BindResponse] -> ShowS)
-> Show BindResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BindResponse] -> ShowS
$cshowList :: [BindResponse] -> ShowS
show :: BindResponse -> String
$cshow :: BindResponse -> String
showsPrec :: Int -> BindResponse -> ShowS
$cshowsPrec :: Int -> BindResponse -> ShowS
Show,BindResponse -> BindResponse -> Bool
(BindResponse -> BindResponse -> Bool)
-> (BindResponse -> BindResponse -> Bool) -> Eq BindResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BindResponse -> BindResponse -> Bool
$c/= :: BindResponse -> BindResponse -> Bool
== :: BindResponse -> BindResponse -> Bool
$c== :: BindResponse -> BindResponse -> Bool
Eq)

instance NFData BindResponse

instance ASN1 BindResponse where
  asn1defTag :: Proxy BindResponse -> Tag
asn1defTag _ = Word64 -> Tag
Application 1
  asn1decodeCompOf :: ASN1Decode BindResponse
asn1decodeCompOf = do
    LDAPResult
_BindResponse'LDAPResult      <- ASN1Decode LDAPResult
forall t. ASN1 t => ASN1Decode t
asn1decodeCompOf
    Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID)
_BindResponse'serverSaslCreds <- ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode
    BindResponse -> ASN1Decode BindResponse
forall (f :: * -> *) a. Applicative f => a -> f a
pure BindResponse :: LDAPResult
-> Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID) -> BindResponse
BindResponse{..}

  asn1encodeCompOf :: BindResponse -> ASN1Encode Word64
asn1encodeCompOf (BindResponse{..})
    = [ASN1Encode Word64] -> ASN1Encode Word64
enc'SEQUENCE_COMPS [ LDAPResult -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf LDAPResult
_BindResponse'LDAPResult
                         , Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode       Maybe (IMPLICIT ('CONTEXTUAL 7) LDAPOID)
_BindResponse'serverSaslCreds
                         ]

----------------------------------------------------------------------------

{- | Unbind Operation  (<https://tools.ietf.org/html/rfc4511#section-4.3 RFC4511 Section 4.3>)

> UnbindRequest ::= [APPLICATION 2] NULL

-}
type UnbindRequest = ('APPLICATION 2 `IMPLICIT` NULL)

----------------------------------------------------------------------------

{- | Search Request  (<https://tools.ietf.org/html/rfc4511#section-4.5.1 RFC4511 Section 4.5.1>)

> SearchRequest ::= [APPLICATION 3] SEQUENCE {
>      baseObject      LDAPDN,
>      scope           ENUMERATED {
>           baseObject              (0),
>           singleLevel             (1),
>           wholeSubtree            (2),
>           ...  },
>      derefAliases    ENUMERATED {
>           neverDerefAliases       (0),
>           derefInSearching        (1),
>           derefFindingBaseObj     (2),
>           derefAlways             (3) },
>      sizeLimit       INTEGER (0 ..  maxInt),
>      timeLimit       INTEGER (0 ..  maxInt),
>      typesOnly       BOOLEAN,
>      filter          Filter,
>      attributes      AttributeSelection }

-}
data SearchRequest = SearchRequest
  { SearchRequest -> LDAPDN
_SearchRequest'baseObject   :: LDAPDN
  , SearchRequest -> Scope
_SearchRequest'scope        :: Scope
  , SearchRequest -> DerefAliases
_SearchRequest'derefAliases :: DerefAliases
  , SearchRequest -> UInt 0 MaxInt Int32
_SearchRequest'sizeLimit    :: (UInt 0 MaxInt Int32)
  , SearchRequest -> UInt 0 MaxInt Int32
_SearchRequest'timeLimit    :: (UInt 0 MaxInt Int32)
  , SearchRequest -> Bool
_SearchRequest'typesOnly    :: Bool
  , SearchRequest -> Filter
_SearchRequest'filter       :: Filter
  , SearchRequest -> AttributeSelection
_SearchRequest'attributes   :: AttributeSelection
  } deriving ((forall x. SearchRequest -> Rep SearchRequest x)
-> (forall x. Rep SearchRequest x -> SearchRequest)
-> Generic SearchRequest
forall x. Rep SearchRequest x -> SearchRequest
forall x. SearchRequest -> Rep SearchRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchRequest x -> SearchRequest
$cfrom :: forall x. SearchRequest -> Rep SearchRequest x
Generic,Int -> SearchRequest -> ShowS
[SearchRequest] -> ShowS
SearchRequest -> String
(Int -> SearchRequest -> ShowS)
-> (SearchRequest -> String)
-> ([SearchRequest] -> ShowS)
-> Show SearchRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchRequest] -> ShowS
$cshowList :: [SearchRequest] -> ShowS
show :: SearchRequest -> String
$cshow :: SearchRequest -> String
showsPrec :: Int -> SearchRequest -> ShowS
$cshowsPrec :: Int -> SearchRequest -> ShowS
Show,SearchRequest -> SearchRequest -> Bool
(SearchRequest -> SearchRequest -> Bool)
-> (SearchRequest -> SearchRequest -> Bool) -> Eq SearchRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchRequest -> SearchRequest -> Bool
$c/= :: SearchRequest -> SearchRequest -> Bool
== :: SearchRequest -> SearchRequest -> Bool
$c== :: SearchRequest -> SearchRequest -> Bool
Eq)

instance NFData SearchRequest

{- | See 'SearchRequest'

> AttributeSelection ::= SEQUENCE OF selector LDAPString
>                -- The LDAPString is constrained to
>                -- <attributeSelector> in Section 4.5.1.8

-}
type AttributeSelection = [LDAPString]

instance ASN1 SearchRequest where
  asn1decode :: ASN1Decode SearchRequest
asn1decode = Tag -> ASN1Decode SearchRequest -> ASN1Decode SearchRequest
forall x. Tag -> ASN1Decode x -> ASN1Decode x
implicit (Word64 -> Tag
Application 3) (ASN1Decode SearchRequest -> ASN1Decode SearchRequest)
-> ASN1Decode SearchRequest -> ASN1Decode SearchRequest
forall a b. (a -> b) -> a -> b
$ ASN1Decode SearchRequest -> ASN1Decode SearchRequest
forall x. ASN1Decode x -> ASN1Decode x
with'SEQUENCE (ASN1Decode SearchRequest -> ASN1Decode SearchRequest)
-> ASN1Decode SearchRequest -> ASN1Decode SearchRequest
forall a b. (a -> b) -> a -> b
$ do
    LDAPDN
_SearchRequest'baseObject   <- ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode
    Scope
_SearchRequest'scope        <- ASN1Decode Scope
forall t. ASN1 t => ASN1Decode t
asn1decode
    DerefAliases
_SearchRequest'derefAliases <- ASN1Decode DerefAliases
forall t. ASN1 t => ASN1Decode t
asn1decode
    UInt 0 MaxInt Int32
_SearchRequest'sizeLimit    <- ASN1Decode (UInt 0 MaxInt Int32)
forall t. ASN1 t => ASN1Decode t
asn1decode
    UInt 0 MaxInt Int32
_SearchRequest'timeLimit    <- ASN1Decode (UInt 0 MaxInt Int32)
forall t. ASN1 t => ASN1Decode t
asn1decode
    Bool
_SearchRequest'typesOnly    <- ASN1Decode Bool
forall t. ASN1 t => ASN1Decode t
asn1decode
    Filter
_SearchRequest'filter       <- ASN1Decode Filter
forall t. ASN1 t => ASN1Decode t
asn1decode
    AttributeSelection
_SearchRequest'attributes   <- ASN1Decode AttributeSelection
forall t. ASN1 t => ASN1Decode t
asn1decode

    SearchRequest -> ASN1Decode SearchRequest
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchRequest :: LDAPDN
-> Scope
-> DerefAliases
-> UInt 0 MaxInt Int32
-> UInt 0 MaxInt Int32
-> Bool
-> Filter
-> AttributeSelection
-> SearchRequest
SearchRequest{..}

  asn1encode :: SearchRequest -> ASN1Encode Word64
asn1encode (SearchRequest v1 :: LDAPDN
v1 v2 :: Scope
v2 v3 :: DerefAliases
v3 v4 :: UInt 0 MaxInt Int32
v4 v5 :: UInt 0 MaxInt Int32
v5 v6 :: Bool
v6 v7 :: Filter
v7 v8 :: AttributeSelection
v8)
    = Tag -> ASN1Encode Word64 -> ASN1Encode Word64
forall a. Tag -> ASN1Encode a -> ASN1Encode a
retag (Word64 -> Tag
Application 3) (ASN1Encode Word64 -> ASN1Encode Word64)
-> ASN1Encode Word64 -> ASN1Encode Word64
forall a b. (a -> b) -> a -> b
$
      [ASN1Encode Word64] -> ASN1Encode Word64
enc'SEQUENCE [ LDAPDN -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode LDAPDN
v1
                   , Scope -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode Scope
v2
                   , DerefAliases -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode DerefAliases
v3
                   , UInt 0 MaxInt Int32 -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode UInt 0 MaxInt Int32
v4
                   , UInt 0 MaxInt Int32 -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode UInt 0 MaxInt Int32
v5
                   , Bool -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode Bool
v6
                   , Filter -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode Filter
v7
                   , AttributeSelection -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode AttributeSelection
v8
                   ]

-- | See 'SearchRequest'  (<https://tools.ietf.org/html/rfc4511#section-4.5.1.2 RFC4511 Section 4.5.1.2>)
data Scope
  = Scope'baseObject
  | Scope'singleLevel
  | Scope'wholeSubtree
  deriving ((forall x. Scope -> Rep Scope x)
-> (forall x. Rep Scope x -> Scope) -> Generic Scope
forall x. Rep Scope x -> Scope
forall x. Scope -> Rep Scope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scope x -> Scope
$cfrom :: forall x. Scope -> Rep Scope x
Generic,Scope
Scope -> Scope -> Bounded Scope
forall a. a -> a -> Bounded a
maxBound :: Scope
$cmaxBound :: Scope
minBound :: Scope
$cminBound :: Scope
Bounded,Int -> Scope
Scope -> Int
Scope -> [Scope]
Scope -> Scope
Scope -> Scope -> [Scope]
Scope -> Scope -> Scope -> [Scope]
(Scope -> Scope)
-> (Scope -> Scope)
-> (Int -> Scope)
-> (Scope -> Int)
-> (Scope -> [Scope])
-> (Scope -> Scope -> [Scope])
-> (Scope -> Scope -> [Scope])
-> (Scope -> Scope -> Scope -> [Scope])
-> Enum Scope
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Scope -> Scope -> Scope -> [Scope]
$cenumFromThenTo :: Scope -> Scope -> Scope -> [Scope]
enumFromTo :: Scope -> Scope -> [Scope]
$cenumFromTo :: Scope -> Scope -> [Scope]
enumFromThen :: Scope -> Scope -> [Scope]
$cenumFromThen :: Scope -> Scope -> [Scope]
enumFrom :: Scope -> [Scope]
$cenumFrom :: Scope -> [Scope]
fromEnum :: Scope -> Int
$cfromEnum :: Scope -> Int
toEnum :: Int -> Scope
$ctoEnum :: Int -> Scope
pred :: Scope -> Scope
$cpred :: Scope -> Scope
succ :: Scope -> Scope
$csucc :: Scope -> Scope
Enum,Int -> Scope -> ShowS
[Scope] -> ShowS
Scope -> String
(Int -> Scope -> ShowS)
-> (Scope -> String) -> ([Scope] -> ShowS) -> Show Scope
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scope] -> ShowS
$cshowList :: [Scope] -> ShowS
show :: Scope -> String
$cshow :: Scope -> String
showsPrec :: Int -> Scope -> ShowS
$cshowsPrec :: Int -> Scope -> ShowS
Show,Scope -> Scope -> Bool
(Scope -> Scope -> Bool) -> (Scope -> Scope -> Bool) -> Eq Scope
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scope -> Scope -> Bool
$c/= :: Scope -> Scope -> Bool
== :: Scope -> Scope -> Bool
$c== :: Scope -> Scope -> Bool
Eq)

instance NFData Scope where
  rnf :: Scope -> ()
rnf = Scope -> ()
forall a. a -> ()
rwhnf

instance ASN1 Scope where
  asn1decode :: ASN1Decode Scope
asn1decode = ASN1Decode Scope
forall enum. (Bounded enum, Enum enum) => ASN1Decode enum
dec'BoundedEnum
  asn1encode :: Scope -> ASN1Encode Word64
asn1encode = Scope -> ASN1Encode Word64
forall enum. Enum enum => enum -> ASN1Encode Word64
enc'BoundedEnum

-- | See 'SearchRequest'  (<https://tools.ietf.org/html/rfc4511#section-4.5.1.3 RFC4511 Section 4.5.1.3>)
data DerefAliases
  = DerefAliases'neverDerefAliases
  | DerefAliases'derefInSearching
  | DerefAliases'derefFindingBaseObj
  | DerefAliases'derefAlways
  deriving ((forall x. DerefAliases -> Rep DerefAliases x)
-> (forall x. Rep DerefAliases x -> DerefAliases)
-> Generic DerefAliases
forall x. Rep DerefAliases x -> DerefAliases
forall x. DerefAliases -> Rep DerefAliases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DerefAliases x -> DerefAliases
$cfrom :: forall x. DerefAliases -> Rep DerefAliases x
Generic,DerefAliases
DerefAliases -> DerefAliases -> Bounded DerefAliases
forall a. a -> a -> Bounded a
maxBound :: DerefAliases
$cmaxBound :: DerefAliases
minBound :: DerefAliases
$cminBound :: DerefAliases
Bounded,Int -> DerefAliases
DerefAliases -> Int
DerefAliases -> [DerefAliases]
DerefAliases -> DerefAliases
DerefAliases -> DerefAliases -> [DerefAliases]
DerefAliases -> DerefAliases -> DerefAliases -> [DerefAliases]
(DerefAliases -> DerefAliases)
-> (DerefAliases -> DerefAliases)
-> (Int -> DerefAliases)
-> (DerefAliases -> Int)
-> (DerefAliases -> [DerefAliases])
-> (DerefAliases -> DerefAliases -> [DerefAliases])
-> (DerefAliases -> DerefAliases -> [DerefAliases])
-> (DerefAliases -> DerefAliases -> DerefAliases -> [DerefAliases])
-> Enum DerefAliases
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: DerefAliases -> DerefAliases -> DerefAliases -> [DerefAliases]
$cenumFromThenTo :: DerefAliases -> DerefAliases -> DerefAliases -> [DerefAliases]
enumFromTo :: DerefAliases -> DerefAliases -> [DerefAliases]
$cenumFromTo :: DerefAliases -> DerefAliases -> [DerefAliases]
enumFromThen :: DerefAliases -> DerefAliases -> [DerefAliases]
$cenumFromThen :: DerefAliases -> DerefAliases -> [DerefAliases]
enumFrom :: DerefAliases -> [DerefAliases]
$cenumFrom :: DerefAliases -> [DerefAliases]
fromEnum :: DerefAliases -> Int
$cfromEnum :: DerefAliases -> Int
toEnum :: Int -> DerefAliases
$ctoEnum :: Int -> DerefAliases
pred :: DerefAliases -> DerefAliases
$cpred :: DerefAliases -> DerefAliases
succ :: DerefAliases -> DerefAliases
$csucc :: DerefAliases -> DerefAliases
Enum,Int -> DerefAliases -> ShowS
[DerefAliases] -> ShowS
DerefAliases -> String
(Int -> DerefAliases -> ShowS)
-> (DerefAliases -> String)
-> ([DerefAliases] -> ShowS)
-> Show DerefAliases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DerefAliases] -> ShowS
$cshowList :: [DerefAliases] -> ShowS
show :: DerefAliases -> String
$cshow :: DerefAliases -> String
showsPrec :: Int -> DerefAliases -> ShowS
$cshowsPrec :: Int -> DerefAliases -> ShowS
Show,DerefAliases -> DerefAliases -> Bool
(DerefAliases -> DerefAliases -> Bool)
-> (DerefAliases -> DerefAliases -> Bool) -> Eq DerefAliases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DerefAliases -> DerefAliases -> Bool
$c/= :: DerefAliases -> DerefAliases -> Bool
== :: DerefAliases -> DerefAliases -> Bool
$c== :: DerefAliases -> DerefAliases -> Bool
Eq)

instance NFData DerefAliases where
  rnf :: DerefAliases -> ()
rnf = DerefAliases -> ()
forall a. a -> ()
rwhnf

instance ASN1 DerefAliases where
  asn1decode :: ASN1Decode DerefAliases
asn1decode = ASN1Decode DerefAliases
forall enum. (Bounded enum, Enum enum) => ASN1Decode enum
dec'BoundedEnum
  asn1encode :: DerefAliases -> ASN1Encode Word64
asn1encode = DerefAliases -> ASN1Encode Word64
forall enum. Enum enum => enum -> ASN1Encode Word64
enc'BoundedEnum

{- | Search Filter  (<https://tools.ietf.org/html/rfc4511#section-4.5.1.7 RFC4511 Section 4.5.1.7>)

> Filter ::= CHOICE {
>      and             [0] SET SIZE (1..MAX) OF filter Filter,
>      or              [1] SET SIZE (1..MAX) OF filter Filter,
>      not             [2] Filter,
>      equalityMatch   [3] AttributeValueAssertion,
>      substrings      [4] SubstringFilter,
>      greaterOrEqual  [5] AttributeValueAssertion,
>      lessOrEqual     [6] AttributeValueAssertion,
>      present         [7] AttributeDescription,
>      approxMatch     [8] AttributeValueAssertion,
>      extensibleMatch [9] MatchingRuleAssertion,
>      ...  }

-}
data Filter
  = Filter'and             ('CONTEXTUAL 0 `IMPLICIT` SET1 Filter)
  | Filter'or              ('CONTEXTUAL 1 `IMPLICIT` SET1 Filter)
  | Filter'not             ('CONTEXTUAL 2 `EXPLICIT` Filter)
  | Filter'equalityMatch   ('CONTEXTUAL 3 `IMPLICIT` AttributeValueAssertion)
  | Filter'substrings      ('CONTEXTUAL 4 `IMPLICIT` SubstringFilter)
  | Filter'greaterOrEqual  ('CONTEXTUAL 5 `IMPLICIT` AttributeValueAssertion)
  | Filter'lessOrEqual     ('CONTEXTUAL 6 `IMPLICIT` AttributeValueAssertion)
  | Filter'present         ('CONTEXTUAL 7 `IMPLICIT` AttributeDescription)
  | Filter'approxMatch     ('CONTEXTUAL 8 `IMPLICIT` AttributeValueAssertion)
  | Filter'extensibleMatch ('CONTEXTUAL 9 `IMPLICIT` MatchingRuleAssertion)
  deriving ((forall x. Filter -> Rep Filter x)
-> (forall x. Rep Filter x -> Filter) -> Generic Filter
forall x. Rep Filter x -> Filter
forall x. Filter -> Rep Filter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Filter x -> Filter
$cfrom :: forall x. Filter -> Rep Filter x
Generic,Int -> Filter -> ShowS
[Filter] -> ShowS
Filter -> String
(Int -> Filter -> ShowS)
-> (Filter -> String) -> ([Filter] -> ShowS) -> Show Filter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Filter] -> ShowS
$cshowList :: [Filter] -> ShowS
show :: Filter -> String
$cshow :: Filter -> String
showsPrec :: Int -> Filter -> ShowS
$cshowsPrec :: Int -> Filter -> ShowS
Show,Filter -> Filter -> Bool
(Filter -> Filter -> Bool)
-> (Filter -> Filter -> Bool) -> Eq Filter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Filter -> Filter -> Bool
$c/= :: Filter -> Filter -> Bool
== :: Filter -> Filter -> Bool
$c== :: Filter -> Filter -> Bool
Eq)

instance NFData Filter

instance ASN1 Filter where
  asn1decode :: ASN1Decode Filter
asn1decode = [ASN1Decode Filter] -> ASN1Decode Filter
forall x. [ASN1Decode x] -> ASN1Decode x
with'CHOICE
    [ IMPLICIT ('CONTEXTUAL 0) (SET1 Filter) -> Filter
Filter'and             (IMPLICIT ('CONTEXTUAL 0) (SET1 Filter) -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) (SET1 Filter))
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) (SET1 Filter))
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 1) (SET1 Filter) -> Filter
Filter'or              (IMPLICIT ('CONTEXTUAL 1) (SET1 Filter) -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 1) (SET1 Filter))
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 1) (SET1 Filter))
forall t. ASN1 t => ASN1Decode t
asn1decode
    , EXPLICIT ('CONTEXTUAL 2) Filter -> Filter
Filter'not             (EXPLICIT ('CONTEXTUAL 2) Filter -> Filter)
-> ASN1Decode (EXPLICIT ('CONTEXTUAL 2) Filter)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (EXPLICIT ('CONTEXTUAL 2) Filter)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion -> Filter
Filter'equalityMatch   (IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 4) SubstringFilter -> Filter
Filter'substrings      (IMPLICIT ('CONTEXTUAL 4) SubstringFilter -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 4) SubstringFilter)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 4) SubstringFilter)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion -> Filter
Filter'greaterOrEqual  (IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion -> Filter
Filter'lessOrEqual     (IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 7) LDAPDN -> Filter
Filter'present         (IMPLICIT ('CONTEXTUAL 7) LDAPDN -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 7) LDAPDN)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 7) LDAPDN)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion -> Filter
Filter'approxMatch     (IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion -> Filter
Filter'extensibleMatch (IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion -> Filter)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion)
-> ASN1Decode Filter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion)
forall t. ASN1 t => ASN1Decode t
asn1decode
    ]

  asn1encode :: Filter -> ASN1Encode Word64
asn1encode = \case
    Filter'and             v :: IMPLICIT ('CONTEXTUAL 0) (SET1 Filter)
v -> IMPLICIT ('CONTEXTUAL 0) (SET1 Filter) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 0) (SET1 Filter)
v
    Filter'or              v :: IMPLICIT ('CONTEXTUAL 1) (SET1 Filter)
v -> IMPLICIT ('CONTEXTUAL 1) (SET1 Filter) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 1) (SET1 Filter)
v
    Filter'not             v :: EXPLICIT ('CONTEXTUAL 2) Filter
v -> EXPLICIT ('CONTEXTUAL 2) Filter -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode EXPLICIT ('CONTEXTUAL 2) Filter
v
    Filter'equalityMatch   v :: IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion
v -> IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 3) AttributeValueAssertion
v
    Filter'substrings      v :: IMPLICIT ('CONTEXTUAL 4) SubstringFilter
v -> IMPLICIT ('CONTEXTUAL 4) SubstringFilter -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 4) SubstringFilter
v
    Filter'greaterOrEqual  v :: IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion
v -> IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 5) AttributeValueAssertion
v
    Filter'lessOrEqual     v :: IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion
v -> IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 6) AttributeValueAssertion
v
    Filter'present         v :: IMPLICIT ('CONTEXTUAL 7) LDAPDN
v -> IMPLICIT ('CONTEXTUAL 7) LDAPDN -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 7) LDAPDN
v
    Filter'approxMatch     v :: IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion
v -> IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 8) AttributeValueAssertion
v
    Filter'extensibleMatch v :: IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion
v -> IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 9) MatchingRuleAssertion
v

{- | Attribute Descriptions  (<https://tools.ietf.org/html/rfc4511#section-4.1.4 RFC4511 Section 4.1.4>)

> AttributeDescription ::= LDAPString
>                         -- Constrained to <attributedescription>
>                         -- [RFC4512]

-}
type AttributeDescription = LDAPString

{- | Attribute Value  (<https://tools.ietf.org/html/rfc4511#section-4.1.5 RFC4511 Section 4.1.5>)

> AttributeValue ::= OCTET STRING

-}
type AttributeValue = OCTET_STRING

{- | Attribute Value Assertion  (<https://tools.ietf.org/html/rfc4511#section-4.1.6 RFC4511 Section 4.1.6>)

> AttributeValueAssertion ::= SEQUENCE {
>      attributeDesc   AttributeDescription,
>      assertionValue  AssertionValue }

-}
data AttributeValueAssertion = AttributeValueAssertion
  { AttributeValueAssertion -> LDAPDN
_AttributeValueAssertion'attributeDesc  :: AttributeDescription
  , AttributeValueAssertion -> LDAPOID
_AttributeValueAssertion'assertionValue :: AssertionValue
  } deriving ((forall x.
 AttributeValueAssertion -> Rep AttributeValueAssertion x)
-> (forall x.
    Rep AttributeValueAssertion x -> AttributeValueAssertion)
-> Generic AttributeValueAssertion
forall x. Rep AttributeValueAssertion x -> AttributeValueAssertion
forall x. AttributeValueAssertion -> Rep AttributeValueAssertion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttributeValueAssertion x -> AttributeValueAssertion
$cfrom :: forall x. AttributeValueAssertion -> Rep AttributeValueAssertion x
Generic,Int -> AttributeValueAssertion -> ShowS
[AttributeValueAssertion] -> ShowS
AttributeValueAssertion -> String
(Int -> AttributeValueAssertion -> ShowS)
-> (AttributeValueAssertion -> String)
-> ([AttributeValueAssertion] -> ShowS)
-> Show AttributeValueAssertion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttributeValueAssertion] -> ShowS
$cshowList :: [AttributeValueAssertion] -> ShowS
show :: AttributeValueAssertion -> String
$cshow :: AttributeValueAssertion -> String
showsPrec :: Int -> AttributeValueAssertion -> ShowS
$cshowsPrec :: Int -> AttributeValueAssertion -> ShowS
Show,AttributeValueAssertion -> AttributeValueAssertion -> Bool
(AttributeValueAssertion -> AttributeValueAssertion -> Bool)
-> (AttributeValueAssertion -> AttributeValueAssertion -> Bool)
-> Eq AttributeValueAssertion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttributeValueAssertion -> AttributeValueAssertion -> Bool
$c/= :: AttributeValueAssertion -> AttributeValueAssertion -> Bool
== :: AttributeValueAssertion -> AttributeValueAssertion -> Bool
$c== :: AttributeValueAssertion -> AttributeValueAssertion -> Bool
Eq)

instance NFData AttributeValueAssertion

-- | > AssertionValue ::= OCTET STRING
type AssertionValue = OCTET_STRING

instance ASN1 AttributeValueAssertion where
  asn1decodeCompOf :: ASN1Decode AttributeValueAssertion
asn1decodeCompOf = LDAPDN -> LDAPOID -> AttributeValueAssertion
AttributeValueAssertion (LDAPDN -> LDAPOID -> AttributeValueAssertion)
-> ASN1Decode LDAPDN
-> ASN1Decode (LDAPOID -> AttributeValueAssertion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (LDAPOID -> AttributeValueAssertion)
-> ASN1Decode LDAPOID -> ASN1Decode AttributeValueAssertion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode LDAPOID
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: AttributeValueAssertion -> ASN1Encode Word64
asn1encodeCompOf (AttributeValueAssertion v1 :: LDAPDN
v1 v2 :: LDAPOID
v2) = (LDAPDN, LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,LDAPOID
v2)

{- | Substring 'Filter'  (<https://tools.ietf.org/html/rfc4511#section-4.5.1.7.2 RFC4511 Section 4.5.1.7.2>)

> SubstringFilter ::= SEQUENCE {
>      type           AttributeDescription,
>      substrings     SEQUENCE SIZE (1..MAX) OF substring CHOICE {
>           initial [0] AssertionValue,  -- can occur at most once
>           any     [1] AssertionValue,
>           final   [2] AssertionValue } -- can occur at most once
>      }

__NOTE__: The additional invariants imposed on the ordering and occurence counts of the @initial@ and @final@ entries MUST currently be enforced by the consumer of this library. Future versions of this library might change to enforce these invariants at the type-level.

Specifically, the invariant stated by the specification is:

/There SHALL be at most one @initial@ and at most one @final@ in the @substrings@ of a SubstringFilter.  If @initial@ is present, it SHALL be the first element of @substrings@.  If @final@ is present, it SHALL be the last element of @substrings@./

-}
data SubstringFilter = SubstringFilter
  { SubstringFilter -> LDAPDN
_SubstringFilter'type       :: AttributeDescription
  , SubstringFilter -> NonEmpty Substring
_SubstringFilter'substrings :: NonEmpty Substring
  } deriving ((forall x. SubstringFilter -> Rep SubstringFilter x)
-> (forall x. Rep SubstringFilter x -> SubstringFilter)
-> Generic SubstringFilter
forall x. Rep SubstringFilter x -> SubstringFilter
forall x. SubstringFilter -> Rep SubstringFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubstringFilter x -> SubstringFilter
$cfrom :: forall x. SubstringFilter -> Rep SubstringFilter x
Generic,Int -> SubstringFilter -> ShowS
[SubstringFilter] -> ShowS
SubstringFilter -> String
(Int -> SubstringFilter -> ShowS)
-> (SubstringFilter -> String)
-> ([SubstringFilter] -> ShowS)
-> Show SubstringFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubstringFilter] -> ShowS
$cshowList :: [SubstringFilter] -> ShowS
show :: SubstringFilter -> String
$cshow :: SubstringFilter -> String
showsPrec :: Int -> SubstringFilter -> ShowS
$cshowsPrec :: Int -> SubstringFilter -> ShowS
Show,SubstringFilter -> SubstringFilter -> Bool
(SubstringFilter -> SubstringFilter -> Bool)
-> (SubstringFilter -> SubstringFilter -> Bool)
-> Eq SubstringFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubstringFilter -> SubstringFilter -> Bool
$c/= :: SubstringFilter -> SubstringFilter -> Bool
== :: SubstringFilter -> SubstringFilter -> Bool
$c== :: SubstringFilter -> SubstringFilter -> Bool
Eq)

instance NFData SubstringFilter

instance ASN1 SubstringFilter where
  asn1decodeCompOf :: ASN1Decode SubstringFilter
asn1decodeCompOf = LDAPDN -> NonEmpty Substring -> SubstringFilter
SubstringFilter (LDAPDN -> NonEmpty Substring -> SubstringFilter)
-> ASN1Decode LDAPDN
-> ASN1Decode (NonEmpty Substring -> SubstringFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (NonEmpty Substring -> SubstringFilter)
-> ASN1Decode (NonEmpty Substring) -> ASN1Decode SubstringFilter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (NonEmpty Substring)
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: SubstringFilter -> ASN1Encode Word64
asn1encodeCompOf (SubstringFilter v1 :: LDAPDN
v1 v2 :: NonEmpty Substring
v2) = (LDAPDN, NonEmpty Substring) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,NonEmpty Substring
v2)

-- | See 'SubstringFilter'
data Substring
  = Substring'initial ('CONTEXTUAL 0 `IMPLICIT` AssertionValue) -- ^ may occur at most once; must be first element if present
  | Substring'any     ('CONTEXTUAL 1 `IMPLICIT` AssertionValue)
  | Substring'final   ('CONTEXTUAL 2 `IMPLICIT` AssertionValue) -- ^ may occur at most once; must be last element if present
  deriving ((forall x. Substring -> Rep Substring x)
-> (forall x. Rep Substring x -> Substring) -> Generic Substring
forall x. Rep Substring x -> Substring
forall x. Substring -> Rep Substring x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Substring x -> Substring
$cfrom :: forall x. Substring -> Rep Substring x
Generic,Int -> Substring -> ShowS
[Substring] -> ShowS
Substring -> String
(Int -> Substring -> ShowS)
-> (Substring -> String)
-> ([Substring] -> ShowS)
-> Show Substring
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Substring] -> ShowS
$cshowList :: [Substring] -> ShowS
show :: Substring -> String
$cshow :: Substring -> String
showsPrec :: Int -> Substring -> ShowS
$cshowsPrec :: Int -> Substring -> ShowS
Show,Substring -> Substring -> Bool
(Substring -> Substring -> Bool)
-> (Substring -> Substring -> Bool) -> Eq Substring
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Substring -> Substring -> Bool
$c/= :: Substring -> Substring -> Bool
== :: Substring -> Substring -> Bool
$c== :: Substring -> Substring -> Bool
Eq)

instance NFData Substring

instance ASN1 Substring where
  asn1decode :: ASN1Decode Substring
asn1decode = [ASN1Decode Substring] -> ASN1Decode Substring
forall x. [ASN1Decode x] -> ASN1Decode x
with'CHOICE
    [ IMPLICIT ('CONTEXTUAL 0) LDAPOID -> Substring
Substring'initial (IMPLICIT ('CONTEXTUAL 0) LDAPOID -> Substring)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
-> ASN1Decode Substring
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 1) LDAPOID -> Substring
Substring'any     (IMPLICIT ('CONTEXTUAL 1) LDAPOID -> Substring)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
-> ASN1Decode Substring
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
    , IMPLICIT ('CONTEXTUAL 2) LDAPOID -> Substring
Substring'final   (IMPLICIT ('CONTEXTUAL 2) LDAPOID -> Substring)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 2) LDAPOID)
-> ASN1Decode Substring
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 2) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
    ]

  asn1encode :: Substring -> ASN1Encode Word64
asn1encode = \case
    Substring'initial v :: IMPLICIT ('CONTEXTUAL 0) LDAPOID
v -> IMPLICIT ('CONTEXTUAL 0) LDAPOID -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 0) LDAPOID
v
    Substring'any     v :: IMPLICIT ('CONTEXTUAL 1) LDAPOID
v -> IMPLICIT ('CONTEXTUAL 1) LDAPOID -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 1) LDAPOID
v
    Substring'final   v :: IMPLICIT ('CONTEXTUAL 2) LDAPOID
v -> IMPLICIT ('CONTEXTUAL 2) LDAPOID -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode IMPLICIT ('CONTEXTUAL 2) LDAPOID
v


{- | Matching Rule Identifier  (<https://tools.ietf.org/html/rfc4511#section-4.1.8 RFC4511 Section 4.1.8>)

> MatchingRuleId ::= LDAPString

-}
type MatchingRuleId = LDAPString

{- | See 'SearchRequest' 'Filter'

> MatchingRuleAssertion ::= SEQUENCE {
>      matchingRule    [1] MatchingRuleId OPTIONAL,
>      type            [2] AttributeDescription OPTIONAL,
>      matchValue      [3] AssertionValue,
>      dnAttributes    [4] BOOLEAN DEFAULT FALSE }

-}
data MatchingRuleAssertion = MatchingRuleAssertion
  { MatchingRuleAssertion -> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN)
_MatchingRuleAssertion'matchingRule :: Maybe ('CONTEXTUAL 1 `IMPLICIT` MatchingRuleId)
  , MatchingRuleAssertion -> Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
_MatchingRuleAssertion'type         :: Maybe ('CONTEXTUAL 2 `IMPLICIT` AttributeDescription)
  , MatchingRuleAssertion -> IMPLICIT ('CONTEXTUAL 3) LDAPOID
_MatchingRuleAssertion'matchValue   ::       ('CONTEXTUAL 3 `IMPLICIT` AssertionValue)
  , MatchingRuleAssertion
-> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
_MatchingRuleAssertion'dnAttributes :: Maybe ('CONTEXTUAL 4 `IMPLICIT` BOOLEAN_DEFAULT_FALSE)
  } deriving ((forall x. MatchingRuleAssertion -> Rep MatchingRuleAssertion x)
-> (forall x. Rep MatchingRuleAssertion x -> MatchingRuleAssertion)
-> Generic MatchingRuleAssertion
forall x. Rep MatchingRuleAssertion x -> MatchingRuleAssertion
forall x. MatchingRuleAssertion -> Rep MatchingRuleAssertion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchingRuleAssertion x -> MatchingRuleAssertion
$cfrom :: forall x. MatchingRuleAssertion -> Rep MatchingRuleAssertion x
Generic,Int -> MatchingRuleAssertion -> ShowS
[MatchingRuleAssertion] -> ShowS
MatchingRuleAssertion -> String
(Int -> MatchingRuleAssertion -> ShowS)
-> (MatchingRuleAssertion -> String)
-> ([MatchingRuleAssertion] -> ShowS)
-> Show MatchingRuleAssertion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchingRuleAssertion] -> ShowS
$cshowList :: [MatchingRuleAssertion] -> ShowS
show :: MatchingRuleAssertion -> String
$cshow :: MatchingRuleAssertion -> String
showsPrec :: Int -> MatchingRuleAssertion -> ShowS
$cshowsPrec :: Int -> MatchingRuleAssertion -> ShowS
Show,MatchingRuleAssertion -> MatchingRuleAssertion -> Bool
(MatchingRuleAssertion -> MatchingRuleAssertion -> Bool)
-> (MatchingRuleAssertion -> MatchingRuleAssertion -> Bool)
-> Eq MatchingRuleAssertion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchingRuleAssertion -> MatchingRuleAssertion -> Bool
$c/= :: MatchingRuleAssertion -> MatchingRuleAssertion -> Bool
== :: MatchingRuleAssertion -> MatchingRuleAssertion -> Bool
$c== :: MatchingRuleAssertion -> MatchingRuleAssertion -> Bool
Eq)

instance NFData MatchingRuleAssertion

instance ASN1 MatchingRuleAssertion where
  asn1decodeCompOf :: ASN1Decode MatchingRuleAssertion
asn1decodeCompOf = Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN)
-> Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
-> IMPLICIT ('CONTEXTUAL 3) LDAPOID
-> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
-> MatchingRuleAssertion
MatchingRuleAssertion (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN)
 -> Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
 -> IMPLICIT ('CONTEXTUAL 3) LDAPOID
 -> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
 -> MatchingRuleAssertion)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN))
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
      -> IMPLICIT ('CONTEXTUAL 3) LDAPOID
      -> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
      -> MatchingRuleAssertion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN))
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
   -> IMPLICIT ('CONTEXTUAL 3) LDAPOID
   -> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
   -> MatchingRuleAssertion)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN))
-> ASN1Decode
     (IMPLICIT ('CONTEXTUAL 3) LDAPOID
      -> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
      -> MatchingRuleAssertion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN))
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (IMPLICIT ('CONTEXTUAL 3) LDAPOID
   -> Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
   -> MatchingRuleAssertion)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) LDAPOID)
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
      -> MatchingRuleAssertion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (IMPLICIT ('CONTEXTUAL 3) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
   -> MatchingRuleAssertion)
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE))
-> ASN1Decode MatchingRuleAssertion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE))
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: MatchingRuleAssertion -> ASN1Encode Word64
asn1encodeCompOf (MatchingRuleAssertion v1 :: Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN)
v1 v2 :: Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
v2 v3 :: IMPLICIT ('CONTEXTUAL 3) LDAPOID
v3 v4 :: Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
v4) = (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN),
 Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN),
 IMPLICIT ('CONTEXTUAL 3) LDAPOID,
 Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPDN)
v1,Maybe (IMPLICIT ('CONTEXTUAL 2) LDAPDN)
v2,IMPLICIT ('CONTEXTUAL 3) LDAPOID
v3,Maybe (IMPLICIT ('CONTEXTUAL 4) BOOLEAN_DEFAULT_FALSE)
v4)

----------------------------------------------------------------------------

{- | Search Result Continuation Reference  (<https://tools.ietf.org/html/rfc4511#section-4.5.3 RFC4511 Section 4.5.3>)

> SearchResultReference ::= [APPLICATION 19] SEQUENCE
>                           SIZE (1..MAX) OF uri URI

-}

newtype SearchResultReference = SearchResultReference (NonEmpty URI)
  deriving ((forall x. SearchResultReference -> Rep SearchResultReference x)
-> (forall x. Rep SearchResultReference x -> SearchResultReference)
-> Generic SearchResultReference
forall x. Rep SearchResultReference x -> SearchResultReference
forall x. SearchResultReference -> Rep SearchResultReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchResultReference x -> SearchResultReference
$cfrom :: forall x. SearchResultReference -> Rep SearchResultReference x
Generic,SearchResultReference -> ()
(SearchResultReference -> ()) -> NFData SearchResultReference
forall a. (a -> ()) -> NFData a
rnf :: SearchResultReference -> ()
$crnf :: SearchResultReference -> ()
NFData,Int -> SearchResultReference -> ShowS
[SearchResultReference] -> ShowS
SearchResultReference -> String
(Int -> SearchResultReference -> ShowS)
-> (SearchResultReference -> String)
-> ([SearchResultReference] -> ShowS)
-> Show SearchResultReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchResultReference] -> ShowS
$cshowList :: [SearchResultReference] -> ShowS
show :: SearchResultReference -> String
$cshow :: SearchResultReference -> String
showsPrec :: Int -> SearchResultReference -> ShowS
$cshowsPrec :: Int -> SearchResultReference -> ShowS
Show,SearchResultReference -> SearchResultReference -> Bool
(SearchResultReference -> SearchResultReference -> Bool)
-> (SearchResultReference -> SearchResultReference -> Bool)
-> Eq SearchResultReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchResultReference -> SearchResultReference -> Bool
$c/= :: SearchResultReference -> SearchResultReference -> Bool
== :: SearchResultReference -> SearchResultReference -> Bool
$c== :: SearchResultReference -> SearchResultReference -> Bool
Eq)

instance ASN1 SearchResultReference where
  asn1defTag :: Proxy SearchResultReference -> Tag
asn1defTag _ = Word64 -> Tag
Application 19 -- not used
  asn1decode :: ASN1Decode SearchResultReference
asn1decode = NonEmpty LDAPDN -> SearchResultReference
SearchResultReference (NonEmpty LDAPDN -> SearchResultReference)
-> ASN1Decode (NonEmpty LDAPDN) -> ASN1Decode SearchResultReference
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Word64 -> Tag
Application 19 Tag -> ASN1Decode (NonEmpty LDAPDN) -> ASN1Decode (NonEmpty LDAPDN)
forall x. Tag -> ASN1Decode x -> ASN1Decode x
`implicit` ASN1Decode (NonEmpty LDAPDN)
forall t. ASN1 t => ASN1Decode t
asn1decode)
  asn1encode :: SearchResultReference -> ASN1Encode Word64
asn1encode (SearchResultReference v :: NonEmpty LDAPDN
v) = Tag -> ASN1Encode Word64 -> ASN1Encode Word64
forall a. Tag -> ASN1Encode a -> ASN1Encode a
retag (Word64 -> Tag
Application 19) (ASN1Encode Word64 -> ASN1Encode Word64)
-> ASN1Encode Word64 -> ASN1Encode Word64
forall a b. (a -> b) -> a -> b
$ NonEmpty LDAPDN -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode NonEmpty LDAPDN
v

----------------------------------------------------------------------------

{- | Search Result Entry  (<https://tools.ietf.org/html/rfc4511#section-4.5.2 RFC4511 Section 4.5.2>)

> SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
>      objectName      LDAPDN,
>      attributes      PartialAttributeList }

-}
data SearchResultEntry = SearchResultEntry
  { SearchResultEntry -> LDAPDN
_SearchResultEntry'objectName :: LDAPDN
  , SearchResultEntry -> PartialAttributeList
_SearchResultEntry'attributes :: PartialAttributeList
  } deriving ((forall x. SearchResultEntry -> Rep SearchResultEntry x)
-> (forall x. Rep SearchResultEntry x -> SearchResultEntry)
-> Generic SearchResultEntry
forall x. Rep SearchResultEntry x -> SearchResultEntry
forall x. SearchResultEntry -> Rep SearchResultEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchResultEntry x -> SearchResultEntry
$cfrom :: forall x. SearchResultEntry -> Rep SearchResultEntry x
Generic,Int -> SearchResultEntry -> ShowS
[SearchResultEntry] -> ShowS
SearchResultEntry -> String
(Int -> SearchResultEntry -> ShowS)
-> (SearchResultEntry -> String)
-> ([SearchResultEntry] -> ShowS)
-> Show SearchResultEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchResultEntry] -> ShowS
$cshowList :: [SearchResultEntry] -> ShowS
show :: SearchResultEntry -> String
$cshow :: SearchResultEntry -> String
showsPrec :: Int -> SearchResultEntry -> ShowS
$cshowsPrec :: Int -> SearchResultEntry -> ShowS
Show,SearchResultEntry -> SearchResultEntry -> Bool
(SearchResultEntry -> SearchResultEntry -> Bool)
-> (SearchResultEntry -> SearchResultEntry -> Bool)
-> Eq SearchResultEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchResultEntry -> SearchResultEntry -> Bool
$c/= :: SearchResultEntry -> SearchResultEntry -> Bool
== :: SearchResultEntry -> SearchResultEntry -> Bool
$c== :: SearchResultEntry -> SearchResultEntry -> Bool
Eq)

instance NFData SearchResultEntry

instance ASN1 SearchResultEntry where
  asn1defTag :: Proxy SearchResultEntry -> Tag
asn1defTag _ = Word64 -> Tag
Application 4
  asn1decodeCompOf :: ASN1Decode SearchResultEntry
asn1decodeCompOf = LDAPDN -> PartialAttributeList -> SearchResultEntry
SearchResultEntry (LDAPDN -> PartialAttributeList -> SearchResultEntry)
-> ASN1Decode LDAPDN
-> ASN1Decode (PartialAttributeList -> SearchResultEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (PartialAttributeList -> SearchResultEntry)
-> ASN1Decode PartialAttributeList -> ASN1Decode SearchResultEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode PartialAttributeList
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: SearchResultEntry -> ASN1Encode Word64
asn1encodeCompOf (SearchResultEntry v1 :: LDAPDN
v1 v2 :: PartialAttributeList
v2) = (LDAPDN, PartialAttributeList) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,PartialAttributeList
v2)

{- | See 'SearchResultEntry'

> PartialAttributeList ::= SEQUENCE OF
>                      partialAttribute PartialAttribute

-}
type PartialAttributeList = [PartialAttribute]

{- | Partial Attribute  (<https://tools.ietf.org/html/rfc4511#section-4.1.7 RFC4511 Section 4.1.7>)

> PartialAttribute ::= SEQUENCE {
>      type       AttributeDescription,
>      vals       SET OF value AttributeValue }

-}
data PartialAttribute = PartialAttribute
  { PartialAttribute -> LDAPDN
_PartialAttribute'type :: AttributeDescription
  , PartialAttribute -> SET LDAPOID
_PartialAttribute'vals :: SET AttributeValue
  } deriving ((forall x. PartialAttribute -> Rep PartialAttribute x)
-> (forall x. Rep PartialAttribute x -> PartialAttribute)
-> Generic PartialAttribute
forall x. Rep PartialAttribute x -> PartialAttribute
forall x. PartialAttribute -> Rep PartialAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartialAttribute x -> PartialAttribute
$cfrom :: forall x. PartialAttribute -> Rep PartialAttribute x
Generic,Int -> PartialAttribute -> ShowS
PartialAttributeList -> ShowS
PartialAttribute -> String
(Int -> PartialAttribute -> ShowS)
-> (PartialAttribute -> String)
-> (PartialAttributeList -> ShowS)
-> Show PartialAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: PartialAttributeList -> ShowS
$cshowList :: PartialAttributeList -> ShowS
show :: PartialAttribute -> String
$cshow :: PartialAttribute -> String
showsPrec :: Int -> PartialAttribute -> ShowS
$cshowsPrec :: Int -> PartialAttribute -> ShowS
Show,PartialAttribute -> PartialAttribute -> Bool
(PartialAttribute -> PartialAttribute -> Bool)
-> (PartialAttribute -> PartialAttribute -> Bool)
-> Eq PartialAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartialAttribute -> PartialAttribute -> Bool
$c/= :: PartialAttribute -> PartialAttribute -> Bool
== :: PartialAttribute -> PartialAttribute -> Bool
$c== :: PartialAttribute -> PartialAttribute -> Bool
Eq)

instance NFData PartialAttribute

instance ASN1 PartialAttribute where
  asn1decodeCompOf :: ASN1Decode PartialAttribute
asn1decodeCompOf = LDAPDN -> SET LDAPOID -> PartialAttribute
PartialAttribute (LDAPDN -> SET LDAPOID -> PartialAttribute)
-> ASN1Decode LDAPDN
-> ASN1Decode (SET LDAPOID -> PartialAttribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (SET LDAPOID -> PartialAttribute)
-> ASN1Decode (SET LDAPOID) -> ASN1Decode PartialAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (SET LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: PartialAttribute -> ASN1Encode Word64
asn1encodeCompOf (PartialAttribute v1 :: LDAPDN
v1 v2 :: SET LDAPOID
v2) = (LDAPDN, SET LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,SET LDAPOID
v2)


{- | Attribute  (<https://tools.ietf.org/html/rfc4511#section-4.1.7 RFC4511 Section 4.1.7>)

> Attribute ::= PartialAttribute(WITH COMPONENTS {
>      ...,
>      vals (SIZE(1..MAX))})

-}
data Attribute = Attribute
  { Attribute -> LDAPDN
_Attribute'type :: AttributeDescription
  , Attribute -> SET1 LDAPOID
_Attribute'vals :: SET1 AttributeValue
  } deriving ((forall x. Attribute -> Rep Attribute x)
-> (forall x. Rep Attribute x -> Attribute) -> Generic Attribute
forall x. Rep Attribute x -> Attribute
forall x. Attribute -> Rep Attribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Attribute x -> Attribute
$cfrom :: forall x. Attribute -> Rep Attribute x
Generic,Int -> Attribute -> ShowS
[Attribute] -> ShowS
Attribute -> String
(Int -> Attribute -> ShowS)
-> (Attribute -> String)
-> ([Attribute] -> ShowS)
-> Show Attribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Attribute] -> ShowS
$cshowList :: [Attribute] -> ShowS
show :: Attribute -> String
$cshow :: Attribute -> String
showsPrec :: Int -> Attribute -> ShowS
$cshowsPrec :: Int -> Attribute -> ShowS
Show,Attribute -> Attribute -> Bool
(Attribute -> Attribute -> Bool)
-> (Attribute -> Attribute -> Bool) -> Eq Attribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Attribute -> Attribute -> Bool
$c/= :: Attribute -> Attribute -> Bool
== :: Attribute -> Attribute -> Bool
$c== :: Attribute -> Attribute -> Bool
Eq)

instance NFData Attribute

instance ASN1 Attribute where
  asn1decodeCompOf :: ASN1Decode Attribute
asn1decodeCompOf = LDAPDN -> SET1 LDAPOID -> Attribute
Attribute (LDAPDN -> SET1 LDAPOID -> Attribute)
-> ASN1Decode LDAPDN -> ASN1Decode (SET1 LDAPOID -> Attribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (SET1 LDAPOID -> Attribute)
-> ASN1Decode (SET1 LDAPOID) -> ASN1Decode Attribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (SET1 LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: Attribute -> ASN1Encode Word64
asn1encodeCompOf (Attribute v1 :: LDAPDN
v1 v2 :: SET1 LDAPOID
v2) = (LDAPDN, SET1 LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,SET1 LDAPOID
v2)

----------------------------------------------------------------------------

{- | Search Result Done  (<https://tools.ietf.org/html/rfc4511#section-4.5.2 RFC4511 Section 4.5.2>)

> SearchResultDone ::= [APPLICATION 5] LDAPResult

-}
type SearchResultDone = ('APPLICATION 5 `IMPLICIT` LDAPResult)

----------------------------------------------------------------------------

{- | Result Message  (<https://tools.ietf.org/html/rfc4511#section-4.1.9 RFC4511 Section 4.1.9>)

> LDAPResult ::= SEQUENCE {
>      resultCode         ENUMERATED {
>           success                      (0),
>           operationsError              (1),
>           protocolError                (2),
>           timeLimitExceeded            (3),
>           sizeLimitExceeded            (4),
>           compareFalse                 (5),
>           compareTrue                  (6),
>           authMethodNotSupported       (7),
>           strongerAuthRequired         (8),
>                -- 9 reserved --
>           referral                     (10),
>           adminLimitExceeded           (11),
>           unavailableCriticalExtension (12),
>           confidentialityRequired      (13),
>           saslBindInProgress           (14),
>           noSuchAttribute              (16),
>           undefinedAttributeType       (17),
>           inappropriateMatching        (18),
>           constraintViolation          (19),
>           attributeOrValueExists       (20),
>           invalidAttributeSyntax       (21),
>                -- 22-31 unused --
>           noSuchObject                 (32),
>           aliasProblem                 (33),
>           invalidDNSyntax              (34),
>                -- 35 reserved for undefined isLeaf --
>           aliasDereferencingProblem    (36),
>                -- 37-47 unused --
>           inappropriateAuthentication  (48),
>           invalidCredentials           (49),
>           insufficientAccessRights     (50),
>           busy                         (51),
>           unavailable                  (52),
>           unwillingToPerform           (53),
>           loopDetect                   (54),
>                -- 55-63 unused --
>           namingViolation              (64),
>           objectClassViolation         (65),
>           notAllowedOnNonLeaf          (66),
>           notAllowedOnRDN              (67),
>           entryAlreadyExists           (68),
>           objectClassModsProhibited    (69),
>                -- 70 reserved for CLDAP --
>           affectsMultipleDSAs          (71),
>                -- 72-79 unused --
>           other                        (80),
>           ...  },
>      matchedDN          LDAPDN,
>      diagnosticMessage  LDAPString,
>      referral           [3] Referral OPTIONAL }

-}
data LDAPResult = LDAPResult
  { LDAPResult -> ResultCode
_LDAPResult'resultCode        :: ResultCode
  , LDAPResult -> LDAPDN
_LDAPResult'matchedDN         :: LDAPDN
  , LDAPResult -> LDAPDN
_LDAPResult'diagnosticMessage :: LDAPString
  , LDAPResult -> Maybe (IMPLICIT ('CONTEXTUAL 3) Referral)
_LDAPResult'referral          :: Maybe ('CONTEXTUAL 3 `IMPLICIT` Referral)
  } deriving ((forall x. LDAPResult -> Rep LDAPResult x)
-> (forall x. Rep LDAPResult x -> LDAPResult) -> Generic LDAPResult
forall x. Rep LDAPResult x -> LDAPResult
forall x. LDAPResult -> Rep LDAPResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LDAPResult x -> LDAPResult
$cfrom :: forall x. LDAPResult -> Rep LDAPResult x
Generic,Int -> LDAPResult -> ShowS
[LDAPResult] -> ShowS
LDAPResult -> String
(Int -> LDAPResult -> ShowS)
-> (LDAPResult -> String)
-> ([LDAPResult] -> ShowS)
-> Show LDAPResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LDAPResult] -> ShowS
$cshowList :: [LDAPResult] -> ShowS
show :: LDAPResult -> String
$cshow :: LDAPResult -> String
showsPrec :: Int -> LDAPResult -> ShowS
$cshowsPrec :: Int -> LDAPResult -> ShowS
Show,LDAPResult -> LDAPResult -> Bool
(LDAPResult -> LDAPResult -> Bool)
-> (LDAPResult -> LDAPResult -> Bool) -> Eq LDAPResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LDAPResult -> LDAPResult -> Bool
$c/= :: LDAPResult -> LDAPResult -> Bool
== :: LDAPResult -> LDAPResult -> Bool
$c== :: LDAPResult -> LDAPResult -> Bool
Eq)

instance NFData LDAPResult

{- | Referral result code  (<https://tools.ietf.org/html/rfc4511#section-4.1.10 RFC4511 Section 4.1.10>)

> Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI

-}
type Referral = ('CONTEXTUAL 3 `IMPLICIT` NonEmpty URI)

{- |

> URI ::= LDAPString     -- limited to characters permitted in
>                        -- URIs

-}
type URI = LDAPString

instance ASN1 LDAPResult where
  asn1decodeCompOf :: ASN1Decode LDAPResult
asn1decodeCompOf = do
    ResultCode
_LDAPResult'resultCode        <- ASN1Decode ResultCode
forall t. ASN1 t => ASN1Decode t
asn1decode
    LDAPDN
_LDAPResult'matchedDN         <- ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode
    LDAPDN
_LDAPResult'diagnosticMessage <- ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode
    Maybe (IMPLICIT ('CONTEXTUAL 3) Referral)
_LDAPResult'referral          <- ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 3) Referral))
forall t. ASN1 t => ASN1Decode t
asn1decode
    LDAPResult -> ASN1Decode LDAPResult
forall (f :: * -> *) a. Applicative f => a -> f a
pure LDAPResult :: ResultCode
-> LDAPDN
-> LDAPDN
-> Maybe (IMPLICIT ('CONTEXTUAL 3) Referral)
-> LDAPResult
LDAPResult{..}
  asn1encodeCompOf :: LDAPResult -> ASN1Encode Word64
asn1encodeCompOf (LDAPResult v1 :: ResultCode
v1 v2 :: LDAPDN
v2 v3 :: LDAPDN
v3 v4 :: Maybe (IMPLICIT ('CONTEXTUAL 3) Referral)
v4) = (ResultCode, LDAPDN, LDAPDN,
 Maybe (IMPLICIT ('CONTEXTUAL 3) Referral))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (ResultCode
v1,LDAPDN
v2,LDAPDN
v3,Maybe (IMPLICIT ('CONTEXTUAL 3) Referral)
v4)

{- | String Type  (<https://tools.ietf.org/html/rfc4511#section-4.1.2 RFC4511 Section 4.1.2>)

> LDAPString ::= OCTET STRING -- UTF-8 encoded,
>                             -- [ISO10646] characters

-}
type LDAPString = ShortText

{- | Distinguished Name  (<https://tools.ietf.org/html/rfc4511#section-4.1.3 RFC4511 Section 4.1.3>)

> LDAPDN ::= LDAPString -- Constrained to <distinguishedName>
>                       -- [RFC4514]

-}
type LDAPDN = LDAPString

{- | Relative Distinguished Name  (<https://tools.ietf.org/html/rfc4511#section-4.1.3 RFC4511 Section 4.1.3>)

> RelativeLDAPDN ::= LDAPString -- Constrained to <name-component>
>                               -- [RFC4514]

-}
type RelativeLDAPDN = LDAPString

{- | Modify Operation  (<https://tools.ietf.org/html/rfc4511#section-4.6 RFC4511 Section 4.6>)

> ModifyRequest ::= [APPLICATION 6] SEQUENCE {
>      object          LDAPDN,
>      changes         SEQUENCE OF change SEQUENCE {
>           operation       ENUMERATED {
>                add     (0),
>                delete  (1),
>                replace (2),
>                ...  },
>           modification    PartialAttribute } }

-}
data ModifyRequest = ModifyRequest
  { ModifyRequest -> LDAPDN
_ModifyRequest'object  :: LDAPDN
  , ModifyRequest -> [Change]
_ModifyRequest'changes :: [Change]
  } deriving ((forall x. ModifyRequest -> Rep ModifyRequest x)
-> (forall x. Rep ModifyRequest x -> ModifyRequest)
-> Generic ModifyRequest
forall x. Rep ModifyRequest x -> ModifyRequest
forall x. ModifyRequest -> Rep ModifyRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyRequest x -> ModifyRequest
$cfrom :: forall x. ModifyRequest -> Rep ModifyRequest x
Generic,Int -> ModifyRequest -> ShowS
[ModifyRequest] -> ShowS
ModifyRequest -> String
(Int -> ModifyRequest -> ShowS)
-> (ModifyRequest -> String)
-> ([ModifyRequest] -> ShowS)
-> Show ModifyRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyRequest] -> ShowS
$cshowList :: [ModifyRequest] -> ShowS
show :: ModifyRequest -> String
$cshow :: ModifyRequest -> String
showsPrec :: Int -> ModifyRequest -> ShowS
$cshowsPrec :: Int -> ModifyRequest -> ShowS
Show,ModifyRequest -> ModifyRequest -> Bool
(ModifyRequest -> ModifyRequest -> Bool)
-> (ModifyRequest -> ModifyRequest -> Bool) -> Eq ModifyRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyRequest -> ModifyRequest -> Bool
$c/= :: ModifyRequest -> ModifyRequest -> Bool
== :: ModifyRequest -> ModifyRequest -> Bool
$c== :: ModifyRequest -> ModifyRequest -> Bool
Eq)

instance NFData ModifyRequest

instance ASN1 ModifyRequest where
  asn1defTag :: Proxy ModifyRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 6
  asn1decodeCompOf :: ASN1Decode ModifyRequest
asn1decodeCompOf = LDAPDN -> [Change] -> ModifyRequest
ModifyRequest (LDAPDN -> [Change] -> ModifyRequest)
-> ASN1Decode LDAPDN -> ASN1Decode ([Change] -> ModifyRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode ([Change] -> ModifyRequest)
-> ASN1Decode [Change] -> ASN1Decode ModifyRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode [Change]
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: ModifyRequest -> ASN1Encode Word64
asn1encodeCompOf (ModifyRequest v1 :: LDAPDN
v1 v2 :: [Change]
v2) = (LDAPDN, [Change]) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,[Change]
v2)

-- | See 'ModifyRequest'
data Change = Change
  { Change -> Operation
_Change'operation    :: Operation
  , Change -> PartialAttribute
_Change'modification :: PartialAttribute
  } deriving ((forall x. Change -> Rep Change x)
-> (forall x. Rep Change x -> Change) -> Generic Change
forall x. Rep Change x -> Change
forall x. Change -> Rep Change x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Change x -> Change
$cfrom :: forall x. Change -> Rep Change x
Generic,Int -> Change -> ShowS
[Change] -> ShowS
Change -> String
(Int -> Change -> ShowS)
-> (Change -> String) -> ([Change] -> ShowS) -> Show Change
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Change] -> ShowS
$cshowList :: [Change] -> ShowS
show :: Change -> String
$cshow :: Change -> String
showsPrec :: Int -> Change -> ShowS
$cshowsPrec :: Int -> Change -> ShowS
Show,Change -> Change -> Bool
(Change -> Change -> Bool)
-> (Change -> Change -> Bool) -> Eq Change
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Change -> Change -> Bool
$c/= :: Change -> Change -> Bool
== :: Change -> Change -> Bool
$c== :: Change -> Change -> Bool
Eq)

instance NFData Change

instance ASN1 Change where
  asn1decodeCompOf :: ASN1Decode Change
asn1decodeCompOf = Operation -> PartialAttribute -> Change
Change (Operation -> PartialAttribute -> Change)
-> ASN1Decode Operation -> ASN1Decode (PartialAttribute -> Change)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode Operation
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (PartialAttribute -> Change)
-> ASN1Decode PartialAttribute -> ASN1Decode Change
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode PartialAttribute
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: Change -> ASN1Encode Word64
asn1encodeCompOf (Change v1 :: Operation
v1 v2 :: PartialAttribute
v2) = (Operation, PartialAttribute) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (Operation
v1,PartialAttribute
v2)

-- | See 'ModifyRequest' and 'Change'
data Operation
  = Operation'add
  | Operation'delete
  | Operation'replace
  deriving ((forall x. Operation -> Rep Operation x)
-> (forall x. Rep Operation x -> Operation) -> Generic Operation
forall x. Rep Operation x -> Operation
forall x. Operation -> Rep Operation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Operation x -> Operation
$cfrom :: forall x. Operation -> Rep Operation x
Generic,Operation
Operation -> Operation -> Bounded Operation
forall a. a -> a -> Bounded a
maxBound :: Operation
$cmaxBound :: Operation
minBound :: Operation
$cminBound :: Operation
Bounded,Int -> Operation
Operation -> Int
Operation -> [Operation]
Operation -> Operation
Operation -> Operation -> [Operation]
Operation -> Operation -> Operation -> [Operation]
(Operation -> Operation)
-> (Operation -> Operation)
-> (Int -> Operation)
-> (Operation -> Int)
-> (Operation -> [Operation])
-> (Operation -> Operation -> [Operation])
-> (Operation -> Operation -> [Operation])
-> (Operation -> Operation -> Operation -> [Operation])
-> Enum Operation
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Operation -> Operation -> Operation -> [Operation]
$cenumFromThenTo :: Operation -> Operation -> Operation -> [Operation]
enumFromTo :: Operation -> Operation -> [Operation]
$cenumFromTo :: Operation -> Operation -> [Operation]
enumFromThen :: Operation -> Operation -> [Operation]
$cenumFromThen :: Operation -> Operation -> [Operation]
enumFrom :: Operation -> [Operation]
$cenumFrom :: Operation -> [Operation]
fromEnum :: Operation -> Int
$cfromEnum :: Operation -> Int
toEnum :: Int -> Operation
$ctoEnum :: Int -> Operation
pred :: Operation -> Operation
$cpred :: Operation -> Operation
succ :: Operation -> Operation
$csucc :: Operation -> Operation
Enum,Int -> Operation -> ShowS
[Operation] -> ShowS
Operation -> String
(Int -> Operation -> ShowS)
-> (Operation -> String)
-> ([Operation] -> ShowS)
-> Show Operation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Operation] -> ShowS
$cshowList :: [Operation] -> ShowS
show :: Operation -> String
$cshow :: Operation -> String
showsPrec :: Int -> Operation -> ShowS
$cshowsPrec :: Int -> Operation -> ShowS
Show,Operation -> Operation -> Bool
(Operation -> Operation -> Bool)
-> (Operation -> Operation -> Bool) -> Eq Operation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Operation -> Operation -> Bool
$c/= :: Operation -> Operation -> Bool
== :: Operation -> Operation -> Bool
$c== :: Operation -> Operation -> Bool
Eq)

instance NFData Operation where
  rnf :: Operation -> ()
rnf = Operation -> ()
forall a. a -> ()
rwhnf

instance ASN1 Operation where
  asn1decode :: ASN1Decode Operation
asn1decode = ASN1Decode Operation
forall enum. (Bounded enum, Enum enum) => ASN1Decode enum
dec'BoundedEnum
  asn1encode :: Operation -> ASN1Encode Word64
asn1encode = Operation -> ASN1Encode Word64
forall enum. Enum enum => enum -> ASN1Encode Word64
enc'BoundedEnum


{- | Modify Response  (<https://tools.ietf.org/html/rfc4511#section-4.6 RFC4511 Section 4.6>)

> ModifyResponse ::= [APPLICATION 7] LDAPResult

-}
type ModifyResponse = ('APPLICATION 7 `IMPLICIT` LDAPResult)

{- | Add Operation  (<https://tools.ietf.org/html/rfc4511#section-4.7 RFC4511 Section 4.7>)

> AddRequest ::= [APPLICATION 8] SEQUENCE {
>      entry           LDAPDN,
>      attributes      AttributeList }

-}
data AddRequest = AddRequest
  { AddRequest -> LDAPDN
_AddRequest'entry      :: LDAPDN
  , AddRequest -> [Attribute]
_AddRequest'attributes :: AttributeList
  } deriving ((forall x. AddRequest -> Rep AddRequest x)
-> (forall x. Rep AddRequest x -> AddRequest) -> Generic AddRequest
forall x. Rep AddRequest x -> AddRequest
forall x. AddRequest -> Rep AddRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddRequest x -> AddRequest
$cfrom :: forall x. AddRequest -> Rep AddRequest x
Generic,Int -> AddRequest -> ShowS
[AddRequest] -> ShowS
AddRequest -> String
(Int -> AddRequest -> ShowS)
-> (AddRequest -> String)
-> ([AddRequest] -> ShowS)
-> Show AddRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddRequest] -> ShowS
$cshowList :: [AddRequest] -> ShowS
show :: AddRequest -> String
$cshow :: AddRequest -> String
showsPrec :: Int -> AddRequest -> ShowS
$cshowsPrec :: Int -> AddRequest -> ShowS
Show,AddRequest -> AddRequest -> Bool
(AddRequest -> AddRequest -> Bool)
-> (AddRequest -> AddRequest -> Bool) -> Eq AddRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddRequest -> AddRequest -> Bool
$c/= :: AddRequest -> AddRequest -> Bool
== :: AddRequest -> AddRequest -> Bool
$c== :: AddRequest -> AddRequest -> Bool
Eq)

instance NFData AddRequest

instance ASN1 AddRequest where
  asn1defTag :: Proxy AddRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 8
  asn1decodeCompOf :: ASN1Decode AddRequest
asn1decodeCompOf = LDAPDN -> [Attribute] -> AddRequest
AddRequest (LDAPDN -> [Attribute] -> AddRequest)
-> ASN1Decode LDAPDN -> ASN1Decode ([Attribute] -> AddRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode ([Attribute] -> AddRequest)
-> ASN1Decode [Attribute] -> ASN1Decode AddRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode [Attribute]
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: AddRequest -> ASN1Encode Word64
asn1encodeCompOf (AddRequest v1 :: LDAPDN
v1 v2 :: [Attribute]
v2) = (LDAPDN, [Attribute]) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,[Attribute]
v2)

{- | Attribute List

> AttributeList ::= SEQUENCE OF attribute Attribute

-}
type AttributeList = [Attribute]

{- | Add Response  (<https://tools.ietf.org/html/rfc4511#section-4.7 RFC4511 Section 4.7>)

> AddResponse ::= [APPLICATION 9] LDAPResult

-}
type AddResponse = ('APPLICATION 9 `IMPLICIT` LDAPResult)


{- | Delete Operation  (<https://tools.ietf.org/html/rfc4511#section-4.8 RFC4511 Section 4.8>)

> DelRequest ::= [APPLICATION 10] LDAPDN

-}
type DelRequest = ('APPLICATION 10 `IMPLICIT` LDAPDN)

{- | Delete Response  (<https://tools.ietf.org/html/rfc4511#section-4.8 RFC4511 Section 4.8>)

> DelResponse ::= [APPLICATION 11] LDAPResult

-}
type DelResponse = ('APPLICATION 11 `IMPLICIT` LDAPResult)

{- | Modify DN Operation  (<https://tools.ietf.org/html/rfc4511#section-4.9 RFC4511 Section 4.9>)

ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
     entry           LDAPDN,
     newrdn          RelativeLDAPDN,
     deleteoldrdn    BOOLEAN,
     newSuperior     [0] LDAPDN OPTIONAL }

-}
data ModifyDNRequest = ModifyDNRequest
  { ModifyDNRequest -> LDAPDN
_ModifyDNRequest'entry        :: LDAPDN
  , ModifyDNRequest -> LDAPDN
_ModifyDNRequest'newrdn       :: RelativeLDAPDN
  , ModifyDNRequest -> Bool
_ModifyDNRequest'deleteoldrdn :: Bool
  , ModifyDNRequest -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
_ModifyDNRequest'newSuperior  :: Maybe ('CONTEXTUAL 0 `IMPLICIT` LDAPDN)
  } deriving ((forall x. ModifyDNRequest -> Rep ModifyDNRequest x)
-> (forall x. Rep ModifyDNRequest x -> ModifyDNRequest)
-> Generic ModifyDNRequest
forall x. Rep ModifyDNRequest x -> ModifyDNRequest
forall x. ModifyDNRequest -> Rep ModifyDNRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyDNRequest x -> ModifyDNRequest
$cfrom :: forall x. ModifyDNRequest -> Rep ModifyDNRequest x
Generic,Int -> ModifyDNRequest -> ShowS
[ModifyDNRequest] -> ShowS
ModifyDNRequest -> String
(Int -> ModifyDNRequest -> ShowS)
-> (ModifyDNRequest -> String)
-> ([ModifyDNRequest] -> ShowS)
-> Show ModifyDNRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDNRequest] -> ShowS
$cshowList :: [ModifyDNRequest] -> ShowS
show :: ModifyDNRequest -> String
$cshow :: ModifyDNRequest -> String
showsPrec :: Int -> ModifyDNRequest -> ShowS
$cshowsPrec :: Int -> ModifyDNRequest -> ShowS
Show,ModifyDNRequest -> ModifyDNRequest -> Bool
(ModifyDNRequest -> ModifyDNRequest -> Bool)
-> (ModifyDNRequest -> ModifyDNRequest -> Bool)
-> Eq ModifyDNRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDNRequest -> ModifyDNRequest -> Bool
$c/= :: ModifyDNRequest -> ModifyDNRequest -> Bool
== :: ModifyDNRequest -> ModifyDNRequest -> Bool
$c== :: ModifyDNRequest -> ModifyDNRequest -> Bool
Eq)

instance NFData ModifyDNRequest

instance ASN1 ModifyDNRequest where
  asn1defTag :: Proxy ModifyDNRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 12
  asn1decodeCompOf :: ASN1Decode ModifyDNRequest
asn1decodeCompOf = LDAPDN
-> LDAPDN
-> Bool
-> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
-> ModifyDNRequest
ModifyDNRequest (LDAPDN
 -> LDAPDN
 -> Bool
 -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
 -> ModifyDNRequest)
-> ASN1Decode LDAPDN
-> ASN1Decode
     (LDAPDN
      -> Bool
      -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
      -> ModifyDNRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (LDAPDN
   -> Bool
   -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
   -> ModifyDNRequest)
-> ASN1Decode LDAPDN
-> ASN1Decode
     (Bool
      -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN) -> ModifyDNRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Bool
   -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN) -> ModifyDNRequest)
-> ASN1Decode Bool
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN) -> ModifyDNRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode Bool
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN) -> ModifyDNRequest)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN))
-> ASN1Decode ModifyDNRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN))
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: ModifyDNRequest -> ASN1Encode Word64
asn1encodeCompOf (ModifyDNRequest v1 :: LDAPDN
v1 v2 :: LDAPDN
v2 v3 :: Bool
v3 v4 :: Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
v4) = (LDAPDN, LDAPDN, Bool, Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,LDAPDN
v2,Bool
v3,Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPDN)
v4)


{- | Modify DN Response  (<https://tools.ietf.org/html/rfc4511#section-4.9 RFC4511 Section 4.9>)

> ModifyDNResponse ::= [APPLICATION 13] LDAPResult

-}
type ModifyDNResponse = ('APPLICATION 13 `IMPLICIT` LDAPResult)


{- | Compare Operation  (<https://tools.ietf.org/html/rfc4511#section-4.10 RFC4511 Section 4.10>)

> CompareRequest ::= [APPLICATION 14] SEQUENCE {
>      entry           LDAPDN,
>      ava             AttributeValueAssertion }

-}
data CompareRequest = CompareRequest
  { CompareRequest -> LDAPDN
_CompareRequest'entry :: LDAPDN
  , CompareRequest -> AttributeValueAssertion
_CompareRequest'ava   :: AttributeValueAssertion
  } deriving ((forall x. CompareRequest -> Rep CompareRequest x)
-> (forall x. Rep CompareRequest x -> CompareRequest)
-> Generic CompareRequest
forall x. Rep CompareRequest x -> CompareRequest
forall x. CompareRequest -> Rep CompareRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompareRequest x -> CompareRequest
$cfrom :: forall x. CompareRequest -> Rep CompareRequest x
Generic,Int -> CompareRequest -> ShowS
[CompareRequest] -> ShowS
CompareRequest -> String
(Int -> CompareRequest -> ShowS)
-> (CompareRequest -> String)
-> ([CompareRequest] -> ShowS)
-> Show CompareRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompareRequest] -> ShowS
$cshowList :: [CompareRequest] -> ShowS
show :: CompareRequest -> String
$cshow :: CompareRequest -> String
showsPrec :: Int -> CompareRequest -> ShowS
$cshowsPrec :: Int -> CompareRequest -> ShowS
Show,CompareRequest -> CompareRequest -> Bool
(CompareRequest -> CompareRequest -> Bool)
-> (CompareRequest -> CompareRequest -> Bool) -> Eq CompareRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompareRequest -> CompareRequest -> Bool
$c/= :: CompareRequest -> CompareRequest -> Bool
== :: CompareRequest -> CompareRequest -> Bool
$c== :: CompareRequest -> CompareRequest -> Bool
Eq)

instance NFData CompareRequest

instance ASN1 CompareRequest where
  asn1defTag :: Proxy CompareRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 14
  asn1decodeCompOf :: ASN1Decode CompareRequest
asn1decodeCompOf = LDAPDN -> AttributeValueAssertion -> CompareRequest
CompareRequest (LDAPDN -> AttributeValueAssertion -> CompareRequest)
-> ASN1Decode LDAPDN
-> ASN1Decode (AttributeValueAssertion -> CompareRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode LDAPDN
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode (AttributeValueAssertion -> CompareRequest)
-> ASN1Decode AttributeValueAssertion -> ASN1Decode CompareRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode AttributeValueAssertion
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: CompareRequest -> ASN1Encode Word64
asn1encodeCompOf (CompareRequest v1 :: LDAPDN
v1 v2 :: AttributeValueAssertion
v2) = (LDAPDN, AttributeValueAssertion) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (LDAPDN
v1,AttributeValueAssertion
v2)

{- | Compare Response  (<https://tools.ietf.org/html/rfc4511#section-4.10 RFC4511 Section 4.10>)

> CompareResponse ::= [APPLICATION 15] LDAPResult

-}
type CompareResponse = ('APPLICATION 15 `IMPLICIT` LDAPResult)


{- | Abandon Operation  (<https://tools.ietf.org/html/rfc4511#section-4.11 RFC4511 Section 4.11>)

> AbandonRequest ::= [APPLICATION 16] MessageID

-}
type AbandonRequest = ('APPLICATION 16 `IMPLICIT` MessageID)

{- | Extended Request  (<https://tools.ietf.org/html/rfc4511#section-4.12 RFC4511 Section 4.12>)

> ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
>      requestName      [0] LDAPOID,
>      requestValue     [1] OCTET STRING OPTIONAL }

-}
data ExtendedRequest = ExtendedRequest
  { ExtendedRequest -> IMPLICIT ('CONTEXTUAL 0) LDAPOID
_ExtendedRequest'responseName  ::       ('CONTEXTUAL 0 `IMPLICIT` LDAPOID)
  , ExtendedRequest -> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
_ExtendedRequest'responseValue :: Maybe ('CONTEXTUAL 1 `IMPLICIT` OCTET_STRING)
  } deriving ((forall x. ExtendedRequest -> Rep ExtendedRequest x)
-> (forall x. Rep ExtendedRequest x -> ExtendedRequest)
-> Generic ExtendedRequest
forall x. Rep ExtendedRequest x -> ExtendedRequest
forall x. ExtendedRequest -> Rep ExtendedRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExtendedRequest x -> ExtendedRequest
$cfrom :: forall x. ExtendedRequest -> Rep ExtendedRequest x
Generic,Int -> ExtendedRequest -> ShowS
[ExtendedRequest] -> ShowS
ExtendedRequest -> String
(Int -> ExtendedRequest -> ShowS)
-> (ExtendedRequest -> String)
-> ([ExtendedRequest] -> ShowS)
-> Show ExtendedRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExtendedRequest] -> ShowS
$cshowList :: [ExtendedRequest] -> ShowS
show :: ExtendedRequest -> String
$cshow :: ExtendedRequest -> String
showsPrec :: Int -> ExtendedRequest -> ShowS
$cshowsPrec :: Int -> ExtendedRequest -> ShowS
Show,ExtendedRequest -> ExtendedRequest -> Bool
(ExtendedRequest -> ExtendedRequest -> Bool)
-> (ExtendedRequest -> ExtendedRequest -> Bool)
-> Eq ExtendedRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExtendedRequest -> ExtendedRequest -> Bool
$c/= :: ExtendedRequest -> ExtendedRequest -> Bool
== :: ExtendedRequest -> ExtendedRequest -> Bool
$c== :: ExtendedRequest -> ExtendedRequest -> Bool
Eq)

instance NFData ExtendedRequest

instance ASN1 ExtendedRequest where
  asn1defTag :: Proxy ExtendedRequest -> Tag
asn1defTag _ = Word64 -> Tag
Application 23
  asn1decodeCompOf :: ASN1Decode ExtendedRequest
asn1decodeCompOf = IMPLICIT ('CONTEXTUAL 0) LDAPOID
-> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> ExtendedRequest
ExtendedRequest (IMPLICIT ('CONTEXTUAL 0) LDAPOID
 -> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> ExtendedRequest)
-> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> ExtendedRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> ExtendedRequest)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
-> ASN1Decode ExtendedRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: ExtendedRequest -> ASN1Encode Word64
asn1encodeCompOf (ExtendedRequest v1 :: IMPLICIT ('CONTEXTUAL 0) LDAPOID
v1 v2 :: Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
v2) = (IMPLICIT ('CONTEXTUAL 0) LDAPOID,
 Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (IMPLICIT ('CONTEXTUAL 0) LDAPOID
v1,Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
v2)

{- | Extended Response  (<https://tools.ietf.org/html/rfc4511#section-4.12 RFC4511 Section 4.12>)

> ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
>      COMPONENTS OF LDAPResult,
>      responseName     [10] LDAPOID OPTIONAL,
>      responseValue    [11] OCTET STRING OPTIONAL }

-}
data ExtendedResponse = ExtendedResponse
  { ExtendedResponse -> LDAPResult
_ExtendedResponse'LDAPResult    :: LDAPResult
  , ExtendedResponse -> Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID)
_ExtendedResponse'responseName  :: Maybe ('CONTEXTUAL 10 `IMPLICIT` LDAPOID)
  , ExtendedResponse -> Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID)
_ExtendedResponse'responseValue :: Maybe ('CONTEXTUAL 11 `IMPLICIT` OCTET_STRING)
  } deriving ((forall x. ExtendedResponse -> Rep ExtendedResponse x)
-> (forall x. Rep ExtendedResponse x -> ExtendedResponse)
-> Generic ExtendedResponse
forall x. Rep ExtendedResponse x -> ExtendedResponse
forall x. ExtendedResponse -> Rep ExtendedResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExtendedResponse x -> ExtendedResponse
$cfrom :: forall x. ExtendedResponse -> Rep ExtendedResponse x
Generic,Int -> ExtendedResponse -> ShowS
[ExtendedResponse] -> ShowS
ExtendedResponse -> String
(Int -> ExtendedResponse -> ShowS)
-> (ExtendedResponse -> String)
-> ([ExtendedResponse] -> ShowS)
-> Show ExtendedResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExtendedResponse] -> ShowS
$cshowList :: [ExtendedResponse] -> ShowS
show :: ExtendedResponse -> String
$cshow :: ExtendedResponse -> String
showsPrec :: Int -> ExtendedResponse -> ShowS
$cshowsPrec :: Int -> ExtendedResponse -> ShowS
Show,ExtendedResponse -> ExtendedResponse -> Bool
(ExtendedResponse -> ExtendedResponse -> Bool)
-> (ExtendedResponse -> ExtendedResponse -> Bool)
-> Eq ExtendedResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExtendedResponse -> ExtendedResponse -> Bool
$c/= :: ExtendedResponse -> ExtendedResponse -> Bool
== :: ExtendedResponse -> ExtendedResponse -> Bool
$c== :: ExtendedResponse -> ExtendedResponse -> Bool
Eq)

instance NFData ExtendedResponse

instance ASN1 ExtendedResponse where
  asn1defTag :: Proxy ExtendedResponse -> Tag
asn1defTag _ = Word64 -> Tag
Application 24
  asn1decodeCompOf :: ASN1Decode ExtendedResponse
asn1decodeCompOf = do
    LDAPResult
_ExtendedResponse'LDAPResult    <- ASN1Decode LDAPResult
forall t. ASN1 t => ASN1Decode t
asn1decodeCompOf
    Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID)
_ExtendedResponse'responseName  <- ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode
    Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID)
_ExtendedResponse'responseValue <- ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode
    ExtendedResponse -> ASN1Decode ExtendedResponse
forall (f :: * -> *) a. Applicative f => a -> f a
pure ExtendedResponse :: LDAPResult
-> Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID)
-> Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID)
-> ExtendedResponse
ExtendedResponse{..}

  asn1encodeCompOf :: ExtendedResponse -> ASN1Encode Word64
asn1encodeCompOf (ExtendedResponse{..})
    = [ASN1Encode Word64] -> ASN1Encode Word64
enc'SEQUENCE_COMPS [ LDAPResult -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf LDAPResult
_ExtendedResponse'LDAPResult
                         , Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode       Maybe (IMPLICIT ('CONTEXTUAL 10) LDAPOID)
_ExtendedResponse'responseName
                         , Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID) -> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encode       Maybe (IMPLICIT ('CONTEXTUAL 11) LDAPOID)
_ExtendedResponse'responseValue
                         ]


{- | Intermediate Response  (<https://tools.ietf.org/html/rfc4511#section-4.13 RFC4511 Section 4.13>)

> IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
>         responseName     [0] LDAPOID OPTIONAL,
>         responseValue    [1] OCTET STRING OPTIONAL }

-}
data IntermediateResponse = IntermediateResponse
  { IntermediateResponse -> Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
_IntermediateResponse'responseName  :: Maybe ('CONTEXTUAL 0 `IMPLICIT` LDAPOID)
  , IntermediateResponse -> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
_IntermediateResponse'responseValue :: Maybe ('CONTEXTUAL 1 `IMPLICIT` OCTET_STRING)
  } deriving ((forall x. IntermediateResponse -> Rep IntermediateResponse x)
-> (forall x. Rep IntermediateResponse x -> IntermediateResponse)
-> Generic IntermediateResponse
forall x. Rep IntermediateResponse x -> IntermediateResponse
forall x. IntermediateResponse -> Rep IntermediateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IntermediateResponse x -> IntermediateResponse
$cfrom :: forall x. IntermediateResponse -> Rep IntermediateResponse x
Generic,Int -> IntermediateResponse -> ShowS
[IntermediateResponse] -> ShowS
IntermediateResponse -> String
(Int -> IntermediateResponse -> ShowS)
-> (IntermediateResponse -> String)
-> ([IntermediateResponse] -> ShowS)
-> Show IntermediateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntermediateResponse] -> ShowS
$cshowList :: [IntermediateResponse] -> ShowS
show :: IntermediateResponse -> String
$cshow :: IntermediateResponse -> String
showsPrec :: Int -> IntermediateResponse -> ShowS
$cshowsPrec :: Int -> IntermediateResponse -> ShowS
Show,IntermediateResponse -> IntermediateResponse -> Bool
(IntermediateResponse -> IntermediateResponse -> Bool)
-> (IntermediateResponse -> IntermediateResponse -> Bool)
-> Eq IntermediateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntermediateResponse -> IntermediateResponse -> Bool
$c/= :: IntermediateResponse -> IntermediateResponse -> Bool
== :: IntermediateResponse -> IntermediateResponse -> Bool
$c== :: IntermediateResponse -> IntermediateResponse -> Bool
Eq)

instance NFData IntermediateResponse

instance ASN1 IntermediateResponse where
  asn1defTag :: Proxy IntermediateResponse -> Tag
asn1defTag _ = Word64 -> Tag
Application 25
  asn1decodeCompOf :: ASN1Decode IntermediateResponse
asn1decodeCompOf = Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
-> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> IntermediateResponse
IntermediateResponse (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
 -> Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
 -> IntermediateResponse)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID))
-> ASN1Decode
     (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> IntermediateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode ASN1Decode
  (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID) -> IntermediateResponse)
-> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
-> ASN1Decode IntermediateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ASN1Decode (Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
forall t. ASN1 t => ASN1Decode t
asn1decode
  asn1encodeCompOf :: IntermediateResponse -> ASN1Encode Word64
asn1encodeCompOf (IntermediateResponse v1 :: Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
v1 v2 :: Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
v2) = (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID),
 Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID))
-> ASN1Encode Word64
forall t. ASN1 t => t -> ASN1Encode Word64
asn1encodeCompOf (Maybe (IMPLICIT ('CONTEXTUAL 0) LDAPOID)
v1,Maybe (IMPLICIT ('CONTEXTUAL 1) LDAPOID)
v2)