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

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

-- |
-- Module      : Amazonka.CloudDirectory.CreateFacet
-- 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)
--
-- Creates a new Facet in a schema. Facet creation is allowed only in
-- development or applied schemas.
module Amazonka.CloudDirectory.CreateFacet
  ( -- * Creating a Request
    CreateFacet (..),
    newCreateFacet,

    -- * Request Lenses
    createFacet_facetStyle,
    createFacet_objectType,
    createFacet_attributes,
    createFacet_schemaArn,
    createFacet_name,

    -- * Destructuring the Response
    CreateFacetResponse (..),
    newCreateFacetResponse,

    -- * Response Lenses
    createFacetResponse_httpStatus,
  )
where

import Amazonka.CloudDirectory.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateFacet' smart constructor.
data CreateFacet = CreateFacet'
  { -- | There are two different styles that you can define on any given facet,
    -- @Static@ and @Dynamic@. For static facets, all attributes must be
    -- defined in the schema. For dynamic facets, attributes can be defined
    -- during data plane operations.
    CreateFacet -> Maybe FacetStyle
facetStyle :: Prelude.Maybe FacetStyle,
    -- | Specifies whether a given object created from this facet is of type
    -- node, leaf node, policy or index.
    --
    -- -   Node: Can have multiple children but one parent.
    --
    -- -   Leaf node: Cannot have children but can have multiple parents.
    --
    -- -   Policy: Allows you to store a policy document and policy type. For
    --     more information, see
    --     <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/key_concepts_directory.html#key_concepts_policies Policies>.
    --
    -- -   Index: Can be created with the Index API.
    CreateFacet -> Maybe ObjectType
objectType :: Prelude.Maybe ObjectType,
    -- | The attributes that are associated with the Facet.
    CreateFacet -> Maybe [FacetAttribute]
attributes :: Prelude.Maybe [FacetAttribute],
    -- | The schema ARN in which the new Facet will be created. For more
    -- information, see arns.
    CreateFacet -> Text
schemaArn :: Prelude.Text,
    -- | The name of the Facet, which is unique for a given schema.
    CreateFacet -> Text
name :: Prelude.Text
  }
  deriving (CreateFacet -> CreateFacet -> Bool
(CreateFacet -> CreateFacet -> Bool)
-> (CreateFacet -> CreateFacet -> Bool) -> Eq CreateFacet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFacet -> CreateFacet -> Bool
$c/= :: CreateFacet -> CreateFacet -> Bool
== :: CreateFacet -> CreateFacet -> Bool
$c== :: CreateFacet -> CreateFacet -> Bool
Prelude.Eq, ReadPrec [CreateFacet]
ReadPrec CreateFacet
Int -> ReadS CreateFacet
ReadS [CreateFacet]
(Int -> ReadS CreateFacet)
-> ReadS [CreateFacet]
-> ReadPrec CreateFacet
-> ReadPrec [CreateFacet]
-> Read CreateFacet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFacet]
$creadListPrec :: ReadPrec [CreateFacet]
readPrec :: ReadPrec CreateFacet
$creadPrec :: ReadPrec CreateFacet
readList :: ReadS [CreateFacet]
$creadList :: ReadS [CreateFacet]
readsPrec :: Int -> ReadS CreateFacet
$creadsPrec :: Int -> ReadS CreateFacet
Prelude.Read, Int -> CreateFacet -> ShowS
[CreateFacet] -> ShowS
CreateFacet -> String
(Int -> CreateFacet -> ShowS)
-> (CreateFacet -> String)
-> ([CreateFacet] -> ShowS)
-> Show CreateFacet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFacet] -> ShowS
$cshowList :: [CreateFacet] -> ShowS
show :: CreateFacet -> String
$cshow :: CreateFacet -> String
showsPrec :: Int -> CreateFacet -> ShowS
$cshowsPrec :: Int -> CreateFacet -> ShowS
Prelude.Show, (forall x. CreateFacet -> Rep CreateFacet x)
-> (forall x. Rep CreateFacet x -> CreateFacet)
-> Generic CreateFacet
forall x. Rep CreateFacet x -> CreateFacet
forall x. CreateFacet -> Rep CreateFacet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFacet x -> CreateFacet
$cfrom :: forall x. CreateFacet -> Rep CreateFacet x
Prelude.Generic)

