{-# 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.CreateObject
-- 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 an object in a Directory. Additionally attaches the object to a
-- parent, if a parent reference and @LinkName@ is specified. An object is
-- simply a collection of Facet attributes. You can also use this API call
-- to create a policy object, if the facet from which you create the object
-- is a policy facet.
module Amazonka.CloudDirectory.CreateObject
  ( -- * Creating a Request
    CreateObject (..),
    newCreateObject,

    -- * Request Lenses
    createObject_parentReference,
    createObject_objectAttributeList,
    createObject_linkName,
    createObject_directoryArn,
    createObject_schemaFacets,

    -- * Destructuring the Response
    CreateObjectResponse (..),
    newCreateObjectResponse,

    -- * Response Lenses
    createObjectResponse_objectIdentifier,
    createObjectResponse_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:/ 'newCreateObject' smart constructor.
data CreateObject = CreateObject'
  { -- | If specified, the parent reference to which this object will be
    -- attached.
    CreateObject -> Maybe ObjectReference
parentReference :: Prelude.Maybe ObjectReference,
    -- | The attribute map whose attribute ARN contains the key and attribute
    -- value as the map value.
    CreateObject -> Maybe [AttributeKeyAndValue]
objectAttributeList :: Prelude.Maybe [AttributeKeyAndValue],
    -- | The name of link that is used to attach this object to a parent.
    CreateObject -> Maybe Text
linkName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) that is associated with the Directory in
    -- which the object will be created. For more information, see arns.
    CreateObject -> Text
directoryArn :: Prelude.Text,
    -- | A list of schema facets to be associated with the object. Do not provide
    -- minor version components. See SchemaFacet for details.
    CreateObject -> [SchemaFacet]
schemaFacets :: [SchemaFacet]
  }
  deriving (CreateObject -> CreateObject -> Bool
(CreateObject -> CreateObject -> Bool)
-> (CreateObject -> CreateObject -> Bool) -> Eq CreateObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateObject -> CreateObject -> Bool
$c/= :: CreateObject -> CreateObject -> Bool
== :: CreateObject -> CreateObject -> Bool
$c== :: CreateObject -> CreateObject -> Bool
Prelude.Eq, ReadPrec [CreateObject]
ReadPrec CreateObject
Int -> ReadS CreateObject
ReadS [CreateObject]
(Int -> ReadS CreateObject)
-> ReadS [CreateObject]
-> ReadPrec CreateObject
-> ReadPrec [CreateObject]
-> Read CreateObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateObject]
$creadListPrec :: ReadPrec [CreateObject]
readPrec :: ReadPrec CreateObject
$creadPrec :: ReadPrec CreateObject
readList :: ReadS [CreateObject]
$creadList :: ReadS [CreateObject]
readsPrec :: Int -> ReadS CreateObject
$creadsPrec :: Int -> ReadS CreateObject
Prelude.Read, Int -> CreateObject -> ShowS
[CreateObject] -> ShowS
CreateObject -> String
(Int -> CreateObject -> ShowS)
-> (CreateObject -> String)
-> ([CreateObject] -> ShowS)
-> Show CreateObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateObject] -> ShowS
$cshowList :: [CreateObject] -> ShowS
show :: CreateObject -> String
$cshow :: CreateObject -> String
showsPrec :: Int -> CreateObject -> ShowS
$cshowsPrec :: Int -> CreateObject -> ShowS
Prelude.Show, (forall x. CreateObject -> Rep CreateObject x)
-> (forall x. Rep CreateObject x -> CreateObject)
-> Generic CreateObject
forall x. Rep CreateObject x -> CreateObject
forall x. CreateObject -> Rep CreateObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateObject x -> CreateObject
$cfrom :: forall x. CreateObject -> Rep CreateObject x
Prelude.Generic)

-- |
-- Create a value of 'CreateObject' 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:
--
-- 'parentReference', 'createObject_parentReference' - If specified, the parent reference to which this object will be
-- attached.
--
-- 'objectAttributeList', 'createObject_objectAttributeList' - The attribute map whose attribute ARN contains the key and attribute
-- value as the map value.
--
-- 'linkName', 'createObject_linkName' - The name of link that is used to attach this object to a parent.
--
-- 'directoryArn', 'createObject_directoryArn' - The Amazon Resource Name (ARN) that is associated with the Directory in
-- which the object will be created. For more information, see arns.
--
-- 'schemaFacets', 'createObject_schemaFacets' - A list of schema facets to be associated with the object. Do not provide
-- minor version components. See SchemaFacet for details.
newCreateObject ::
  -- | 'directoryArn'
  Prelude.Text ->
  CreateObject
newCreateObject :: Text -> CreateObject
newCreateObject Text
pDirectoryArn_ =
  CreateObject' :: Maybe ObjectReference
