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

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

-- |
-- Module      : Amazonka.IoT.Types.ResourceIdentifier
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.ResourceIdentifier where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.PolicyVersionIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information that identifies the noncompliant resource.
--
-- /See:/ 'newResourceIdentifier' smart constructor.
data ResourceIdentifier = ResourceIdentifier'
  { -- | The ARN of the IAM role that has overly permissive actions.
    ResourceIdentifier -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The client ID.
    ResourceIdentifier -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the role alias that has overly permissive actions.
    ResourceIdentifier -> Maybe Text
roleAliasArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the CA certificate used to authorize the certificate.
    ResourceIdentifier -> Maybe Text
caCertificateId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the certificate attached to the resource.
    ResourceIdentifier -> Maybe Text
deviceCertificateId :: Prelude.Maybe Prelude.Text,
    -- | The account with which the resource is associated.
    ResourceIdentifier -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
    -- | The version of the policy associated with the resource.
    ResourceIdentifier -> Maybe PolicyVersionIdentifier
policyVersionIdentifier :: Prelude.Maybe PolicyVersionIdentifier,
    -- | The ID of the Amazon Cognito identity pool.
    ResourceIdentifier -> Maybe Text
cognitoIdentityPoolId :: Prelude.Maybe Prelude.Text
  }
  deriving (ResourceIdentifier -> ResourceIdentifier -> Bool
(ResourceIdentifier -> ResourceIdentifier -> Bool)
-> (ResourceIdentifier -> ResourceIdentifier -> Bool)
-> Eq ResourceIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceIdentifier -> ResourceIdentifier -> Bool
$c/= :: ResourceIdentifier -> ResourceIdentifier -> Bool
== :: ResourceIdentifier -> ResourceIdentifier -> Bool
$c== :: ResourceIdentifier -> ResourceIdentifier -> Bool
Prelude.Eq, ReadPrec [ResourceIdentifier]
ReadPrec ResourceIdentifier
Int -> ReadS ResourceIdentifier
ReadS [ResourceIdentifier]
(Int -> ReadS ResourceIdentifier)
-> ReadS [ResourceIdentifier]
-> ReadPrec ResourceIdentifier
-> ReadPrec [ResourceIdentifier]
-> Read ResourceIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceIdentifier]
$creadListPrec :: ReadPrec [ResourceIdentifier]
readPrec :: ReadPrec ResourceIdentifier
$creadPrec :: ReadPrec ResourceIdentifier
readList :: ReadS [ResourceIdentifier]
$creadList :: ReadS [ResourceIdentifier]
readsPrec :: Int -> ReadS ResourceIdentifier
$creadsPrec :: Int -> ReadS ResourceIdentifier
Prelude.Read, Int -> ResourceIdentifier -> ShowS
[ResourceIdentifier] -> ShowS
ResourceIdentifier -> String
(Int -> ResourceIdentifier -> ShowS)
-> (ResourceIdentifier -> String)
-> ([ResourceIdentifier] -> ShowS)
-> Show ResourceIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceIdentifier] -> ShowS
$cshowList :: [ResourceIdentifier] -> ShowS
show :: ResourceIdentifier -> String
$cshow :: ResourceIdentifier -> String
showsPrec :: Int -> ResourceIdentifier -> ShowS
$cshowsPrec :: Int -> ResourceIdentifier -> ShowS
Prelude.Show, (forall x. ResourceIdentifier -> Rep ResourceIdentifier x)
-> (forall x. Rep ResourceIdentifier x -> ResourceIdentifier)
-> Generic ResourceIdentifier
forall x. Rep ResourceIdentifier x -> ResourceIdentifier
forall x. ResourceIdentifier -> Rep ResourceIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceIdentifier x -> ResourceIdentifier
$cfrom :: forall x. ResourceIdentifier -> Rep ResourceIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'ResourceIdentifier' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'iamRoleArn', 'resourceIdentifier_iamRoleArn' - The ARN of the IAM role that has overly permissive actions.
--
-- 'clientId', 'resourceIdentifier_clientId' - The client ID.
--
-- 'roleAliasArn', 'resourceIdentifier_roleAliasArn' - The ARN of the role alias that has overly permissive actions.
--
-- 'caCertificateId', 'resourceIdentifier_caCertificateId' - The ID of the CA certificate used to authorize the certificate.
--
-- 'deviceCertificateId', 'resourceIdentifier_deviceCertificateId' - The ID of the certificate attached to the resource.
--
-- 'account', 'resourceIdentifier_account' - The account with which the resource is associated.
--
-- 'policyVersionIdentifier', 'resourceIdentifier_policyVersionIdentifier' - The version of the policy associated with the resource.
--
-- 'cognitoIdentityPoolId', 'resourceIdentifier_cognitoIdentityPoolId' - The ID of the Amazon Cognito identity pool.
newResourceIdentifier ::
  ResourceIdentifier