-- |
-- Create a value of 'CreateFacet' 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:
--
-- 'facetStyle', 'createFacet_facetStyle' - There are two different styles that you can define on any given facet,
-- @Static@ and @Dynamic@. For static facets, all attributes must be
-- defined in the schema. For dynamic facets, attributes can be defined
-- during data plane operations.
--
-- 'objectType', 'createFacet_objectType' - Specifies whether a given object created from this facet is of type
-- node, leaf node, policy or index.
--
-- -   Node: Can have multiple children but one parent.
--
-- -   Leaf node: Cannot have children but can have multiple parents.
--
-- -   Policy: Allows you to store a policy document and policy type. For
--     more information, see
--     <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/key_concepts_directory.html#key_concepts_policies Policies>.
--
-- -   Index: Can be created with the Index API.
--
-- 'attributes', 'createFacet_attributes' - The attributes that are associated with the Facet.
--
-- 'schemaArn', 'createFacet_schemaArn' - The schema ARN in which the new Facet will be created. For more
-- information, see arns.
--
-- 'name', 'createFacet_name' - The name of the Facet, which is unique for a given schema.
newCreateFacet ::
  -- | 'schemaArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  CreateFacet
newCreateFacet :: Text -> Text -> CreateFacet
newCreateFacet Text
pSchemaArn_ Text
pName_ =
  CreateFacet' :: Maybe FacetStyle
-> Maybe ObjectType
-> Maybe [FacetAttribute]
-> Text
-> Text
-> CreateFacet
CreateFacet'
    { $sel:facetStyle:CreateFacet' :: Maybe FacetStyle
facetStyle = Maybe FacetStyle
forall a. Maybe a
Prelude.Nothing,
      $sel:objectType:CreateFacet' :: Maybe ObjectType
objectType = Maybe ObjectType
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:CreateFacet' :: Maybe [FacetAttribute]
attributes = Maybe [FacetAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:CreateFacet' :: Text
schemaArn = Text
pSchemaArn_,
      $sel:name:CreateFacet' :: Text
name = Text
pName_
    }

-- | There are two different styles that you can define on any given facet,
-- @Static@ and @Dynamic@. For static facets, all attributes must be
-- defined in the schema. For dynamic facets, attributes can be defined
-- during data plane operations.
createFacet_facetStyle :: Lens.Lens' CreateFacet (Prelude.Maybe FacetStyle)
createFacet_facetStyle :: (Maybe FacetStyle -> f (Maybe FacetStyle))
-> CreateFacet -> f CreateFacet
createFacet_facetStyle = (CreateFacet -> Maybe FacetStyle)
-> (CreateFacet -> Maybe FacetStyle -> CreateFacet)
-> Lens
     CreateFacet CreateFacet (Maybe FacetStyle) (Maybe FacetStyle)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacet' {Maybe FacetStyle
facetStyle :: Maybe FacetStyle
$sel:facetStyle:CreateFacet' :: CreateFacet -> Maybe FacetStyle
facetStyle} -> Maybe FacetStyle
facetStyle) (\s :: CreateFacet
s@CreateFacet' {} Maybe FacetStyle
a -> CreateFacet
s {$sel:facetStyle:CreateFacet' :: Maybe FacetStyle
facetStyle = Maybe FacetStyle
a} :: CreateFacet)