-> Maybe [AttributeKeyAndValue]
-> Maybe Text
-> Text
-> [SchemaFacet]
-> CreateObject
CreateObject'
    { $sel:parentReference:CreateObject' :: Maybe ObjectReference
parentReference = Maybe ObjectReference
forall a. Maybe a
Prelude.Nothing,
      $sel:objectAttributeList:CreateObject' :: Maybe [AttributeKeyAndValue]
objectAttributeList = Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing,
      $sel:linkName:CreateObject' :: Maybe Text
linkName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryArn:CreateObject' :: Text
directoryArn = Text
pDirectoryArn_,
      $sel:schemaFacets:CreateObject' :: [SchemaFacet]
schemaFacets = [SchemaFacet]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If specified, the parent reference to which this object will be
-- attached.
createObject_parentReference :: Lens.Lens' CreateObject (Prelude.Maybe ObjectReference)
createObject_parentReference :: (Maybe ObjectReference -> f (Maybe ObjectReference))
-> CreateObject -> f CreateObject
createObject_parentReference = (CreateObject -> Maybe ObjectReference)
-> (CreateObject -> Maybe ObjectReference -> CreateObject)
-> Lens
     CreateObject
     CreateObject
     (Maybe ObjectReference)
     (Maybe ObjectReference)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObject' {Maybe ObjectReference
parentReference :: Maybe ObjectReference
$sel:parentReference:CreateObject' :: CreateObject -> Maybe ObjectReference
parentReference} -> Maybe ObjectReference
parentReference) (\s :: CreateObject
s@CreateObject' {} Maybe ObjectReference
a -> CreateObject
s {$sel:parentReference:CreateObject' :: Maybe ObjectReference
parentReference = Maybe ObjectReference
a} :: CreateObject)

-- | The attribute map whose attribute ARN contains the key and attribute
-- value as the map value.
createObject_objectAttributeList :: Lens.Lens' CreateObject (Prelude.Maybe [AttributeKeyAndValue])
createObject_objectAttributeList :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> CreateObject -> f CreateObject
createObject_objectAttributeList = (CreateObject -> Maybe [AttributeKeyAndValue])
-> (CreateObject -> Maybe [AttributeKeyAndValue] -> CreateObject)
-> Lens
     CreateObject
     CreateObject
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObject' {Maybe [AttributeKeyAndValue]
objectAttributeList :: Maybe [AttributeKeyAndValue]
$sel:objectAttributeList:CreateObject' :: CreateObject -> Maybe [AttributeKeyAndValue]
objectAttributeList} -> Maybe [AttributeKeyAndValue]
objectAttributeList) (\s :: CreateObject
s@CreateObject' {} Maybe [AttributeKeyAndValue]
a -> CreateObject
s {$sel:objectAttributeList:CreateObject' :: Maybe [AttributeKeyAndValue]
objectAttributeList = Maybe [AttributeKeyAndValue]
a} :: CreateObject) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
 -> CreateObject -> f CreateObject)
-> ((Maybe [AttributeKeyAndValue]
     -> f (Maybe [AttributeKeyAndValue]))
    -> Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> CreateObject
-> f CreateObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
-> Iso
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
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
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of link that is used to attach this object to a parent.
createObject_linkName :: Lens.Lens' CreateObject (Prelude.Maybe Prelude.Text)
createObject_linkName :: (Maybe Text -> f (Maybe Text)) -> CreateObject -> f CreateObject
createObject_linkName = (CreateObject -> Maybe Text)
-> (CreateObject -> Maybe Text -> CreateObject)
-> Lens CreateObject CreateObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObject' {Maybe Text
linkName :: Maybe Text
$sel:linkName:CreateObject' :: CreateObject -> Maybe Text
linkName} -> Maybe Text
linkName) (\s :: CreateObject
s@CreateObject' {} Maybe Text
a -> CreateObject
s {$sel:linkName:CreateObject' :: Maybe Text
linkName = Maybe Text
a} :: CreateObject)

-- | The Amazon Resource Name (ARN) that is associated with the Directory in
-- which the object will be created. For more information, see arns.
createObject_directoryArn :: Lens.Lens' CreateObject Prelude.Text
createObject_directoryArn :: (Text -> f Text) -> CreateObject -> f CreateObject
createObject_directoryArn = (CreateObject -> Text)
-> (CreateObject -> Text -> CreateObject)
-> Lens CreateObject CreateObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObject' {Text
directoryArn :: Text
$sel:directoryArn:CreateObject' :: CreateObject -> Text
directoryArn} -> Text
directoryArn) (\s :: CreateObject
s@CreateObject' {} Text
a -> CreateObject
s {$sel:directoryArn:CreateObject' :: Text
directoryArn = Text
a} :: CreateObject)