newResourceIdentifier :: ResourceIdentifier
newResourceIdentifier =
  ResourceIdentifier' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PolicyVersionIdentifier
-> Maybe Text
-> ResourceIdentifier
ResourceIdentifier'
    { $sel:iamRoleArn:ResourceIdentifier' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientId:ResourceIdentifier' :: Maybe Text
clientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleAliasArn:ResourceIdentifier' :: Maybe Text
roleAliasArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:caCertificateId:ResourceIdentifier' :: Maybe Text
caCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceCertificateId:ResourceIdentifier' :: Maybe Text
deviceCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:account:ResourceIdentifier' :: Maybe Text
account = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:policyVersionIdentifier:ResourceIdentifier' :: Maybe PolicyVersionIdentifier
policyVersionIdentifier = Maybe PolicyVersionIdentifier
forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoIdentityPoolId:ResourceIdentifier' :: Maybe Text
cognitoIdentityPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the IAM role that has overly permissive actions.
resourceIdentifier_iamRoleArn :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_iamRoleArn :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_iamRoleArn = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:iamRoleArn:ResourceIdentifier' :: Maybe Text
iamRoleArn = Maybe Text
a} :: ResourceIdentifier)

-- | The client ID.
resourceIdentifier_clientId :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_clientId :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_clientId = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
clientId :: Maybe Text
$sel:clientId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:clientId:ResourceIdentifier' :: Maybe Text
clientId = Maybe Text
a} :: ResourceIdentifier)

-- | The ARN of the role alias that has overly permissive actions.
resourceIdentifier_roleAliasArn :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_roleAliasArn :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_roleAliasArn = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
roleAliasArn :: Maybe Text
$sel:roleAliasArn:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
roleAliasArn} -> Maybe Text
roleAliasArn) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:roleAliasArn:ResourceIdentifier' :: Maybe Text
roleAliasArn = Maybe Text
a} :: ResourceIdentifier)

-- | The ID of the CA certificate used to authorize the certificate.
resourceIdentifier_caCertificateId :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_caCertificateId :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_caCertificateId = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
caCertificateId :: Maybe Text
$sel:caCertificateId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
caCertificateId} -> Maybe Text
caCertificateId) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:caCertificateId:ResourceIdentifier' :: Maybe Text
caCertificateId = Maybe Text
a} :: ResourceIdentifier)

-- | The ID of the certificate attached to the resource.
resourceIdentifier_deviceCertificateId :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_deviceCertificateId :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_deviceCertificateId = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
deviceCertificateId :: Maybe Text
$sel:deviceCertificateId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
deviceCertificateId} -> Maybe Text
deviceCertificateId) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:deviceCertificateId:ResourceIdentifier' :: Maybe Text
deviceCertificateId = Maybe Text
a} :: ResourceIdentifier)

-- | The account with which the resource is associated.
resourceIdentifier_account :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_account :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_account = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
account :: Maybe Text
$sel:account:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
account} -> Maybe Text
account) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:account:ResourceIdentifier' :: Maybe Text
account = Maybe Text
a} :: ResourceIdentifier)

-- | The version of the policy associated with the resource.
resourceIdentifier_policyVersionIdentifier :: Lens.Lens' ResourceIdentifier (Prelude.Maybe PolicyVersionIdentifier)
resourceIdentifier_policyVersionIdentifier :: (Maybe PolicyVersionIdentifier
 -> f (Maybe PolicyVersionIdentifier))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_policyVersionIdentifier = (ResourceIdentifier -> Maybe PolicyVersionIdentifier)
-> (ResourceIdentifier
    -> Maybe PolicyVersionIdentifier -> ResourceIdentifier)
-> Lens
     ResourceIdentifier
     ResourceIdentifier
     (Maybe PolicyVersionIdentifier)
     (Maybe PolicyVersionIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe PolicyVersionIdentifier
policyVersionIdentifier :: Maybe PolicyVersionIdentifier
$sel:policyVersionIdentifier:ResourceIdentifier' :: ResourceIdentifier -> Maybe PolicyVersionIdentifier
policyVersionIdentifier} -> Maybe PolicyVersionIdentifier
policyVersionIdentifier) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe PolicyVersionIdentifier
a -> ResourceIdentifier
s {$sel:policyVersionIdentifier:ResourceIdentifier' :: Maybe PolicyVersionIdentifier
policyVersionIdentifier = Maybe PolicyVersionIdentifier
a} :: ResourceIdentifier)