-- | Specifies whether a given object created from this facet is of type
-- node, leaf node, policy or index.
--
-- -   Node: Can have multiple children but one parent.
--
-- -   Leaf node: Cannot have children but can have multiple parents.
--
-- -   Policy: Allows you to store a policy document and policy type. For
--     more information, see
--     <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/key_concepts_directory.html#key_concepts_policies Policies>.
--
-- -   Index: Can be created with the Index API.
createFacet_objectType :: Lens.Lens' CreateFacet (Prelude.Maybe ObjectType)
createFacet_objectType :: (Maybe ObjectType -> f (Maybe ObjectType))
-> CreateFacet -> f CreateFacet
createFacet_objectType = (CreateFacet -> Maybe ObjectType)
-> (CreateFacet -> Maybe ObjectType -> CreateFacet)
-> Lens
     CreateFacet CreateFacet (Maybe ObjectType) (Maybe ObjectType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacet' {Maybe ObjectType
objectType :: Maybe ObjectType
$sel:objectType:CreateFacet' :: CreateFacet -> Maybe ObjectType
objectType} -> Maybe ObjectType
objectType) (\s :: CreateFacet
s@CreateFacet' {} Maybe ObjectType
a -> CreateFacet
s {$sel:objectType:CreateFacet' :: Maybe ObjectType
objectType = Maybe ObjectType
a} :: CreateFacet)

-- | The attributes that are associated with the Facet.
createFacet_attributes :: Lens.Lens' CreateFacet (Prelude.Maybe [FacetAttribute])
createFacet_attributes :: (Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> CreateFacet -> f CreateFacet
createFacet_attributes = (CreateFacet -> Maybe [FacetAttribute])
-> (CreateFacet -> Maybe [FacetAttribute] -> CreateFacet)
-> Lens
     CreateFacet
     CreateFacet
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacet' {Maybe [FacetAttribute]
attributes :: Maybe [FacetAttribute]
$sel:attributes:CreateFacet' :: CreateFacet -> Maybe [FacetAttribute]
attributes} -> Maybe [FacetAttribute]
attributes) (\s :: CreateFacet
s@CreateFacet' {} Maybe [FacetAttribute]
a -> CreateFacet
s {$sel:attributes:CreateFacet' :: Maybe [FacetAttribute]
attributes = Maybe [FacetAttribute]
a} :: CreateFacet) ((Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
 -> CreateFacet -> f CreateFacet)
-> ((Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
    -> Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> (Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> CreateFacet
-> f CreateFacet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FacetAttribute] [FacetAttribute] [FacetAttribute] [FacetAttribute]
-> Iso
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [FacetAttribute] [FacetAttribute] [FacetAttribute] [FacetAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schema ARN in which the new Facet will be created. For more
-- information, see arns.
createFacet_schemaArn :: Lens.Lens' CreateFacet Prelude.Text
createFacet_schemaArn :: (Text -> f Text) -> CreateFacet -> f CreateFacet
createFacet_schemaArn = (CreateFacet -> Text)
-> (CreateFacet -> Text -> CreateFacet)
-> Lens CreateFacet CreateFacet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacet' {Text
schemaArn :: Text
$sel:schemaArn:CreateFacet' :: CreateFacet -> Text
schemaArn} -> Text
schemaArn) (\s :: CreateFacet
s@CreateFacet' {} Text
a -> CreateFacet
s {$sel:schemaArn:CreateFacet' :: Text
schemaArn = Text
a} :: CreateFacet)

-- | The name of the Facet, which is unique for a given schema.
createFacet_name :: Lens.Lens' CreateFacet Prelude.Text
createFacet_name :: (Text -> f Text) -> CreateFacet -> f CreateFacet
createFacet_name = (CreateFacet -> Text)
-> (CreateFacet -> Text -> CreateFacet)
-> Lens CreateFacet CreateFacet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacet' {Text
name :: Text
$sel:name:CreateFacet' :: CreateFacet -> Text
name} -> Text
name) (\s :: CreateFacet
s@CreateFacet' {} Text
a -> CreateFacet
s {$sel:name:CreateFacet' :: Text
name = Text
a} :: CreateFacet)

instance Core.AWSRequest CreateFacet where
  type AWSResponse CreateFacet = CreateFacetResponse
  request :: CreateFacet -> Request CreateFacet