-- | A list of schema facets to be associated with the object. Do not provide
-- minor version components. See SchemaFacet for details.
createObject_schemaFacets :: Lens.Lens' CreateObject [SchemaFacet]
createObject_schemaFacets :: ([SchemaFacet] -> f [SchemaFacet])
-> CreateObject -> f CreateObject
createObject_schemaFacets = (CreateObject -> [SchemaFacet])
-> (CreateObject -> [SchemaFacet] -> CreateObject)
-> Lens CreateObject CreateObject [SchemaFacet] [SchemaFacet]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObject' {[SchemaFacet]
schemaFacets :: [SchemaFacet]
$sel:schemaFacets:CreateObject' :: CreateObject -> [SchemaFacet]
schemaFacets} -> [SchemaFacet]
schemaFacets) (\s :: CreateObject
s@CreateObject' {} [SchemaFacet]
a -> CreateObject
s {$sel:schemaFacets:CreateObject' :: [SchemaFacet]
schemaFacets = [SchemaFacet]
a} :: CreateObject) (([SchemaFacet] -> f [SchemaFacet])
 -> CreateObject -> f CreateObject)
-> (([SchemaFacet] -> f [SchemaFacet])
    -> [SchemaFacet] -> f [SchemaFacet])
-> ([SchemaFacet] -> f [SchemaFacet])
-> CreateObject
-> f CreateObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SchemaFacet] -> f [SchemaFacet])
-> [SchemaFacet] -> f [SchemaFacet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable CreateObject

instance Prelude.NFData CreateObject

instance Core.ToHeaders CreateObject where
  toHeaders :: CreateObject -> ResponseHeaders
toHeaders CreateObject' {[SchemaFacet]
Maybe [AttributeKeyAndValue]
Maybe Text
Maybe ObjectReference
Text
schemaFacets :: [SchemaFacet]
directoryArn :: Text
linkName :: Maybe Text
objectAttributeList :: Maybe [AttributeKeyAndValue]
parentReference :: Maybe ObjectReference
$sel:schemaFacets:CreateObject' :: CreateObject -> [SchemaFacet]
$sel:directoryArn:CreateObject' :: CreateObject -> Text
$sel:linkName:CreateObject' :: CreateObject -> Maybe Text
$sel:objectAttributeList:CreateObject' :: CreateObject -> Maybe [AttributeKeyAndValue]
$sel:parentReference:CreateObject' :: CreateObject -> Maybe ObjectReference
..} =
    [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
directoryArn]

instance Core.ToJSON CreateObject where
  toJSON :: CreateObject -> Value
toJSON CreateObject' {[SchemaFacet]
Maybe [AttributeKeyAndValue]
Maybe Text
Maybe ObjectReference
Text
schemaFacets :: [SchemaFacet]
directoryArn :: Text
linkName :: Maybe Text
objectAttributeList :: Maybe [AttributeKeyAndValue]
parentReference :: Maybe ObjectReference
$sel:schemaFacets:CreateObject' :: CreateObject -> [SchemaFacet]
$sel:directoryArn:CreateObject' :: CreateObject -> Text
$sel:linkName:CreateObject' :: CreateObject -> Maybe Text
$sel:objectAttributeList:CreateObject' :: CreateObject -> Maybe [AttributeKeyAndValue]
$sel:parentReference:CreateObject' :: CreateObject -> Maybe ObjectReference
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ParentReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ObjectReference -> Pair) -> Maybe ObjectReference -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ObjectReference
parentReference,
            (Text
"ObjectAttributeList" Text -> [AttributeKeyAndValue] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AttributeKeyAndValue] -> Pair)
-> Maybe [AttributeKeyAndValue] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributeKeyAndValue]
objectAttributeList,
            (Text
"LinkName" 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
linkName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SchemaFacets" Text -> [SchemaFacet] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [SchemaFacet]
schemaFacets)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateObjectResponse' 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:
--
-- 'objectIdentifier', 'createObjectResponse_objectIdentifier' - The identifier that is associated with the object.
--
-- 'httpStatus', 'createObjectResponse_httpStatus' - The response's http status code.
newCreateObjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateObjectResponse
newCreateObjectResponse :: Int -> CreateObjectResponse
newCreateObjectResponse Int
pHttpStatus_ =
  CreateObjectResponse' :: Maybe Text -> Int -> CreateObjectResponse
CreateObjectResponse'
    { $sel:objectIdentifier:CreateObjectResponse' :: Maybe Text
objectIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier that is associated with the object.
createObjectResponse_objectIdentifier :: Lens.Lens' CreateObjectResponse (Prelude.Maybe Prelude.Text)
createObjectResponse_objectIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateObjectResponse -> f CreateObjectResponse
createObjectResponse_objectIdentifier = (CreateObjectResponse -> Maybe Text)
-> (CreateObjectResponse -> Maybe Text -> CreateObjectResponse)
-> Lens
     CreateObjectResponse CreateObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateObjectResponse' {Maybe Text
objectIdentifier :: Maybe Text
$sel:objectIdentifier:CreateObjectResponse' :: CreateObjectResponse -> Maybe Text
objectIdentifier} -> Maybe Text
objectIdentifier) (\s :: CreateObjectResponse
s@CreateObjectResponse' {} Maybe Text
a -> CreateObjectResponse
s {$sel:objectIdentifier:CreateObjectResponse' :: Maybe Text
objectIdentifier = Maybe Text
a} :: CreateObjectResponse)

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

instance Prelude.NFData CreateObjectResponse