-- | The ID of the Amazon Cognito identity pool.
resourceIdentifier_cognitoIdentityPoolId :: Lens.Lens' ResourceIdentifier (Prelude.Maybe Prelude.Text)
resourceIdentifier_cognitoIdentityPoolId :: (Maybe Text -> f (Maybe Text))
-> ResourceIdentifier -> f ResourceIdentifier
resourceIdentifier_cognitoIdentityPoolId = (ResourceIdentifier -> Maybe Text)
-> (ResourceIdentifier -> Maybe Text -> ResourceIdentifier)
-> Lens
     ResourceIdentifier ResourceIdentifier (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceIdentifier' {Maybe Text
cognitoIdentityPoolId :: Maybe Text
$sel:cognitoIdentityPoolId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
cognitoIdentityPoolId} -> Maybe Text
cognitoIdentityPoolId) (\s :: ResourceIdentifier
s@ResourceIdentifier' {} Maybe Text
a -> ResourceIdentifier
s {$sel:cognitoIdentityPoolId:ResourceIdentifier' :: Maybe Text
cognitoIdentityPoolId = Maybe Text
a} :: ResourceIdentifier)

instance Core.FromJSON ResourceIdentifier where
  parseJSON :: Value -> Parser ResourceIdentifier
parseJSON =
    String
-> (Object -> Parser ResourceIdentifier)
-> Value
-> Parser ResourceIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceIdentifier"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PolicyVersionIdentifier
-> Maybe Text
-> ResourceIdentifier
ResourceIdentifier'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe PolicyVersionIdentifier
 -> Maybe Text
 -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe PolicyVersionIdentifier
      -> Maybe Text
      -> ResourceIdentifier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iamRoleArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe PolicyVersionIdentifier
   -> Maybe Text
   -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe PolicyVersionIdentifier
      -> Maybe Text
      -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clientId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe PolicyVersionIdentifier
   -> Maybe Text
   -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe PolicyVersionIdentifier
      -> Maybe Text
      -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roleAliasArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe PolicyVersionIdentifier
   -> Maybe Text
   -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe PolicyVersionIdentifier
      -> Maybe Text
      -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"caCertificateId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe PolicyVersionIdentifier
   -> Maybe Text
   -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe PolicyVersionIdentifier
      -> Maybe Text
      -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deviceCertificateId")
            Parser
  (Maybe Text
   -> Maybe PolicyVersionIdentifier
   -> Maybe Text
   -> ResourceIdentifier)
-> Parser (Maybe Text)
-> Parser
     (Maybe PolicyVersionIdentifier -> Maybe Text -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"account")
            Parser
  (Maybe PolicyVersionIdentifier -> Maybe Text -> ResourceIdentifier)
-> Parser (Maybe PolicyVersionIdentifier)
-> Parser (Maybe Text -> ResourceIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyVersionIdentifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"policyVersionIdentifier")
            Parser (Maybe Text -> ResourceIdentifier)
-> Parser (Maybe Text) -> Parser ResourceIdentifier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cognitoIdentityPoolId")
      )

instance Prelude.Hashable ResourceIdentifier

instance Prelude.NFData ResourceIdentifier

instance Core.ToJSON ResourceIdentifier where
  toJSON :: ResourceIdentifier -> Value
toJSON ResourceIdentifier' {Maybe Text
Maybe PolicyVersionIdentifier
cognitoIdentityPoolId :: Maybe Text
policyVersionIdentifier :: Maybe PolicyVersionIdentifier
account :: Maybe Text
deviceCertificateId :: Maybe Text
caCertificateId :: Maybe Text
roleAliasArn :: Maybe Text
clientId :: Maybe Text
iamRoleArn :: Maybe Text
$sel:cognitoIdentityPoolId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:policyVersionIdentifier:ResourceIdentifier' :: ResourceIdentifier -> Maybe PolicyVersionIdentifier
$sel:account:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:deviceCertificateId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:caCertificateId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:roleAliasArn:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:clientId:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
$sel:iamRoleArn:ResourceIdentifier' :: ResourceIdentifier -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"iamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
iamRoleArn,
            (Text
"clientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientId,
            (Text
"roleAliasArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleAliasArn,
            (Text
"caCertificateId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
caCertificateId,
            (Text
"deviceCertificateId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceCertificateId,
            (Text
"account" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
account,
            (Text
"policyVersionIdentifier" Text -> PolicyVersionIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PolicyVersionIdentifier -> Pair)
-> Maybe PolicyVersionIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PolicyVersionIdentifier
policyVersionIdentifier,
            (Text
"cognitoIdentityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cognitoIdentityPoolId
          ]
      )