request = Service -> CreateFacet -> Request CreateFacet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFacet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFacet)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse CreateFacet))
-> Logger
-> Service
-> Proxy CreateFacet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFacet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> CreateFacetResponse
CreateFacetResponse'
            (Int -> CreateFacetResponse)
-> Either String Int -> Either String CreateFacetResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateFacet

instance Prelude.NFData CreateFacet

instance Core.ToHeaders CreateFacet where
  toHeaders :: CreateFacet -> ResponseHeaders
toHeaders CreateFacet' {Maybe [FacetAttribute]
Maybe FacetStyle
Maybe ObjectType
Text
name :: Text
schemaArn :: Text
attributes :: Maybe [FacetAttribute]
objectType :: Maybe ObjectType
facetStyle :: Maybe FacetStyle
$sel:name:CreateFacet' :: CreateFacet -> Text
$sel:schemaArn:CreateFacet' :: CreateFacet -> Text
$sel:attributes:CreateFacet' :: CreateFacet -> Maybe [FacetAttribute]
$sel:objectType:CreateFacet' :: CreateFacet -> Maybe ObjectType
$sel:facetStyle:CreateFacet' :: CreateFacet -> Maybe FacetStyle
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
schemaArn]

instance Core.ToJSON CreateFacet where
  toJSON :: CreateFacet -> Value
toJSON CreateFacet' {Maybe [FacetAttribute]
Maybe FacetStyle
Maybe ObjectType
Text
name :: Text
schemaArn :: Text
attributes :: Maybe [FacetAttribute]
objectType :: Maybe ObjectType
facetStyle :: Maybe FacetStyle
$sel:name:CreateFacet' :: CreateFacet -> Text
$sel:schemaArn:CreateFacet' :: CreateFacet -> Text
$sel:attributes:CreateFacet' :: CreateFacet -> Maybe [FacetAttribute]
$sel:objectType:CreateFacet' :: CreateFacet -> Maybe ObjectType
$sel:facetStyle:CreateFacet' :: CreateFacet -> Maybe FacetStyle
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FacetStyle" Text -> FacetStyle -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FacetStyle -> Pair) -> Maybe FacetStyle -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FacetStyle
facetStyle,
            (Text
"ObjectType" Text -> ObjectType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ObjectType -> Pair) -> Maybe ObjectType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ObjectType
objectType,
            (Text
"Attributes" Text -> [FacetAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FacetAttribute] -> Pair) -> Maybe [FacetAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FacetAttribute]
attributes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath CreateFacet where
  toPath :: CreateFacet -> ByteString
toPath =
    ByteString -> CreateFacet -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/facet/create"

instance Core.ToQuery CreateFacet where
  toQuery :: CreateFacet -> QueryString
toQuery = QueryString -> CreateFacet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'CreateFacetResponse' 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:
--
-- 'httpStatus', 'createFacetResponse_httpStatus' - The response's http status code.
newCreateFacetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFacetResponse
newCreateFacetResponse :: Int -> CreateFacetResponse
newCreateFacetResponse Int
pHttpStatus_ =
  CreateFacetResponse' :: Int -> CreateFacetResponse
CreateFacetResponse' {$sel:httpStatus:CreateFacetResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
createFacetResponse_httpStatus :: Lens.Lens' CreateFacetResponse Prelude.Int
createFacetResponse_httpStatus :: (Int -> f Int) -> CreateFacetResponse -> f CreateFacetResponse
createFacetResponse_httpStatus = (CreateFacetResponse -> Int)
-> (CreateFacetResponse -> Int -> CreateFacetResponse)
-> Lens CreateFacetResponse CreateFacetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFacetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateFacetResponse' :: CreateFacetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateFacetResponse
s@CreateFacetResponse' {} Int
a -> CreateFacetResponse
s {$sel:httpStatus:CreateFacetResponse' :: Int
httpStatus = Int
a} :: CreateFacetResponse)

instance Prelude.NFData CreateFacetResponse