{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE NoImplicitPrelude  #-}
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE RecordWildCards    #-}

{-# OPTIONS_GHC -fno-warn-unused-binds   #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- |
-- Module      : Network.Google.ShoppingContent.Types.Product
-- Copyright   : (c) 2015-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Network.Google.ShoppingContent.Types.Product where

import           Network.Google.Prelude
import           Network.Google.ShoppingContent.Types.Sum

--
-- /See:/ 'ordersAcknowledgeRequest' smart constructor.
newtype OrdersAcknowledgeRequest = OrdersAcknowledgeRequest'
    { _oarOperationId :: Maybe Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersAcknowledgeRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oarOperationId'
ordersAcknowledgeRequest
    :: OrdersAcknowledgeRequest
ordersAcknowledgeRequest =
    OrdersAcknowledgeRequest'
    { _oarOperationId = Nothing
    }

-- | The ID of the operation. Unique across all operations for a given order.
oarOperationId :: Lens' OrdersAcknowledgeRequest (Maybe Text)
oarOperationId
  = lens _oarOperationId
      (\ s a -> s{_oarOperationId = a})

instance FromJSON OrdersAcknowledgeRequest where
        parseJSON
          = withObject "OrdersAcknowledgeRequest"
              (\ o ->
                 OrdersAcknowledgeRequest' <$> (o .:? "operationId"))

instance ToJSON OrdersAcknowledgeRequest where
        toJSON OrdersAcknowledgeRequest'{..}
          = object
              (catMaybes [("operationId" .=) <$> _oarOperationId])

-- | The tax settings of a merchant account. All methods require the admin
-- role.
--
-- /See:/ 'accountTax' smart constructor.
data AccountTax = AccountTax'
    { _atRules     :: !(Maybe [AccountTaxTaxRule])
    , _atKind      :: !Text
    , _atAccountId :: !(Maybe (Textual Word64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountTax' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'atRules'
--
-- * 'atKind'
--
-- * 'atAccountId'
accountTax
    :: AccountTax
accountTax =
    AccountTax'
    { _atRules = Nothing
    , _atKind = "content#accountTax"
    , _atAccountId = Nothing
    }

-- | Tax rules. Updating the tax rules will enable US taxes (not reversible).
-- Defining no rules is equivalent to not charging tax at all.
atRules :: Lens' AccountTax [AccountTaxTaxRule]
atRules
  = lens _atRules (\ s a -> s{_atRules = a}) . _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#accountTax\".
atKind :: Lens' AccountTax Text
atKind = lens _atKind (\ s a -> s{_atKind = a})

-- | The ID of the account to which these account tax settings belong.
atAccountId :: Lens' AccountTax (Maybe Word64)
atAccountId
  = lens _atAccountId (\ s a -> s{_atAccountId = a}) .
      mapping _Coerce

instance FromJSON AccountTax where
        parseJSON
          = withObject "AccountTax"
              (\ o ->
                 AccountTax' <$>
                   (o .:? "rules" .!= mempty) <*>
                     (o .:? "kind" .!= "content#accountTax")
                     <*> (o .:? "accountId"))

instance ToJSON AccountTax where
        toJSON AccountTax'{..}
          = object
              (catMaybes
                 [("rules" .=) <$> _atRules, Just ("kind" .= _atKind),
                  ("accountId" .=) <$> _atAccountId])

--
-- /See:/ 'orderinvoicesCreateRefundInvoiceResponse' smart constructor.
data OrderinvoicesCreateRefundInvoiceResponse = OrderinvoicesCreateRefundInvoiceResponse'
    { _ocrirKind            :: !Text
    , _ocrirExecutionStatus :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderinvoicesCreateRefundInvoiceResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ocrirKind'
--
-- * 'ocrirExecutionStatus'
orderinvoicesCreateRefundInvoiceResponse
    :: OrderinvoicesCreateRefundInvoiceResponse
orderinvoicesCreateRefundInvoiceResponse =
    OrderinvoicesCreateRefundInvoiceResponse'
    { _ocrirKind = "content#orderinvoicesCreateRefundInvoiceResponse"
    , _ocrirExecutionStatus = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#orderinvoicesCreateRefundInvoiceResponse\".
ocrirKind :: Lens' OrderinvoicesCreateRefundInvoiceResponse Text
ocrirKind
  = lens _ocrirKind (\ s a -> s{_ocrirKind = a})

-- | The status of the execution.
ocrirExecutionStatus :: Lens' OrderinvoicesCreateRefundInvoiceResponse (Maybe Text)
ocrirExecutionStatus
  = lens _ocrirExecutionStatus
      (\ s a -> s{_ocrirExecutionStatus = a})

instance FromJSON
         OrderinvoicesCreateRefundInvoiceResponse where
        parseJSON
          = withObject
              "OrderinvoicesCreateRefundInvoiceResponse"
              (\ o ->
                 OrderinvoicesCreateRefundInvoiceResponse' <$>
                   (o .:? "kind" .!=
                      "content#orderinvoicesCreateRefundInvoiceResponse")
                     <*> (o .:? "executionStatus"))

instance ToJSON
         OrderinvoicesCreateRefundInvoiceResponse where
        toJSON OrderinvoicesCreateRefundInvoiceResponse'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _ocrirKind),
                  ("executionStatus" .=) <$> _ocrirExecutionStatus])

--
-- /See:/ 'ordersUpdateMerchantOrderIdRequest' smart constructor.
data OrdersUpdateMerchantOrderIdRequest = OrdersUpdateMerchantOrderIdRequest'
    { _oumoirMerchantOrderId :: !(Maybe Text)
    , _oumoirOperationId     :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersUpdateMerchantOrderIdRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oumoirMerchantOrderId'
--
-- * 'oumoirOperationId'
ordersUpdateMerchantOrderIdRequest
    :: OrdersUpdateMerchantOrderIdRequest
ordersUpdateMerchantOrderIdRequest =
    OrdersUpdateMerchantOrderIdRequest'
    { _oumoirMerchantOrderId = Nothing
    , _oumoirOperationId = Nothing
    }

-- | The merchant order id to be assigned to the order. Must be unique per
-- merchant.
oumoirMerchantOrderId :: Lens' OrdersUpdateMerchantOrderIdRequest (Maybe Text)
oumoirMerchantOrderId
  = lens _oumoirMerchantOrderId
      (\ s a -> s{_oumoirMerchantOrderId = a})

-- | The ID of the operation. Unique across all operations for a given order.
oumoirOperationId :: Lens' OrdersUpdateMerchantOrderIdRequest (Maybe Text)
oumoirOperationId
  = lens _oumoirOperationId
      (\ s a -> s{_oumoirOperationId = a})

instance FromJSON OrdersUpdateMerchantOrderIdRequest
         where
        parseJSON
          = withObject "OrdersUpdateMerchantOrderIdRequest"
              (\ o ->
                 OrdersUpdateMerchantOrderIdRequest' <$>
                   (o .:? "merchantOrderId") <*> (o .:? "operationId"))

instance ToJSON OrdersUpdateMerchantOrderIdRequest
         where
        toJSON OrdersUpdateMerchantOrderIdRequest'{..}
          = object
              (catMaybes
                 [("merchantOrderId" .=) <$> _oumoirMerchantOrderId,
                  ("operationId" .=) <$> _oumoirOperationId])

--
-- /See:/ 'orderReportTransaction' smart constructor.
data OrderReportTransaction = OrderReportTransaction'
    { _ortMerchantId               :: !(Maybe (Textual Word64))
    , _ortDisbursementId           :: !(Maybe Text)
    , _ortDisbursementCreationDate :: !(Maybe Text)
    , _ortTransactionDate          :: !(Maybe Text)
    , _ortDisbursementDate         :: !(Maybe Text)
    , _ortMerchantOrderId          :: !(Maybe Text)
    , _ortProductAmount            :: !(Maybe Amount)
    , _ortOrderId                  :: !(Maybe Text)
    , _ortDisbursementAmount       :: !(Maybe Price)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderReportTransaction' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ortMerchantId'
--
-- * 'ortDisbursementId'
--
-- * 'ortDisbursementCreationDate'
--
-- * 'ortTransactionDate'
--
-- * 'ortDisbursementDate'
--
-- * 'ortMerchantOrderId'
--
-- * 'ortProductAmount'
--
-- * 'ortOrderId'
--
-- * 'ortDisbursementAmount'
orderReportTransaction
    :: OrderReportTransaction
orderReportTransaction =
    OrderReportTransaction'
    { _ortMerchantId = Nothing
    , _ortDisbursementId = Nothing
    , _ortDisbursementCreationDate = Nothing
    , _ortTransactionDate = Nothing
    , _ortDisbursementDate = Nothing
    , _ortMerchantOrderId = Nothing
    , _ortProductAmount = Nothing
    , _ortOrderId = Nothing
    , _ortDisbursementAmount = Nothing
    }

-- | The ID of the managing account.
ortMerchantId :: Lens' OrderReportTransaction (Maybe Word64)
ortMerchantId
  = lens _ortMerchantId
      (\ s a -> s{_ortMerchantId = a})
      . mapping _Coerce

-- | The ID of the disbursement.
ortDisbursementId :: Lens' OrderReportTransaction (Maybe Text)
ortDisbursementId
  = lens _ortDisbursementId
      (\ s a -> s{_ortDisbursementId = a})

-- | The date the disbursement was created, in ISO 8601 format.
ortDisbursementCreationDate :: Lens' OrderReportTransaction (Maybe Text)
ortDisbursementCreationDate
  = lens _ortDisbursementCreationDate
      (\ s a -> s{_ortDisbursementCreationDate = a})

-- | The date of the transaction, in ISO 8601 format.
ortTransactionDate :: Lens' OrderReportTransaction (Maybe Text)
ortTransactionDate
  = lens _ortTransactionDate
      (\ s a -> s{_ortTransactionDate = a})

-- | The date the disbursement was initiated, in ISO 8601 format.
ortDisbursementDate :: Lens' OrderReportTransaction (Maybe Text)
ortDisbursementDate
  = lens _ortDisbursementDate
      (\ s a -> s{_ortDisbursementDate = a})

-- | Merchant-provided id of the order.
ortMerchantOrderId :: Lens' OrderReportTransaction (Maybe Text)
ortMerchantOrderId
  = lens _ortMerchantOrderId
      (\ s a -> s{_ortMerchantOrderId = a})

-- | Total amount for the items.
ortProductAmount :: Lens' OrderReportTransaction (Maybe Amount)
ortProductAmount
  = lens _ortProductAmount
      (\ s a -> s{_ortProductAmount = a})

-- | The id of the order.
ortOrderId :: Lens' OrderReportTransaction (Maybe Text)
ortOrderId
  = lens _ortOrderId (\ s a -> s{_ortOrderId = a})

-- | The disbursement amount.
ortDisbursementAmount :: Lens' OrderReportTransaction (Maybe Price)
ortDisbursementAmount
  = lens _ortDisbursementAmount
      (\ s a -> s{_ortDisbursementAmount = a})

instance FromJSON OrderReportTransaction where
        parseJSON
          = withObject "OrderReportTransaction"
              (\ o ->
                 OrderReportTransaction' <$>
                   (o .:? "merchantId") <*> (o .:? "disbursementId") <*>
                     (o .:? "disbursementCreationDate")
                     <*> (o .:? "transactionDate")
                     <*> (o .:? "disbursementDate")
                     <*> (o .:? "merchantOrderId")
                     <*> (o .:? "productAmount")
                     <*> (o .:? "orderId")
                     <*> (o .:? "disbursementAmount"))

instance ToJSON OrderReportTransaction where
        toJSON OrderReportTransaction'{..}
          = object
              (catMaybes
                 [("merchantId" .=) <$> _ortMerchantId,
                  ("disbursementId" .=) <$> _ortDisbursementId,
                  ("disbursementCreationDate" .=) <$>
                    _ortDisbursementCreationDate,
                  ("transactionDate" .=) <$> _ortTransactionDate,
                  ("disbursementDate" .=) <$> _ortDisbursementDate,
                  ("merchantOrderId" .=) <$> _ortMerchantOrderId,
                  ("productAmount" .=) <$> _ortProductAmount,
                  ("orderId" .=) <$> _ortOrderId,
                  ("disbursementAmount" .=) <$>
                    _ortDisbursementAmount])

--
-- /See:/ 'ordersAdvanceTestOrderResponse' smart constructor.
newtype OrdersAdvanceTestOrderResponse = OrdersAdvanceTestOrderResponse'
    { _oatorKind :: Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersAdvanceTestOrderResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oatorKind'
ordersAdvanceTestOrderResponse
    :: OrdersAdvanceTestOrderResponse
ordersAdvanceTestOrderResponse =
    OrdersAdvanceTestOrderResponse'
    { _oatorKind = "content#ordersAdvanceTestOrderResponse"
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#ordersAdvanceTestOrderResponse\".
oatorKind :: Lens' OrdersAdvanceTestOrderResponse Text
oatorKind
  = lens _oatorKind (\ s a -> s{_oatorKind = a})

instance FromJSON OrdersAdvanceTestOrderResponse
         where
        parseJSON
          = withObject "OrdersAdvanceTestOrderResponse"
              (\ o ->
                 OrdersAdvanceTestOrderResponse' <$>
                   (o .:? "kind" .!=
                      "content#ordersAdvanceTestOrderResponse"))

instance ToJSON OrdersAdvanceTestOrderResponse where
        toJSON OrdersAdvanceTestOrderResponse'{..}
          = object (catMaybes [Just ("kind" .= _oatorKind)])

--
-- /See:/ 'productsCustomBatchResponse' smart constructor.
data ProductsCustomBatchResponse = ProductsCustomBatchResponse'
    { _pcbrEntries :: !(Maybe [ProductsCustomBatchResponseEntry])
    , _pcbrKind    :: !Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProductsCustomBatchResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pcbrEntries'
--
-- * 'pcbrKind'
productsCustomBatchResponse
    :: ProductsCustomBatchResponse
productsCustomBatchResponse =
    ProductsCustomBatchResponse'
    { _pcbrEntries = Nothing
    , _pcbrKind = "content#productsCustomBatchResponse"
    }

-- | The result of the execution of the batch requests.
pcbrEntries :: Lens' ProductsCustomBatchResponse [ProductsCustomBatchResponseEntry]
pcbrEntries
  = lens _pcbrEntries (\ s a -> s{_pcbrEntries = a}) .
      _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#productsCustomBatchResponse\".
pcbrKind :: Lens' ProductsCustomBatchResponse Text
pcbrKind = lens _pcbrKind (\ s a -> s{_pcbrKind = a})

instance FromJSON ProductsCustomBatchResponse where
        parseJSON
          = withObject "ProductsCustomBatchResponse"
              (\ o ->
                 ProductsCustomBatchResponse' <$>
                   (o .:? "entries" .!= mempty) <*>
                     (o .:? "kind" .!=
                        "content#productsCustomBatchResponse"))

instance ToJSON ProductsCustomBatchResponse where
        toJSON ProductsCustomBatchResponse'{..}
          = object
              (catMaybes
                 [("entries" .=) <$> _pcbrEntries,
                  Just ("kind" .= _pcbrKind)])

--
-- /See:/ 'orderMerchantProvidedAnnotation' smart constructor.
data OrderMerchantProvidedAnnotation = OrderMerchantProvidedAnnotation'
    { _ompaValue :: !(Maybe Text)
    , _ompaKey   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderMerchantProvidedAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ompaValue'
--
-- * 'ompaKey'
orderMerchantProvidedAnnotation
    :: OrderMerchantProvidedAnnotation
orderMerchantProvidedAnnotation =
    OrderMerchantProvidedAnnotation'
    { _ompaValue = Nothing
    , _ompaKey = Nothing
    }

-- | Value for additional merchant provided (as key-value pairs) annotation
-- about the line item.
ompaValue :: Lens' OrderMerchantProvidedAnnotation (Maybe Text)
ompaValue
  = lens _ompaValue (\ s a -> s{_ompaValue = a})

-- | Key for additional merchant provided (as key-value pairs) annotation
-- about the line item.
ompaKey :: Lens' OrderMerchantProvidedAnnotation (Maybe Text)
ompaKey = lens _ompaKey (\ s a -> s{_ompaKey = a})

instance FromJSON OrderMerchantProvidedAnnotation
         where
        parseJSON
          = withObject "OrderMerchantProvidedAnnotation"
              (\ o ->
                 OrderMerchantProvidedAnnotation' <$>
                   (o .:? "value") <*> (o .:? "key"))

instance ToJSON OrderMerchantProvidedAnnotation where
        toJSON OrderMerchantProvidedAnnotation'{..}
          = object
              (catMaybes
                 [("value" .=) <$> _ompaValue,
                  ("key" .=) <$> _ompaKey])

--
-- /See:/ 'testOrderCustomer' smart constructor.
data TestOrderCustomer = TestOrderCustomer'
    { _tocFullName            :: !(Maybe Text)
    , _tocEmail               :: !(Maybe Text)
    , _tocMarketingRightsInfo :: !(Maybe TestOrderCustomerMarketingRightsInfo)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'TestOrderCustomer' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tocFullName'
--
-- * 'tocEmail'
--
-- * 'tocMarketingRightsInfo'
testOrderCustomer
    :: TestOrderCustomer
testOrderCustomer =
    TestOrderCustomer'
    { _tocFullName = Nothing
    , _tocEmail = Nothing
    , _tocMarketingRightsInfo = Nothing
    }

-- | Full name of the customer.
tocFullName :: Lens' TestOrderCustomer (Maybe Text)
tocFullName
  = lens _tocFullName (\ s a -> s{_tocFullName = a})

-- | Deprecated.
tocEmail :: Lens' TestOrderCustomer (Maybe Text)
tocEmail = lens _tocEmail (\ s a -> s{_tocEmail = a})

-- | Customer\'s marketing preferences.
tocMarketingRightsInfo :: Lens' TestOrderCustomer (Maybe TestOrderCustomerMarketingRightsInfo)
tocMarketingRightsInfo
  = lens _tocMarketingRightsInfo
      (\ s a -> s{_tocMarketingRightsInfo = a})

instance FromJSON TestOrderCustomer where
        parseJSON
          = withObject "TestOrderCustomer"
              (\ o ->
                 TestOrderCustomer' <$>
                   (o .:? "fullName") <*> (o .:? "email") <*>
                     (o .:? "marketingRightsInfo"))

instance ToJSON TestOrderCustomer where
        toJSON TestOrderCustomer'{..}
          = object
              (catMaybes
                 [("fullName" .=) <$> _tocFullName,
                  ("email" .=) <$> _tocEmail,
                  ("marketingRightsInfo" .=) <$>
                    _tocMarketingRightsInfo])

--
-- /See:/ 'datafeedstatusesCustomBatchResponse' smart constructor.
data DatafeedstatusesCustomBatchResponse = DatafeedstatusesCustomBatchResponse'
    { _dcbrEntries :: !(Maybe [DatafeedstatusesCustomBatchResponseEntry])
    , _dcbrKind    :: !Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'DatafeedstatusesCustomBatchResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dcbrEntries'
--
-- * 'dcbrKind'
datafeedstatusesCustomBatchResponse
    :: DatafeedstatusesCustomBatchResponse
datafeedstatusesCustomBatchResponse =
    DatafeedstatusesCustomBatchResponse'
    { _dcbrEntries = Nothing
    , _dcbrKind = "content#datafeedstatusesCustomBatchResponse"
    }

-- | The result of the execution of the batch requests.
dcbrEntries :: Lens' DatafeedstatusesCustomBatchResponse [DatafeedstatusesCustomBatchResponseEntry]
dcbrEntries
  = lens _dcbrEntries (\ s a -> s{_dcbrEntries = a}) .
      _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#datafeedstatusesCustomBatchResponse\".
dcbrKind :: Lens' DatafeedstatusesCustomBatchResponse Text
dcbrKind = lens _dcbrKind (\ s a -> s{_dcbrKind = a})

instance FromJSON DatafeedstatusesCustomBatchResponse
         where
        parseJSON
          = withObject "DatafeedstatusesCustomBatchResponse"
              (\ o ->
                 DatafeedstatusesCustomBatchResponse' <$>
                   (o .:? "entries" .!= mempty) <*>
                     (o .:? "kind" .!=
                        "content#datafeedstatusesCustomBatchResponse"))

instance ToJSON DatafeedstatusesCustomBatchResponse
         where
        toJSON DatafeedstatusesCustomBatchResponse'{..}
          = object
              (catMaybes
                 [("entries" .=) <$> _dcbrEntries,
                  Just ("kind" .= _dcbrKind)])

--
-- /See:/ 'orderReturn' smart constructor.
data OrderReturn = OrderReturn'
    { _orQuantity     :: !(Maybe (Textual Word32))
    , _orActor        :: !(Maybe Text)
    , _orReason       :: !(Maybe Text)
    , _orCreationDate :: !(Maybe Text)
    , _orReasonText   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderReturn' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'orQuantity'
--
-- * 'orActor'
--
-- * 'orReason'
--
-- * 'orCreationDate'
--
-- * 'orReasonText'
orderReturn
    :: OrderReturn
orderReturn =
    OrderReturn'
    { _orQuantity = Nothing
    , _orActor = Nothing
    , _orReason = Nothing
    , _orCreationDate = Nothing
    , _orReasonText = Nothing
    }

-- | Quantity that is returned.
orQuantity :: Lens' OrderReturn (Maybe Word32)
orQuantity
  = lens _orQuantity (\ s a -> s{_orQuantity = a}) .
      mapping _Coerce

-- | The actor that created the refund.
orActor :: Lens' OrderReturn (Maybe Text)
orActor = lens _orActor (\ s a -> s{_orActor = a})

-- | The reason for the return.
orReason :: Lens' OrderReturn (Maybe Text)
orReason = lens _orReason (\ s a -> s{_orReason = a})

-- | Date on which the item has been created, in ISO 8601 format.
orCreationDate :: Lens' OrderReturn (Maybe Text)
orCreationDate
  = lens _orCreationDate
      (\ s a -> s{_orCreationDate = a})

-- | The explanation of the reason.
orReasonText :: Lens' OrderReturn (Maybe Text)
orReasonText
  = lens _orReasonText (\ s a -> s{_orReasonText = a})

instance FromJSON OrderReturn where
        parseJSON
          = withObject "OrderReturn"
              (\ o ->
                 OrderReturn' <$>
                   (o .:? "quantity") <*> (o .:? "actor") <*>
                     (o .:? "reason")
                     <*> (o .:? "creationDate")
                     <*> (o .:? "reasonText"))

instance ToJSON OrderReturn where
        toJSON OrderReturn'{..}
          = object
              (catMaybes
                 [("quantity" .=) <$> _orQuantity,
                  ("actor" .=) <$> _orActor,
                  ("reason" .=) <$> _orReason,
                  ("creationDate" .=) <$> _orCreationDate,
                  ("reasonText" .=) <$> _orReasonText])

-- | A batch entry encoding a single non-batch accounttax response.
--
-- /See:/ 'accounttaxCustomBatchResponseEntry' smart constructor.
data AccounttaxCustomBatchResponseEntry = AccounttaxCustomBatchResponseEntry'
    { _acbreAccountTax :: !(Maybe AccountTax)
    , _acbreKind       :: !Text
    , _acbreErrors     :: !(Maybe Errors)
    , _acbreBatchId    :: !(Maybe (Textual Word32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccounttaxCustomBatchResponseEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acbreAccountTax'
--
-- * 'acbreKind'
--
-- * 'acbreErrors'
--
-- * 'acbreBatchId'
accounttaxCustomBatchResponseEntry
    :: AccounttaxCustomBatchResponseEntry
accounttaxCustomBatchResponseEntry =
    AccounttaxCustomBatchResponseEntry'
    { _acbreAccountTax = Nothing
    , _acbreKind = "content#accounttaxCustomBatchResponseEntry"
    , _acbreErrors = Nothing
    , _acbreBatchId = Nothing
    }

-- | The retrieved or updated account tax settings.
acbreAccountTax :: Lens' AccounttaxCustomBatchResponseEntry (Maybe AccountTax)
acbreAccountTax
  = lens _acbreAccountTax
      (\ s a -> s{_acbreAccountTax = a})

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#accounttaxCustomBatchResponseEntry\".
acbreKind :: Lens' AccounttaxCustomBatchResponseEntry Text
acbreKind
  = lens _acbreKind (\ s a -> s{_acbreKind = a})

-- | A list of errors defined if and only if the request failed.
acbreErrors :: Lens' AccounttaxCustomBatchResponseEntry (Maybe Errors)
acbreErrors
  = lens _acbreErrors (\ s a -> s{_acbreErrors = a})

-- | The ID of the request entry this entry responds to.
acbreBatchId :: Lens' AccounttaxCustomBatchResponseEntry (Maybe Word32)
acbreBatchId
  = lens _acbreBatchId (\ s a -> s{_acbreBatchId = a})
      . mapping _Coerce

instance FromJSON AccounttaxCustomBatchResponseEntry
         where
        parseJSON
          = withObject "AccounttaxCustomBatchResponseEntry"
              (\ o ->
                 AccounttaxCustomBatchResponseEntry' <$>
                   (o .:? "accountTax") <*>
                     (o .:? "kind" .!=
                        "content#accounttaxCustomBatchResponseEntry")
                     <*> (o .:? "errors")
                     <*> (o .:? "batchId"))

instance ToJSON AccounttaxCustomBatchResponseEntry
         where
        toJSON AccounttaxCustomBatchResponseEntry'{..}
          = object
              (catMaybes
                 [("accountTax" .=) <$> _acbreAccountTax,
                  Just ("kind" .= _acbreKind),
                  ("errors" .=) <$> _acbreErrors,
                  ("batchId" .=) <$> _acbreBatchId])

--
-- /See:/ 'posSaleResponse' smart constructor.
data PosSaleResponse = PosSaleResponse'
    { _psrStoreCode       :: !(Maybe Text)
    , _psrKind            :: !Text
    , _psrItemId          :: !(Maybe Text)
    , _psrQuantity        :: !(Maybe (Textual Int64))
    , _psrTargetCountry   :: !(Maybe Text)
    , _psrGtin            :: !(Maybe Text)
    , _psrPrice           :: !(Maybe Price)
    , _psrContentLanguage :: !(Maybe Text)
    , _psrTimestamp       :: !(Maybe Text)
    , _psrSaleId          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'PosSaleResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'psrStoreCode'
--
-- * 'psrKind'
--
-- * 'psrItemId'
--
-- * 'psrQuantity'
--
-- * 'psrTargetCountry'
--
-- * 'psrGtin'
--
-- * 'psrPrice'
--
-- * 'psrContentLanguage'
--
-- * 'psrTimestamp'
--
-- * 'psrSaleId'
posSaleResponse
    :: PosSaleResponse
posSaleResponse =
    PosSaleResponse'
    { _psrStoreCode = Nothing
    , _psrKind = "content#posSaleResponse"
    , _psrItemId = Nothing
    , _psrQuantity = Nothing
    , _psrTargetCountry = Nothing
    , _psrGtin = Nothing
    , _psrPrice = Nothing
    , _psrContentLanguage = Nothing
    , _psrTimestamp = Nothing
    , _psrSaleId = Nothing
    }

-- | The identifier of the merchant\'s store. Either a storeCode inserted via
-- the API or the code of the store in Google My Business.
psrStoreCode :: Lens' PosSaleResponse (Maybe Text)
psrStoreCode
  = lens _psrStoreCode (\ s a -> s{_psrStoreCode = a})

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#posSaleResponse\".
psrKind :: Lens' PosSaleResponse Text
psrKind = lens _psrKind (\ s a -> s{_psrKind = a})

-- | A unique identifier for the item.
psrItemId :: Lens' PosSaleResponse (Maybe Text)
psrItemId
  = lens _psrItemId (\ s a -> s{_psrItemId = a})

-- | The relative change of the available quantity. Negative for items
-- returned.
psrQuantity :: Lens' PosSaleResponse (Maybe Int64)
psrQuantity
  = lens _psrQuantity (\ s a -> s{_psrQuantity = a}) .
      mapping _Coerce

-- | The CLDR territory code for the item.
psrTargetCountry :: Lens' PosSaleResponse (Maybe Text)
psrTargetCountry
  = lens _psrTargetCountry
      (\ s a -> s{_psrTargetCountry = a})

-- | Global Trade Item Number.
psrGtin :: Lens' PosSaleResponse (Maybe Text)
psrGtin = lens _psrGtin (\ s a -> s{_psrGtin = a})

-- | The price of the item.
psrPrice :: Lens' PosSaleResponse (Maybe Price)
psrPrice = lens _psrPrice (\ s a -> s{_psrPrice = a})

-- | The two-letter ISO 639-1 language code for the item.
psrContentLanguage :: Lens' PosSaleResponse (Maybe Text)
psrContentLanguage
  = lens _psrContentLanguage
      (\ s a -> s{_psrContentLanguage = a})

-- | The inventory timestamp, in ISO 8601 format.
psrTimestamp :: Lens' PosSaleResponse (Maybe Text)
psrTimestamp
  = lens _psrTimestamp (\ s a -> s{_psrTimestamp = a})

-- | A unique ID to group items from the same sale event.
psrSaleId :: Lens' PosSaleResponse (Maybe Text)
psrSaleId
  = lens _psrSaleId (\ s a -> s{_psrSaleId = a})

instance FromJSON PosSaleResponse where
        parseJSON
          = withObject "PosSaleResponse"
              (\ o ->
                 PosSaleResponse' <$>
                   (o .:? "storeCode") <*>
                     (o .:? "kind" .!= "content#posSaleResponse")
                     <*> (o .:? "itemId")
                     <*> (o .:? "quantity")
                     <*> (o .:? "targetCountry")
                     <*> (o .:? "gtin")
                     <*> (o .:? "price")
                     <*> (o .:? "contentLanguage")
                     <*> (o .:? "timestamp")
                     <*> (o .:? "saleId"))

instance ToJSON PosSaleResponse where
        toJSON PosSaleResponse'{..}
          = object
              (catMaybes
                 [("storeCode" .=) <$> _psrStoreCode,
                  Just ("kind" .= _psrKind),
                  ("itemId" .=) <$> _psrItemId,
                  ("quantity" .=) <$> _psrQuantity,
                  ("targetCountry" .=) <$> _psrTargetCountry,
                  ("gtin" .=) <$> _psrGtin, ("price" .=) <$> _psrPrice,
                  ("contentLanguage" .=) <$> _psrContentLanguage,
                  ("timestamp" .=) <$> _psrTimestamp,
                  ("saleId" .=) <$> _psrSaleId])

--
-- /See:/ 'amount' smart constructor.
data Amount = Amount'
    { _aPretax :: !(Maybe Price)
    , _aTax    :: !(Maybe Price)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Amount' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aPretax'
--
-- * 'aTax'
amount
    :: Amount
amount =
    Amount'
    { _aPretax = Nothing
    , _aTax = Nothing
    }

-- | [required] Value before taxes.
aPretax :: Lens' Amount (Maybe Price)
aPretax = lens _aPretax (\ s a -> s{_aPretax = a})

-- | [required] Tax value.
aTax :: Lens' Amount (Maybe Price)
aTax = lens _aTax (\ s a -> s{_aTax = a})

instance FromJSON Amount where
        parseJSON
          = withObject "Amount"
              (\ o ->
                 Amount' <$> (o .:? "pretax") <*> (o .:? "tax"))

instance ToJSON Amount where
        toJSON Amount'{..}
          = object
              (catMaybes
                 [("pretax" .=) <$> _aPretax, ("tax" .=) <$> _aTax])

--
-- /See:/ 'accountsAuthInfoResponse' smart constructor.
data AccountsAuthInfoResponse = AccountsAuthInfoResponse'
    { _aairKind               :: !Text
    , _aairAccountIdentifiers :: !(Maybe [AccountIdentifier])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountsAuthInfoResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aairKind'
--
-- * 'aairAccountIdentifiers'
accountsAuthInfoResponse
    :: AccountsAuthInfoResponse
accountsAuthInfoResponse =
    AccountsAuthInfoResponse'
    { _aairKind = "content#accountsAuthInfoResponse"
    , _aairAccountIdentifiers = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#accountsAuthInfoResponse\".
aairKind :: Lens' AccountsAuthInfoResponse Text
aairKind = lens _aairKind (\ s a -> s{_aairKind = a})

-- | The account identifiers corresponding to the authenticated user. - For
-- an individual account: only the merchant ID is defined - For an
-- aggregator: only the aggregator ID is defined - For a subaccount of an
-- MCA: both the merchant ID and the aggregator ID are defined.
aairAccountIdentifiers :: Lens' AccountsAuthInfoResponse [AccountIdentifier]
aairAccountIdentifiers
  = lens _aairAccountIdentifiers
      (\ s a -> s{_aairAccountIdentifiers = a})
      . _Default
      . _Coerce

instance FromJSON AccountsAuthInfoResponse where
        parseJSON
          = withObject "AccountsAuthInfoResponse"
              (\ o ->
                 AccountsAuthInfoResponse' <$>
                   (o .:? "kind" .!= "content#accountsAuthInfoResponse")
                     <*> (o .:? "accountIdentifiers" .!= mempty))

instance ToJSON AccountsAuthInfoResponse where
        toJSON AccountsAuthInfoResponse'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _aairKind),
                  ("accountIdentifiers" .=) <$>
                    _aairAccountIdentifiers])

-- | Order disbursement. All methods require the payment analyst role.
--
-- /See:/ 'orderReportDisbursement' smart constructor.
data OrderReportDisbursement = OrderReportDisbursement'
    { _ordMerchantId               :: !(Maybe (Textual Word64))
    , _ordDisbursementId           :: !(Maybe Text)
    , _ordDisbursementCreationDate :: !(Maybe Text)
    , _ordDisbursementDate         :: !(Maybe Text)
    , _ordDisbursementAmount       :: !(Maybe Price)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderReportDisbursement' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ordMerchantId'
--
-- * 'ordDisbursementId'
--
-- * 'ordDisbursementCreationDate'
--
-- * 'ordDisbursementDate'
--
-- * 'ordDisbursementAmount'
orderReportDisbursement
    :: OrderReportDisbursement
orderReportDisbursement =
    OrderReportDisbursement'
    { _ordMerchantId = Nothing
    , _ordDisbursementId = Nothing
    , _ordDisbursementCreationDate = Nothing
    , _ordDisbursementDate = Nothing
    , _ordDisbursementAmount = Nothing
    }

-- | The ID of the managing account.
ordMerchantId :: Lens' OrderReportDisbursement (Maybe Word64)
ordMerchantId
  = lens _ordMerchantId
      (\ s a -> s{_ordMerchantId = a})
      . mapping _Coerce

-- | The ID of the disbursement.
ordDisbursementId :: Lens' OrderReportDisbursement (Maybe Text)
ordDisbursementId
  = lens _ordDisbursementId
      (\ s a -> s{_ordDisbursementId = a})

-- | The disbursement date, in ISO 8601 format.
ordDisbursementCreationDate :: Lens' OrderReportDisbursement (Maybe Text)
ordDisbursementCreationDate
  = lens _ordDisbursementCreationDate
      (\ s a -> s{_ordDisbursementCreationDate = a})

-- | The date the disbursement was initiated, in ISO 8601 format.
ordDisbursementDate :: Lens' OrderReportDisbursement (Maybe Text)
ordDisbursementDate
  = lens _ordDisbursementDate
      (\ s a -> s{_ordDisbursementDate = a})

-- | The disbursement amount.
ordDisbursementAmount :: Lens' OrderReportDisbursement (Maybe Price)
ordDisbursementAmount
  = lens _ordDisbursementAmount
      (\ s a -> s{_ordDisbursementAmount = a})

instance FromJSON OrderReportDisbursement where
        parseJSON
          = withObject "OrderReportDisbursement"
              (\ o ->
                 OrderReportDisbursement' <$>
                   (o .:? "merchantId") <*> (o .:? "disbursementId") <*>
                     (o .:? "disbursementCreationDate")
                     <*> (o .:? "disbursementDate")
                     <*> (o .:? "disbursementAmount"))

instance ToJSON OrderReportDisbursement where
        toJSON OrderReportDisbursement'{..}
          = object
              (catMaybes
                 [("merchantId" .=) <$> _ordMerchantId,
                  ("disbursementId" .=) <$> _ordDisbursementId,
                  ("disbursementCreationDate" .=) <$>
                    _ordDisbursementCreationDate,
                  ("disbursementDate" .=) <$> _ordDisbursementDate,
                  ("disbursementAmount" .=) <$>
                    _ordDisbursementAmount])

--
-- /See:/ 'unitInvoice' smart constructor.
data UnitInvoice = UnitInvoice'
    { _uiUnitPriceTaxes    :: !(Maybe [UnitInvoiceTaxLine])
    , _uiPromotions        :: !(Maybe [Promotion])
    , _uiAdditionalCharges :: !(Maybe [UnitInvoiceAdditionalCharge])
    , _uiUnitPricePretax   :: !(Maybe Price)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'UnitInvoice' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'uiUnitPriceTaxes'
--
-- * 'uiPromotions'
--
-- * 'uiAdditionalCharges'
--
-- * 'uiUnitPricePretax'
unitInvoice
    :: UnitInvoice
unitInvoice =
    UnitInvoice'
    { _uiUnitPriceTaxes = Nothing
    , _uiPromotions = Nothing
    , _uiAdditionalCharges = Nothing
    , _uiUnitPricePretax = Nothing
    }

-- | Tax amounts to apply to the unit price.
uiUnitPriceTaxes :: Lens' UnitInvoice [UnitInvoiceTaxLine]
uiUnitPriceTaxes
  = lens _uiUnitPriceTaxes
      (\ s a -> s{_uiUnitPriceTaxes = a})
      . _Default
      . _Coerce

-- | Promotions applied to a unit.
uiPromotions :: Lens' UnitInvoice [Promotion]
uiPromotions
  = lens _uiPromotions (\ s a -> s{_uiPromotions = a})
      . _Default
      . _Coerce

-- | Additional charges for a unit, e.g. shipping costs.
uiAdditionalCharges :: Lens' UnitInvoice [UnitInvoiceAdditionalCharge]
uiAdditionalCharges
  = lens _uiAdditionalCharges
      (\ s a -> s{_uiAdditionalCharges = a})
      . _Default
      . _Coerce

-- | [required] Price of the unit, before applying taxes.
uiUnitPricePretax :: Lens' UnitInvoice (Maybe Price)
uiUnitPricePretax
  = lens _uiUnitPricePretax
      (\ s a -> s{_uiUnitPricePretax = a})

instance FromJSON UnitInvoice where
        parseJSON
          = withObject "UnitInvoice"
              (\ o ->
                 UnitInvoice' <$>
                   (o .:? "unitPriceTaxes" .!= mempty) <*>
                     (o .:? "promotions" .!= mempty)
                     <*> (o .:? "additionalCharges" .!= mempty)
                     <*> (o .:? "unitPricePretax"))

instance ToJSON UnitInvoice where
        toJSON UnitInvoice'{..}
          = object
              (catMaybes
                 [("unitPriceTaxes" .=) <$> _uiUnitPriceTaxes,
                  ("promotions" .=) <$> _uiPromotions,
                  ("additionalCharges" .=) <$> _uiAdditionalCharges,
                  ("unitPricePretax" .=) <$> _uiUnitPricePretax])

-- | The change of the available quantity of an item at the given store.
--
-- /See:/ 'posSale' smart constructor.
data PosSale = PosSale'
    { _psStoreCode       :: !(Maybe Text)
    , _psKind            :: !Text
    , _psItemId          :: !(Maybe Text)
    , _psQuantity        :: !(Maybe (Textual Int64))
    , _psTargetCountry   :: !(Maybe Text)
    , _psGtin            :: !(Maybe Text)
    , _psPrice           :: !(Maybe Price)
    , _psContentLanguage :: !(Maybe Text)
    , _psTimestamp       :: !(Maybe Text)
    , _psSaleId          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'PosSale' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'psStoreCode'
--
-- * 'psKind'
--
-- * 'psItemId'
--
-- * 'psQuantity'
--
-- * 'psTargetCountry'
--
-- * 'psGtin'
--
-- * 'psPrice'
--
-- * 'psContentLanguage'
--
-- * 'psTimestamp'
--
-- * 'psSaleId'
posSale
    :: PosSale
posSale =
    PosSale'
    { _psStoreCode = Nothing
    , _psKind = "content#posSale"
    , _psItemId = Nothing
    , _psQuantity = Nothing
    , _psTargetCountry = Nothing
    , _psGtin = Nothing
    , _psPrice = Nothing
    , _psContentLanguage = Nothing
    , _psTimestamp = Nothing
    , _psSaleId = Nothing
    }

-- | The identifier of the merchant\'s store. Either a storeCode inserted via
-- the API or the code of the store in Google My Business.
psStoreCode :: Lens' PosSale (Maybe Text)
psStoreCode
  = lens _psStoreCode (\ s a -> s{_psStoreCode = a})

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#posSale\".
psKind :: Lens' PosSale Text
psKind = lens _psKind (\ s a -> s{_psKind = a})

-- | A unique identifier for the item.
psItemId :: Lens' PosSale (Maybe Text)
psItemId = lens _psItemId (\ s a -> s{_psItemId = a})

-- | The relative change of the available quantity. Negative for items
-- returned.
psQuantity :: Lens' PosSale (Maybe Int64)
psQuantity
  = lens _psQuantity (\ s a -> s{_psQuantity = a}) .
      mapping _Coerce

-- | The CLDR territory code for the item.
psTargetCountry :: Lens' PosSale (Maybe Text)
psTargetCountry
  = lens _psTargetCountry
      (\ s a -> s{_psTargetCountry = a})

-- | Global Trade Item Number.
psGtin :: Lens' PosSale (Maybe Text)
psGtin = lens _psGtin (\ s a -> s{_psGtin = a})

-- | The price of the item.
psPrice :: Lens' PosSale (Maybe Price)
psPrice = lens _psPrice (\ s a -> s{_psPrice = a})

-- | The two-letter ISO 639-1 language code for the item.
psContentLanguage :: Lens' PosSale (Maybe Text)
psContentLanguage
  = lens _psContentLanguage
      (\ s a -> s{_psContentLanguage = a})

-- | The inventory timestamp, in ISO 8601 format.
psTimestamp :: Lens' PosSale (Maybe Text)
psTimestamp
  = lens _psTimestamp (\ s a -> s{_psTimestamp = a})

-- | A unique ID to group items from the same sale event.
psSaleId :: Lens' PosSale (Maybe Text)
psSaleId = lens _psSaleId (\ s a -> s{_psSaleId = a})

instance FromJSON PosSale where
        parseJSON
          = withObject "PosSale"
              (\ o ->
                 PosSale' <$>
                   (o .:? "storeCode") <*>
                     (o .:? "kind" .!= "content#posSale")
                     <*> (o .:? "itemId")
                     <*> (o .:? "quantity")
                     <*> (o .:? "targetCountry")
                     <*> (o .:? "gtin")
                     <*> (o .:? "price")
                     <*> (o .:? "contentLanguage")
                     <*> (o .:? "timestamp")
                     <*> (o .:? "saleId"))

instance ToJSON PosSale where
        toJSON PosSale'{..}
          = object
              (catMaybes
                 [("storeCode" .=) <$> _psStoreCode,
                  Just ("kind" .= _psKind),
                  ("itemId" .=) <$> _psItemId,
                  ("quantity" .=) <$> _psQuantity,
                  ("targetCountry" .=) <$> _psTargetCountry,
                  ("gtin" .=) <$> _psGtin, ("price" .=) <$> _psPrice,
                  ("contentLanguage" .=) <$> _psContentLanguage,
                  ("timestamp" .=) <$> _psTimestamp,
                  ("saleId" .=) <$> _psSaleId])

--
-- /See:/ 'accountStatusItemLevelIssue' smart constructor.
data AccountStatusItemLevelIssue = AccountStatusItemLevelIssue'
    { _asiliNumItems      :: !(Maybe (Textual Int64))
    , _asiliResolution    :: !(Maybe Text)
    , _asiliDocumentation :: !(Maybe Text)
    , _asiliCode          :: !(Maybe Text)
    , _asiliServability   :: !(Maybe Text)
    , _asiliAttributeName :: !(Maybe Text)
    , _asiliDescription   :: !(Maybe Text)
    , _asiliDetail        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountStatusItemLevelIssue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'asiliNumItems'
--
-- * 'asiliResolution'
--
-- * 'asiliDocumentation'
--
-- * 'asiliCode'
--
-- * 'asiliServability'
--
-- * 'asiliAttributeName'
--
-- * 'asiliDescription'
--
-- * 'asiliDetail'
accountStatusItemLevelIssue
    :: AccountStatusItemLevelIssue
accountStatusItemLevelIssue =
    AccountStatusItemLevelIssue'
    { _asiliNumItems = Nothing
    , _asiliResolution = Nothing
    , _asiliDocumentation = Nothing
    , _asiliCode = Nothing
    , _asiliServability = Nothing
    , _asiliAttributeName = Nothing
    , _asiliDescription = Nothing
    , _asiliDetail = Nothing
    }

-- | Number of items with this issue.
asiliNumItems :: Lens' AccountStatusItemLevelIssue (Maybe Int64)
asiliNumItems
  = lens _asiliNumItems
      (\ s a -> s{_asiliNumItems = a})
      . mapping _Coerce

-- | Whether the issue can be resolved by the merchant.
asiliResolution :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliResolution
  = lens _asiliResolution
      (\ s a -> s{_asiliResolution = a})

-- | The URL of a web page to help with resolving this issue.
asiliDocumentation :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliDocumentation
  = lens _asiliDocumentation
      (\ s a -> s{_asiliDocumentation = a})

-- | The error code of the issue.
asiliCode :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliCode
  = lens _asiliCode (\ s a -> s{_asiliCode = a})

-- | How this issue affects serving of the offer.
asiliServability :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliServability
  = lens _asiliServability
      (\ s a -> s{_asiliServability = a})

-- | The attribute\'s name, if the issue is caused by a single attribute.
asiliAttributeName :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliAttributeName
  = lens _asiliAttributeName
      (\ s a -> s{_asiliAttributeName = a})

-- | A short issue description in English.
asiliDescription :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliDescription
  = lens _asiliDescription
      (\ s a -> s{_asiliDescription = a})

-- | A detailed issue description in English.
asiliDetail :: Lens' AccountStatusItemLevelIssue (Maybe Text)
asiliDetail
  = lens _asiliDetail (\ s a -> s{_asiliDetail = a})

instance FromJSON AccountStatusItemLevelIssue where
        parseJSON
          = withObject "AccountStatusItemLevelIssue"
              (\ o ->
                 AccountStatusItemLevelIssue' <$>
                   (o .:? "numItems") <*> (o .:? "resolution") <*>
                     (o .:? "documentation")
                     <*> (o .:? "code")
                     <*> (o .:? "servability")
                     <*> (o .:? "attributeName")
                     <*> (o .:? "description")
                     <*> (o .:? "detail"))

instance ToJSON AccountStatusItemLevelIssue where
        toJSON AccountStatusItemLevelIssue'{..}
          = object
              (catMaybes
                 [("numItems" .=) <$> _asiliNumItems,
                  ("resolution" .=) <$> _asiliResolution,
                  ("documentation" .=) <$> _asiliDocumentation,
                  ("code" .=) <$> _asiliCode,
                  ("servability" .=) <$> _asiliServability,
                  ("attributeName" .=) <$> _asiliAttributeName,
                  ("description" .=) <$> _asiliDescription,
                  ("detail" .=) <$> _asiliDetail])

--
-- /See:/ 'liaSettingsRequestGmbAccessResponse' smart constructor.
newtype LiaSettingsRequestGmbAccessResponse = LiaSettingsRequestGmbAccessResponse'
    { _lsrgarKind :: Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LiaSettingsRequestGmbAccessResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lsrgarKind'
liaSettingsRequestGmbAccessResponse
    :: LiaSettingsRequestGmbAccessResponse
liaSettingsRequestGmbAccessResponse =
    LiaSettingsRequestGmbAccessResponse'
    { _lsrgarKind = "content#liasettingsRequestGmbAccessResponse"
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#liasettingsRequestGmbAccessResponse\".
lsrgarKind :: Lens' LiaSettingsRequestGmbAccessResponse Text
lsrgarKind
  = lens _lsrgarKind (\ s a -> s{_lsrgarKind = a})

instance FromJSON LiaSettingsRequestGmbAccessResponse
         where
        parseJSON
          = withObject "LiaSettingsRequestGmbAccessResponse"
              (\ o ->
                 LiaSettingsRequestGmbAccessResponse' <$>
                   (o .:? "kind" .!=
                      "content#liasettingsRequestGmbAccessResponse"))

instance ToJSON LiaSettingsRequestGmbAccessResponse
         where
        toJSON LiaSettingsRequestGmbAccessResponse'{..}
          = object (catMaybes [Just ("kind" .= _lsrgarKind)])

--
-- /See:/ 'productStatusDestinationStatus' smart constructor.
data ProductStatusDestinationStatus = ProductStatusDestinationStatus'
    { _psdsDestination :: !(Maybe Text)
    , _psdsStatus      :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProductStatusDestinationStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'psdsDestination'
--
-- * 'psdsStatus'
productStatusDestinationStatus
    :: ProductStatusDestinationStatus
productStatusDestinationStatus =
    ProductStatusDestinationStatus'
    { _psdsDestination = Nothing
    , _psdsStatus = Nothing
    }

-- | The name of the destination
psdsDestination :: Lens' ProductStatusDestinationStatus (Maybe Text)
psdsDestination
  = lens _psdsDestination
      (\ s a -> s{_psdsDestination = a})

psdsStatus :: Lens' ProductStatusDestinationStatus (Maybe Text)
psdsStatus
  = lens _psdsStatus (\ s a -> s{_psdsStatus = a})

instance FromJSON ProductStatusDestinationStatus
         where
        parseJSON
          = withObject "ProductStatusDestinationStatus"
              (\ o ->
                 ProductStatusDestinationStatus' <$>
                   (o .:? "destination") <*> (o .:? "status"))

instance ToJSON ProductStatusDestinationStatus where
        toJSON ProductStatusDestinationStatus'{..}
          = object
              (catMaybes
                 [("destination" .=) <$> _psdsDestination,
                  ("status" .=) <$> _psdsStatus])

-- | Tax calculation rule to apply in a state or province (USA only).
--
-- /See:/ 'accountTaxTaxRule' smart constructor.
data AccountTaxTaxRule = AccountTaxTaxRule'
    { _attrUseGlobalRate :: !(Maybe Bool)
    , _attrCountry       :: !(Maybe Text)
    , _attrShippingTaxed :: !(Maybe Bool)
    , _attrLocationId    :: !(Maybe (Textual Word64))
    , _attrRatePercent   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountTaxTaxRule' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'attrUseGlobalRate'
--
-- * 'attrCountry'
--
-- * 'attrShippingTaxed'
--
-- * 'attrLocationId'
--
-- * 'attrRatePercent'
accountTaxTaxRule
    :: AccountTaxTaxRule
accountTaxTaxRule =
    AccountTaxTaxRule'
    { _attrUseGlobalRate = Nothing
    , _attrCountry = Nothing
    , _attrShippingTaxed = Nothing
    , _attrLocationId = Nothing
    , _attrRatePercent = Nothing
    }

-- | Whether the tax rate is taken from a global tax table or specified
-- explicitly.
attrUseGlobalRate :: Lens' AccountTaxTaxRule (Maybe Bool)
attrUseGlobalRate
  = lens _attrUseGlobalRate
      (\ s a -> s{_attrUseGlobalRate = a})

-- | Country code in which tax is applicable.
attrCountry :: Lens' AccountTaxTaxRule (Maybe Text)
attrCountry
  = lens _attrCountry (\ s a -> s{_attrCountry = a})

-- | If true, shipping charges are also taxed.
attrShippingTaxed :: Lens' AccountTaxTaxRule (Maybe Bool)
attrShippingTaxed
  = lens _attrShippingTaxed
      (\ s a -> s{_attrShippingTaxed = a})

-- | State (or province) is which the tax is applicable, described by its
-- location id (also called criteria id).
attrLocationId :: Lens' AccountTaxTaxRule (Maybe Word64)
attrLocationId
  = lens _attrLocationId
      (\ s a -> s{_attrLocationId = a})
      . mapping _Coerce

-- | Explicit tax rate in percent, represented as a floating point number
-- without the percentage character. Must not be negative.
attrRatePercent :: Lens' AccountTaxTaxRule (Maybe Text)
attrRatePercent
  = lens _attrRatePercent
      (\ s a -> s{_attrRatePercent = a})

instance FromJSON AccountTaxTaxRule where
        parseJSON
          = withObject "AccountTaxTaxRule"
              (\ o ->
                 AccountTaxTaxRule' <$>
                   (o .:? "useGlobalRate") <*> (o .:? "country") <*>
                     (o .:? "shippingTaxed")
                     <*> (o .:? "locationId")
                     <*> (o .:? "ratePercent"))

instance ToJSON AccountTaxTaxRule where
        toJSON AccountTaxTaxRule'{..}
          = object
              (catMaybes
                 [("useGlobalRate" .=) <$> _attrUseGlobalRate,
                  ("country" .=) <$> _attrCountry,
                  ("shippingTaxed" .=) <$> _attrShippingTaxed,
                  ("locationId" .=) <$> _attrLocationId,
                  ("ratePercent" .=) <$> _attrRatePercent])

--
-- /See:/ 'postalCodeGroup' smart constructor.
data PostalCodeGroup = PostalCodeGroup'
    { _pcgCountry          :: !(Maybe Text)
    , _pcgPostalCodeRanges :: !(Maybe [PostalCodeRange])
    , _pcgName             :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'PostalCodeGroup' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pcgCountry'
--
-- * 'pcgPostalCodeRanges'
--
-- * 'pcgName'
postalCodeGroup
    :: PostalCodeGroup
postalCodeGroup =
    PostalCodeGroup'
    { _pcgCountry = Nothing
    , _pcgPostalCodeRanges = Nothing
    , _pcgName = Nothing
    }

-- | The CLDR territory code of the country the postal code group applies to.
-- Required.
pcgCountry :: Lens' PostalCodeGroup (Maybe Text)
pcgCountry
  = lens _pcgCountry (\ s a -> s{_pcgCountry = a})

-- | A range of postal codes. Required.
pcgPostalCodeRanges :: Lens' PostalCodeGroup [PostalCodeRange]
pcgPostalCodeRanges
  = lens _pcgPostalCodeRanges
      (\ s a -> s{_pcgPostalCodeRanges = a})
      . _Default
      . _Coerce

-- | The name of the postal code group, referred to in headers. Required.
pcgName :: Lens' PostalCodeGroup (Maybe Text)
pcgName = lens _pcgName (\ s a -> s{_pcgName = a})

instance FromJSON PostalCodeGroup where
        parseJSON
          = withObject "PostalCodeGroup"
              (\ o ->
                 PostalCodeGroup' <$>
                   (o .:? "country") <*>
                     (o .:? "postalCodeRanges" .!= mempty)
                     <*> (o .:? "name"))

instance ToJSON PostalCodeGroup where
        toJSON PostalCodeGroup'{..}
          = object
              (catMaybes
                 [("country" .=) <$> _pcgCountry,
                  ("postalCodeRanges" .=) <$> _pcgPostalCodeRanges,
                  ("name" .=) <$> _pcgName])

--
-- /See:/ 'datafeedsCustomBatchRequest' smart constructor.
newtype DatafeedsCustomBatchRequest = DatafeedsCustomBatchRequest'
    { _dEntries :: Maybe [DatafeedsCustomBatchRequestEntry]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'DatafeedsCustomBatchRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dEntries'
datafeedsCustomBatchRequest
    :: DatafeedsCustomBatchRequest
datafeedsCustomBatchRequest =
    DatafeedsCustomBatchRequest'
    { _dEntries = Nothing
    }

-- | The request entries to be processed in the batch.
dEntries :: Lens' DatafeedsCustomBatchRequest [DatafeedsCustomBatchRequestEntry]
dEntries
  = lens _dEntries (\ s a -> s{_dEntries = a}) .
      _Default
      . _Coerce

instance FromJSON DatafeedsCustomBatchRequest where
        parseJSON
          = withObject "DatafeedsCustomBatchRequest"
              (\ o ->
                 DatafeedsCustomBatchRequest' <$>
                   (o .:? "entries" .!= mempty))

instance ToJSON DatafeedsCustomBatchRequest where
        toJSON DatafeedsCustomBatchRequest'{..}
          = object (catMaybes [("entries" .=) <$> _dEntries])

--
-- /See:/ 'orderpaymentsNotifyChargeRequest' smart constructor.
data OrderpaymentsNotifyChargeRequest = OrderpaymentsNotifyChargeRequest'
    { _oncrInvoiceIds  :: !(Maybe [Text])
    , _oncrChargeState :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderpaymentsNotifyChargeRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oncrInvoiceIds'
--
-- * 'oncrChargeState'
orderpaymentsNotifyChargeRequest
    :: OrderpaymentsNotifyChargeRequest
orderpaymentsNotifyChargeRequest =
    OrderpaymentsNotifyChargeRequest'
    { _oncrInvoiceIds = Nothing
    , _oncrChargeState = Nothing
    }

-- | Invoice IDs from the orderinvoices service that correspond to the
-- charge.
oncrInvoiceIds :: Lens' OrderpaymentsNotifyChargeRequest [Text]
oncrInvoiceIds
  = lens _oncrInvoiceIds
      (\ s a -> s{_oncrInvoiceIds = a})
      . _Default
      . _Coerce

-- | Whether charge was successful.
oncrChargeState :: Lens' OrderpaymentsNotifyChargeRequest (Maybe Text)
oncrChargeState
  = lens _oncrChargeState
      (\ s a -> s{_oncrChargeState = a})

instance FromJSON OrderpaymentsNotifyChargeRequest
         where
        parseJSON
          = withObject "OrderpaymentsNotifyChargeRequest"
              (\ o ->
                 OrderpaymentsNotifyChargeRequest' <$>
                   (o .:? "invoiceIds" .!= mempty) <*>
                     (o .:? "chargeState"))

instance ToJSON OrderpaymentsNotifyChargeRequest
         where
        toJSON OrderpaymentsNotifyChargeRequest'{..}
          = object
              (catMaybes
                 [("invoiceIds" .=) <$> _oncrInvoiceIds,
                  ("chargeState" .=) <$> _oncrChargeState])

--
-- /See:/ 'ordersCancelTestOrderByCustomerResponse' smart constructor.
newtype OrdersCancelTestOrderByCustomerResponse = OrdersCancelTestOrderByCustomerResponse'
    { _octobcrKind :: Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersCancelTestOrderByCustomerResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'octobcrKind'
ordersCancelTestOrderByCustomerResponse
    :: OrdersCancelTestOrderByCustomerResponse
ordersCancelTestOrderByCustomerResponse =
    OrdersCancelTestOrderByCustomerResponse'
    { _octobcrKind = "content#ordersCancelTestOrderByCustomerResponse"
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#ordersCancelTestOrderByCustomerResponse\".
octobcrKind :: Lens' OrdersCancelTestOrderByCustomerResponse Text
octobcrKind
  = lens _octobcrKind (\ s a -> s{_octobcrKind = a})

instance FromJSON
         OrdersCancelTestOrderByCustomerResponse where
        parseJSON
          = withObject
              "OrdersCancelTestOrderByCustomerResponse"
              (\ o ->
                 OrdersCancelTestOrderByCustomerResponse' <$>
                   (o .:? "kind" .!=
                      "content#ordersCancelTestOrderByCustomerResponse"))

instance ToJSON
         OrdersCancelTestOrderByCustomerResponse where
        toJSON OrdersCancelTestOrderByCustomerResponse'{..}
          = object (catMaybes [Just ("kind" .= _octobcrKind)])

--
-- /See:/ 'liaOnDisplayToOrderSettings' smart constructor.
data LiaOnDisplayToOrderSettings = LiaOnDisplayToOrderSettings'
    { _lodtosStatus                :: !(Maybe Text)
    , _lodtosShippingCostPolicyURL :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LiaOnDisplayToOrderSettings' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lodtosStatus'
--
-- * 'lodtosShippingCostPolicyURL'
liaOnDisplayToOrderSettings
    :: LiaOnDisplayToOrderSettings
liaOnDisplayToOrderSettings =
    LiaOnDisplayToOrderSettings'
    { _lodtosStatus = Nothing
    , _lodtosShippingCostPolicyURL = Nothing
    }

-- | The status of the ?On display to order? feature.
lodtosStatus :: Lens' LiaOnDisplayToOrderSettings (Maybe Text)
lodtosStatus
  = lens _lodtosStatus (\ s a -> s{_lodtosStatus = a})

-- | Shipping cost and policy URL.
lodtosShippingCostPolicyURL :: Lens' LiaOnDisplayToOrderSettings (Maybe Text)
lodtosShippingCostPolicyURL
  = lens _lodtosShippingCostPolicyURL
      (\ s a -> s{_lodtosShippingCostPolicyURL = a})

instance FromJSON LiaOnDisplayToOrderSettings where
        parseJSON
          = withObject "LiaOnDisplayToOrderSettings"
              (\ o ->
                 LiaOnDisplayToOrderSettings' <$>
                   (o .:? "status") <*> (o .:? "shippingCostPolicyUrl"))

instance ToJSON LiaOnDisplayToOrderSettings where
        toJSON LiaOnDisplayToOrderSettings'{..}
          = object
              (catMaybes
                 [("status" .=) <$> _lodtosStatus,
                  ("shippingCostPolicyUrl" .=) <$>
                    _lodtosShippingCostPolicyURL])

--
-- /See:/ 'orderpaymentsNotifyAuthDeclinedResponse' smart constructor.
data OrderpaymentsNotifyAuthDeclinedResponse = OrderpaymentsNotifyAuthDeclinedResponse'
    { _onadrKind            :: !Text
    , _onadrExecutionStatus :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderpaymentsNotifyAuthDeclinedResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'onadrKind'
--
-- * 'onadrExecutionStatus'
orderpaymentsNotifyAuthDeclinedResponse
    :: OrderpaymentsNotifyAuthDeclinedResponse
orderpaymentsNotifyAuthDeclinedResponse =
    OrderpaymentsNotifyAuthDeclinedResponse'
    { _onadrKind = "content#orderpaymentsNotifyAuthDeclinedResponse"
    , _onadrExecutionStatus = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#orderpaymentsNotifyAuthDeclinedResponse\".
onadrKind :: Lens' OrderpaymentsNotifyAuthDeclinedResponse Text
onadrKind
  = lens _onadrKind (\ s a -> s{_onadrKind = a})

-- | The status of the execution.
onadrExecutionStatus :: Lens' OrderpaymentsNotifyAuthDeclinedResponse (Maybe Text)
onadrExecutionStatus
  = lens _onadrExecutionStatus
      (\ s a -> s{_onadrExecutionStatus = a})

instance FromJSON
         OrderpaymentsNotifyAuthDeclinedResponse where
        parseJSON
          = withObject
              "OrderpaymentsNotifyAuthDeclinedResponse"
              (\ o ->
                 OrderpaymentsNotifyAuthDeclinedResponse' <$>
                   (o .:? "kind" .!=
                      "content#orderpaymentsNotifyAuthDeclinedResponse")
                     <*> (o .:? "executionStatus"))

instance ToJSON
         OrderpaymentsNotifyAuthDeclinedResponse where
        toJSON OrderpaymentsNotifyAuthDeclinedResponse'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _onadrKind),
                  ("executionStatus" .=) <$> _onadrExecutionStatus])

--
-- /See:/ 'accountAddress' smart constructor.
data AccountAddress = AccountAddress'
    { _aaStreetAddress :: !(Maybe Text)
    , _aaCountry       :: !(Maybe Text)
    , _aaPostalCode    :: !(Maybe Text)
    , _aaLocality      :: !(Maybe Text)
    , _aaRegion        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountAddress' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aaStreetAddress'
--
-- * 'aaCountry'
--
-- * 'aaPostalCode'
--
-- * 'aaLocality'
--
-- * 'aaRegion'
accountAddress
    :: AccountAddress
accountAddress =
    AccountAddress'
    { _aaStreetAddress = Nothing
    , _aaCountry = Nothing
    , _aaPostalCode = Nothing
    , _aaLocality = Nothing
    , _aaRegion = Nothing
    }

-- | Street-level part of the address.
aaStreetAddress :: Lens' AccountAddress (Maybe Text)
aaStreetAddress
  = lens _aaStreetAddress
      (\ s a -> s{_aaStreetAddress = a})

-- | CLDR country code (e.g. \"US\").
aaCountry :: Lens' AccountAddress (Maybe Text)
aaCountry
  = lens _aaCountry (\ s a -> s{_aaCountry = a})

-- | Postal code or ZIP (e.g. \"94043\").
aaPostalCode :: Lens' AccountAddress (Maybe Text)
aaPostalCode
  = lens _aaPostalCode (\ s a -> s{_aaPostalCode = a})

-- | City, town or commune. May also include dependent localities or
-- sublocalities (e.g. neighborhoods or suburbs).
aaLocality :: Lens' AccountAddress (Maybe Text)
aaLocality
  = lens _aaLocality (\ s a -> s{_aaLocality = a})

-- | Top-level administrative subdivision of the country. For example, a
-- state like California (\"CA\") or a province like Quebec (\"QC\").
aaRegion :: Lens' AccountAddress (Maybe Text)
aaRegion = lens _aaRegion (\ s a -> s{_aaRegion = a})

instance FromJSON AccountAddress where
        parseJSON
          = withObject "AccountAddress"
              (\ o ->
                 AccountAddress' <$>
                   (o .:? "streetAddress") <*> (o .:? "country") <*>
                     (o .:? "postalCode")
                     <*> (o .:? "locality")
                     <*> (o .:? "region"))

instance ToJSON AccountAddress where
        toJSON AccountAddress'{..}
          = object
              (catMaybes
                 [("streetAddress" .=) <$> _aaStreetAddress,
                  ("country" .=) <$> _aaCountry,
                  ("postalCode" .=) <$> _aaPostalCode,
                  ("locality" .=) <$> _aaLocality,
                  ("region" .=) <$> _aaRegion])

--
-- /See:/ 'invoiceSummaryAdditionalChargeSummary' smart constructor.
data InvoiceSummaryAdditionalChargeSummary = InvoiceSummaryAdditionalChargeSummary'
    { _isacsTotalAmount :: !(Maybe Amount)
    , _isacsType        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'InvoiceSummaryAdditionalChargeSummary' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'isacsTotalAmount'
--
-- * 'isacsType'
invoiceSummaryAdditionalChargeSummary
    :: InvoiceSummaryAdditionalChargeSummary
invoiceSummaryAdditionalChargeSummary =
    InvoiceSummaryAdditionalChargeSummary'
    { _isacsTotalAmount = Nothing
    , _isacsType = Nothing
    }

-- | [required] Total additional charge for this type.
isacsTotalAmount :: Lens' InvoiceSummaryAdditionalChargeSummary (Maybe Amount)
isacsTotalAmount
  = lens _isacsTotalAmount
      (\ s a -> s{_isacsTotalAmount = a})

-- | [required] Type of the additional charge.
isacsType :: Lens' InvoiceSummaryAdditionalChargeSummary (Maybe Text)
isacsType
  = lens _isacsType (\ s a -> s{_isacsType = a})

instance FromJSON
         InvoiceSummaryAdditionalChargeSummary where
        parseJSON
          = withObject "InvoiceSummaryAdditionalChargeSummary"
              (\ o ->
                 InvoiceSummaryAdditionalChargeSummary' <$>
                   (o .:? "totalAmount") <*> (o .:? "type"))

instance ToJSON InvoiceSummaryAdditionalChargeSummary
         where
        toJSON InvoiceSummaryAdditionalChargeSummary'{..}
          = object
              (catMaybes
                 [("totalAmount" .=) <$> _isacsTotalAmount,
                  ("type" .=) <$> _isacsType])

--
-- /See:/ 'refundReason' smart constructor.
data RefundReason = RefundReason'
    { _rrReasonCode  :: !(Maybe Text)
    , _rrDescription :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'RefundReason' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rrReasonCode'
--
-- * 'rrDescription'
refundReason
    :: RefundReason
refundReason =
    RefundReason'
    { _rrReasonCode = Nothing
    , _rrDescription = Nothing
    }

rrReasonCode :: Lens' RefundReason (Maybe Text)
rrReasonCode
  = lens _rrReasonCode (\ s a -> s{_rrReasonCode = a})

rrDescription :: Lens' RefundReason (Maybe Text)
rrDescription
  = lens _rrDescription
      (\ s a -> s{_rrDescription = a})

instance FromJSON RefundReason where
        parseJSON
          = withObject "RefundReason"
              (\ o ->
                 RefundReason' <$>
                   (o .:? "reasonCode") <*> (o .:? "description"))

instance ToJSON RefundReason where
        toJSON RefundReason'{..}
          = object
              (catMaybes
                 [("reasonCode" .=) <$> _rrReasonCode,
                  ("description" .=) <$> _rrDescription])

--
-- /See:/ 'orderLineItemShippingDetailsMethod' smart constructor.
data OrderLineItemShippingDetailsMethod = OrderLineItemShippingDetailsMethod'
    { _olisdmCarrier          :: !(Maybe Text)
    , _olisdmMethodName       :: !(Maybe Text)
    , _olisdmMaxDaysInTransit :: !(Maybe (Textual Word32))
    , _olisdmMinDaysInTransit :: !(Maybe (Textual Word32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderLineItemShippingDetailsMethod' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'olisdmCarrier'
--
-- * 'olisdmMethodName'
--
-- * 'olisdmMaxDaysInTransit'
--
-- * 'olisdmMinDaysInTransit'
orderLineItemShippingDetailsMethod
    :: OrderLineItemShippingDetailsMethod
orderLineItemShippingDetailsMethod =
    OrderLineItemShippingDetailsMethod'
    { _olisdmCarrier = Nothing
    , _olisdmMethodName = Nothing
    , _olisdmMaxDaysInTransit = Nothing
    , _olisdmMinDaysInTransit = Nothing
    }

-- | The carrier for the shipping. Optional. See shipments[].carrier for a
-- list of acceptable values.
olisdmCarrier :: Lens' OrderLineItemShippingDetailsMethod (Maybe Text)
olisdmCarrier
  = lens _olisdmCarrier
      (\ s a -> s{_olisdmCarrier = a})

-- | The name of the shipping method.
olisdmMethodName :: Lens' OrderLineItemShippingDetailsMethod (Maybe Text)
olisdmMethodName
  = lens _olisdmMethodName
      (\ s a -> s{_olisdmMethodName = a})

-- | Maximum transit time.
olisdmMaxDaysInTransit :: Lens' OrderLineItemShippingDetailsMethod (Maybe Word32)
olisdmMaxDaysInTransit
  = lens _olisdmMaxDaysInTransit
      (\ s a -> s{_olisdmMaxDaysInTransit = a})
      . mapping _Coerce

-- | Minimum transit time.
olisdmMinDaysInTransit :: Lens' OrderLineItemShippingDetailsMethod (Maybe Word32)
olisdmMinDaysInTransit
  = lens _olisdmMinDaysInTransit
      (\ s a -> s{_olisdmMinDaysInTransit = a})
      . mapping _Coerce

instance FromJSON OrderLineItemShippingDetailsMethod
         where
        parseJSON
          = withObject "OrderLineItemShippingDetailsMethod"
              (\ o ->
                 OrderLineItemShippingDetailsMethod' <$>
                   (o .:? "carrier") <*> (o .:? "methodName") <*>
                     (o .:? "maxDaysInTransit")
                     <*> (o .:? "minDaysInTransit"))

instance ToJSON OrderLineItemShippingDetailsMethod
         where
        toJSON OrderLineItemShippingDetailsMethod'{..}
          = object
              (catMaybes
                 [("carrier" .=) <$> _olisdmCarrier,
                  ("methodName" .=) <$> _olisdmMethodName,
                  ("maxDaysInTransit" .=) <$> _olisdmMaxDaysInTransit,
                  ("minDaysInTransit" .=) <$> _olisdmMinDaysInTransit])

-- | Datafeed configuration data.
--
-- /See:/ 'datafeed' smart constructor.
data Datafeed = Datafeed'
    { _dKind              :: !Text
    , _dFormat            :: !(Maybe DatafeedFormat)
    , _dAttributeLanguage :: !(Maybe Text)
    , _dFetchSchedule     :: !(Maybe DatafeedFetchSchedule)
    , _dName              :: !(Maybe Text)
    , _dTargets           :: !(Maybe [DatafeedTarget])
    , _dId                :: !(Maybe (Textual Int64))
    , _dContentType       :: !(Maybe Text)
    , _dFileName          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Datafeed' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dKind'
--
-- * 'dFormat'
--
-- * 'dAttributeLanguage'
--
-- * 'dFetchSchedule'
--
-- * 'dName'
--
-- * 'dTargets'
--
-- * 'dId'
--
-- * 'dContentType'
--
-- * 'dFileName'
datafeed
    :: Datafeed
datafeed =
    Datafeed'
    { _dKind = "content#datafeed"
    , _dFormat = Nothing
    , _dAttributeLanguage = Nothing
    , _dFetchSchedule = Nothing
    , _dName = Nothing
    , _dTargets = Nothing
    , _dId = Nothing
    , _dContentType = Nothing
    , _dFileName = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#datafeed\".
dKind :: Lens' Datafeed Text
dKind = lens _dKind (\ s a -> s{_dKind = a})

-- | Format of the feed file.
dFormat :: Lens' Datafeed (Maybe DatafeedFormat)
dFormat = lens _dFormat (\ s a -> s{_dFormat = a})

-- | The two-letter ISO 639-1 language in which the attributes are defined in
-- the data feed.
dAttributeLanguage :: Lens' Datafeed (Maybe Text)
dAttributeLanguage
  = lens _dAttributeLanguage
      (\ s a -> s{_dAttributeLanguage = a})

-- | Fetch schedule for the feed file.
dFetchSchedule :: Lens' Datafeed (Maybe DatafeedFetchSchedule)
dFetchSchedule
  = lens _dFetchSchedule
      (\ s a -> s{_dFetchSchedule = a})

-- | A descriptive name of the data feed.
dName :: Lens' Datafeed (Maybe Text)
dName = lens _dName (\ s a -> s{_dName = a})

-- | The targets this feed should apply to (country, language, destinations).
dTargets :: Lens' Datafeed [DatafeedTarget]
dTargets
  = lens _dTargets (\ s a -> s{_dTargets = a}) .
      _Default
      . _Coerce

-- | The ID of the data feed.
dId :: Lens' Datafeed (Maybe Int64)
dId
  = lens _dId (\ s a -> s{_dId = a}) . mapping _Coerce

-- | The type of data feed. For product inventory feeds, only feeds for local
-- stores, not online stores, are supported.
dContentType :: Lens' Datafeed (Maybe Text)
dContentType
  = lens _dContentType (\ s a -> s{_dContentType = a})

-- | The filename of the feed. All feeds must have a unique file name.
dFileName :: Lens' Datafeed (Maybe Text)
dFileName
  = lens _dFileName (\ s a -> s{_dFileName = a})

instance FromJSON Datafeed where
        parseJSON
          = withObject "Datafeed"
              (\ o ->
                 Datafeed' <$>
                   (o .:? "kind" .!= "content#datafeed") <*>
                     (o .:? "format")
                     <*> (o .:? "attributeLanguage")
                     <*> (o .:? "fetchSchedule")
                     <*> (o .:? "name")
                     <*> (o .:? "targets" .!= mempty)
                     <*> (o .:? "id")
                     <*> (o .:? "contentType")
                     <*> (o .:? "fileName"))

instance ToJSON Datafeed where
        toJSON Datafeed'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _dKind), ("format" .=) <$> _dFormat,
                  ("attributeLanguage" .=) <$> _dAttributeLanguage,
                  ("fetchSchedule" .=) <$> _dFetchSchedule,
                  ("name" .=) <$> _dName, ("targets" .=) <$> _dTargets,
                  ("id" .=) <$> _dId,
                  ("contentType" .=) <$> _dContentType,
                  ("fileName" .=) <$> _dFileName])

--
-- /See:/ 'ordersCreateTestOrderResponse' smart constructor.
data OrdersCreateTestOrderResponse = OrdersCreateTestOrderResponse'
    { _octorKind    :: !Text
    , _octorOrderId :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersCreateTestOrderResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'octorKind'
--
-- * 'octorOrderId'
ordersCreateTestOrderResponse
    :: OrdersCreateTestOrderResponse
ordersCreateTestOrderResponse =
    OrdersCreateTestOrderResponse'
    { _octorKind = "content#ordersCreateTestOrderResponse"
    , _octorOrderId = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#ordersCreateTestOrderResponse\".
octorKind :: Lens' OrdersCreateTestOrderResponse Text
octorKind
  = lens _octorKind (\ s a -> s{_octorKind = a})

-- | The ID of the newly created test order.
octorOrderId :: Lens' OrdersCreateTestOrderResponse (Maybe Text)
octorOrderId
  = lens _octorOrderId (\ s a -> s{_octorOrderId = a})

instance FromJSON OrdersCreateTestOrderResponse where
        parseJSON
          = withObject "OrdersCreateTestOrderResponse"
              (\ o ->
                 OrdersCreateTestOrderResponse' <$>
                   (o .:? "kind" .!=
                      "content#ordersCreateTestOrderResponse")
                     <*> (o .:? "orderId"))

instance ToJSON OrdersCreateTestOrderResponse where
        toJSON OrdersCreateTestOrderResponse'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _octorKind),
                  ("orderId" .=) <$> _octorOrderId])

-- | A batch entry encoding a single non-batch accounts response.
--
-- /See:/ 'accountsCustomBatchResponseEntry' smart constructor.
data AccountsCustomBatchResponseEntry = AccountsCustomBatchResponseEntry'
    { _aKind    :: !Text
    , _aAccount :: !(Maybe Account)
    , _aErrors  :: !(Maybe Errors)
    , _aBatchId :: !(Maybe (Textual Word32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountsCustomBatchResponseEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aKind'
--
-- * 'aAccount'
--
-- * 'aErrors'
--
-- * 'aBatchId'
accountsCustomBatchResponseEntry
    :: AccountsCustomBatchResponseEntry
accountsCustomBatchResponseEntry =
    AccountsCustomBatchResponseEntry'
    { _aKind = "content#accountsCustomBatchResponseEntry"
    , _aAccount = Nothing
    , _aErrors = Nothing
    , _aBatchId = Nothing
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#accountsCustomBatchResponseEntry\".
aKind :: Lens' AccountsCustomBatchResponseEntry Text
aKind = lens _aKind (\ s a -> s{_aKind = a})

-- | The retrieved, created, or updated account. Not defined if the method
-- was delete, claimwebsite or link.
aAccount :: Lens' AccountsCustomBatchResponseEntry (Maybe Account)
aAccount = lens _aAccount (\ s a -> s{_aAccount = a})

-- | A list of errors defined if and only if the request failed.
aErrors :: Lens' AccountsCustomBatchResponseEntry (Maybe Errors)
aErrors = lens _aErrors (\ s a -> s{_aErrors = a})

-- | The ID of the request entry this entry responds to.
aBatchId :: Lens' AccountsCustomBatchResponseEntry (Maybe Word32)
aBatchId
  = lens _aBatchId (\ s a -> s{_aBatchId = a}) .
      mapping _Coerce

instance FromJSON AccountsCustomBatchResponseEntry
         where
        parseJSON
          = withObject "AccountsCustomBatchResponseEntry"
              (\ o ->
                 AccountsCustomBatchResponseEntry' <$>
                   (o .:? "kind" .!=
                      "content#accountsCustomBatchResponseEntry")
                     <*> (o .:? "account")
                     <*> (o .:? "errors")
                     <*> (o .:? "batchId"))

instance ToJSON AccountsCustomBatchResponseEntry
         where
        toJSON AccountsCustomBatchResponseEntry'{..}
          = object
              (catMaybes
                 [Just ("kind" .= _aKind),
                  ("account" .=) <$> _aAccount,
                  ("errors" .=) <$> _aErrors,
                  ("batchId" .=) <$> _aBatchId])

--
-- /See:/ 'gmbAccounts' smart constructor.
data GmbAccounts = GmbAccounts'
    { _gaGmbAccounts :: !(Maybe [GmbAccountsGmbAccount])
    , _gaAccountId   :: !(Maybe (Textual Word64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GmbAccounts' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gaGmbAccounts'
--
-- * 'gaAccountId'
gmbAccounts
    :: GmbAccounts
gmbAccounts =
    GmbAccounts'
    { _gaGmbAccounts = Nothing
    , _gaAccountId = Nothing
    }

-- | A list of GMB accounts which are available to the merchant.
gaGmbAccounts :: Lens' GmbAccounts [GmbAccountsGmbAccount]
gaGmbAccounts
  = lens _gaGmbAccounts
      (\ s a -> s{_gaGmbAccounts = a})
      . _Default
      . _Coerce

-- | The ID of the account.
gaAccountId :: Lens' GmbAccounts (Maybe Word64)
gaAccountId
  = lens _gaAccountId (\ s a -> s{_gaAccountId = a}) .
      mapping _Coerce

instance FromJSON GmbAccounts where
        parseJSON
          = withObject "GmbAccounts"
              (\ o ->
                 GmbAccounts' <$>
                   (o .:? "gmbAccounts" .!= mempty) <*>
                     (o .:? "accountId"))

instance ToJSON GmbAccounts where
        toJSON GmbAccounts'{..}
          = object
              (catMaybes
                 [("gmbAccounts" .=) <$> _gaGmbAccounts,
                  ("accountId" .=) <$> _gaAccountId])

--
-- /See:/ 'customerReturnReason' smart constructor.
data CustomerReturnReason = CustomerReturnReason'
    { _crrReasonCode  :: !(Maybe Text)
    , _crrDescription :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'CustomerReturnReason' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'crrReasonCode'
--
-- * 'crrDescription'
customerReturnReason
    :: CustomerReturnReason
customerReturnReason =
    CustomerReturnReason'
    { _crrReasonCode = Nothing
    , _crrDescription = Nothing
    }

crrReasonCode :: Lens' CustomerReturnReason (Maybe Text)
crrReasonCode
  = lens _crrReasonCode
      (\ s a -> s{_crrReasonCode = a})

crrDescription :: Lens' CustomerReturnReason (Maybe Text)
crrDescription
  = lens _crrDescription
      (\ s a -> s{_crrDescription = a})

instance FromJSON CustomerReturnReason where
        parseJSON
          = withObject "CustomerReturnReason"
              (\ o ->
                 CustomerReturnReason' <$>
                   (o .:? "reasonCode") <*> (o .:? "description"))

instance ToJSON CustomerReturnReason where
        toJSON CustomerReturnReason'{..}
          = object
              (catMaybes
                 [("reasonCode" .=) <$> _crrReasonCode,
                  ("description" .=) <$> _crrDescription])

--
-- /See:/ 'accountIdentifier' smart constructor.
data AccountIdentifier = AccountIdentifier'
    { _aiMerchantId   :: !(Maybe (Textual Word64))
    , _aiAggregatorId :: !(Maybe (Textual Word64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountIdentifier' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aiMerchantId'
--
-- * 'aiAggregatorId'
accountIdentifier
    :: AccountIdentifier
accountIdentifier =
    AccountIdentifier'
    { _aiMerchantId = Nothing
    , _aiAggregatorId = Nothing
    }

-- | The merchant account ID, set for individual accounts and subaccounts.
aiMerchantId :: Lens' AccountIdentifier (Maybe Word64)
aiMerchantId
  = lens _aiMerchantId (\ s a -> s{_aiMerchantId = a})
      . mapping _Coerce

-- | The aggregator ID, set for aggregators and subaccounts (in that case, it
-- represents the aggregator of the subaccount).
aiAggregatorId :: Lens' AccountIdentifier (Maybe Word64)
aiAggregatorId
  = lens _aiAggregatorId
      (\ s a -> s{_aiAggregatorId = a})
      . mapping _Coerce

instance FromJSON AccountIdentifier where
        parseJSON
          = withObject "AccountIdentifier"
              (\ o ->
                 AccountIdentifier' <$>
                   (o .:? "merchantId") <*> (o .:? "aggregatorId"))

instance ToJSON AccountIdentifier where
        toJSON AccountIdentifier'{..}
          = object
              (catMaybes
                 [("merchantId" .=) <$> _aiMerchantId,
                  ("aggregatorId" .=) <$> _aiAggregatorId])

--
-- /See:/ 'posCustomBatchRequest' smart constructor.
newtype PosCustomBatchRequest = PosCustomBatchRequest'
    { _pEntries :: Maybe [PosCustomBatchRequestEntry]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'PosCustomBatchRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pEntries'
posCustomBatchRequest
    :: PosCustomBatchRequest
posCustomBatchRequest =
    PosCustomBatchRequest'
    { _pEntries = Nothing
    }

-- | The request entries to be processed in the batch.
pEntries :: Lens' PosCustomBatchRequest [PosCustomBatchRequestEntry]
pEntries
  = lens _pEntries (\ s a -> s{_pEntries = a}) .
      _Default
      . _Coerce

instance FromJSON PosCustomBatchRequest where
        parseJSON
          = withObject "PosCustomBatchRequest"
              (\ o ->
                 PosCustomBatchRequest' <$>
                   (o .:? "entries" .!= mempty))

instance ToJSON PosCustomBatchRequest where
        toJSON PosCustomBatchRequest'{..}
          = object (catMaybes [("entries" .=) <$> _pEntries])

--
-- /See:/ 'orderinvoicesCreateChargeInvoiceRequest' smart constructor.
data OrderinvoicesCreateChargeInvoiceRequest = OrderinvoicesCreateChargeInvoiceRequest'
    { _occirShipmentGroupId  :: !(Maybe Text)
    , _occirLineItemInvoices :: !(Maybe [ShipmentInvoiceLineItemInvoice])
    , _occirInvoiceId        :: !(Maybe Text)
    , _occirInvoiceSummary   :: !(Maybe InvoiceSummary)
    , _occirOperationId      :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderinvoicesCreateChargeInvoiceRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'occirShipmentGroupId'
--
-- * 'occirLineItemInvoices'
--
-- * 'occirInvoiceId'
--
-- * 'occirInvoiceSummary'
--
-- * 'occirOperationId'
orderinvoicesCreateChargeInvoiceRequest
    :: OrderinvoicesCreateChargeInvoiceRequest
orderinvoicesCreateChargeInvoiceRequest =
    OrderinvoicesCreateChargeInvoiceRequest'
    { _occirShipmentGroupId = Nothing
    , _occirLineItemInvoices = Nothing
    , _occirInvoiceId = Nothing
    , _occirInvoiceSummary = Nothing
    , _occirOperationId = Nothing
    }

-- | [required] ID of the shipment group.
occirShipmentGroupId :: Lens' OrderinvoicesCreateChargeInvoiceRequest (Maybe Text)
occirShipmentGroupId
  = lens _occirShipmentGroupId
      (\ s a -> s{_occirShipmentGroupId = a})

-- | [required] Invoice details per line item.
occirLineItemInvoices :: Lens' OrderinvoicesCreateChargeInvoiceRequest [ShipmentInvoiceLineItemInvoice]
occirLineItemInvoices
  = lens _occirLineItemInvoices
      (\ s a -> s{_occirLineItemInvoices = a})
      . _Default
      . _Coerce

-- | [required] The ID of the invoice.
occirInvoiceId :: Lens' OrderinvoicesCreateChargeInvoiceRequest (Maybe Text)
occirInvoiceId
  = lens _occirInvoiceId
      (\ s a -> s{_occirInvoiceId = a})

-- | [required] Invoice summary.
occirInvoiceSummary :: Lens' OrderinvoicesCreateChargeInvoiceRequest (Maybe InvoiceSummary)
occirInvoiceSummary
  = lens _occirInvoiceSummary
      (\ s a -> s{_occirInvoiceSummary = a})

-- | [required] The ID of the operation, unique across all operations for a
-- given order.
occirOperationId :: Lens' OrderinvoicesCreateChargeInvoiceRequest (Maybe Text)
occirOperationId
  = lens _occirOperationId
      (\ s a -> s{_occirOperationId = a})

instance FromJSON
         OrderinvoicesCreateChargeInvoiceRequest where
        parseJSON
          = withObject
              "OrderinvoicesCreateChargeInvoiceRequest"
              (\ o ->
                 OrderinvoicesCreateChargeInvoiceRequest' <$>
                   (o .:? "shipmentGroupId") <*>
                     (o .:? "lineItemInvoices" .!= mempty)
                     <*> (o .:? "invoiceId")
                     <*> (o .:? "invoiceSummary")
                     <*> (o .:? "operationId"))

instance ToJSON
         OrderinvoicesCreateChargeInvoiceRequest where
        toJSON OrderinvoicesCreateChargeInvoiceRequest'{..}
          = object
              (catMaybes
                 [("shipmentGroupId" .=) <$> _occirShipmentGroupId,
                  ("lineItemInvoices" .=) <$> _occirLineItemInvoices,
                  ("invoiceId" .=) <$> _occirInvoiceId,
                  ("invoiceSummary" .=) <$> _occirInvoiceSummary,
                  ("operationId" .=) <$> _occirOperationId])

--
-- /See:/ 'orderLineItem' smart constructor.
data OrderLineItem = OrderLineItem'
    { _oliAnnotations       :: !(Maybe [OrderMerchantProvidedAnnotation])
    , _oliQuantityOrdered   :: !(Maybe (Textual Word32))
    , _oliReturnInfo        :: !(Maybe OrderLineItemReturnInfo)
    , _oliQuantityDelivered :: !(Maybe (Textual Word32))
    , _oliShippingDetails   :: !(Maybe OrderLineItemShippingDetails)
    , _oliQuantityPending   :: !(Maybe (Textual Word32))
    , _oliCancellations     :: !(Maybe [OrderCancellation])
    , _oliQuantityCanceled  :: !(Maybe (Textual Word32))
    , _oliId                :: !(Maybe Text)
    , _oliTax               :: !(Maybe Price)
    , _oliPrice             :: !(Maybe Price)
    , _oliQuantityShipped   :: !(Maybe (Textual Word32))
    , _oliQuantityReturned  :: !(Maybe (Textual Word32))
    , _oliProduct           :: !(Maybe OrderLineItemProduct)
    , _oliReturns           :: !(Maybe [OrderReturn])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderLineItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oliAnnotations'
--
-- * 'oliQuantityOrdered'
--
-- * 'oliReturnInfo'
--
-- * 'oliQuantityDelivered'
--
-- * 'oliShippingDetails'
--
-- * 'oliQuantityPending'
--
-- * 'oliCancellations'
--
-- * 'oliQuantityCanceled'
--
-- * 'oliId'
--
-- * 'oliTax'
--
-- * 'oliPrice'
--
-- * 'oliQuantityShipped'
--
-- * 'oliQuantityReturned'
--
-- * 'oliProduct'
--
-- * 'oliReturns'
orderLineItem
    :: OrderLineItem
orderLineItem =
    OrderLineItem'
    { _oliAnnotations = Nothing
    , _oliQuantityOrdered = Nothing
    , _oliReturnInfo = Nothing
    , _oliQuantityDelivered = Nothing
    , _oliShippingDetails = Nothing
    , _oliQuantityPending = Nothing
    , _oliCancellations = Nothing
    , _oliQuantityCanceled = Nothing
    , _oliId = Nothing
    , _oliTax = Nothing
    , _oliPrice = Nothing
    , _oliQuantityShipped = Nothing
    , _oliQuantityReturned = Nothing
    , _oliProduct = Nothing
    , _oliReturns = Nothing
    }

-- | Annotations that are attached to the line item.
oliAnnotations :: Lens' OrderLineItem [OrderMerchantProvidedAnnotation]
oliAnnotations
  = lens _oliAnnotations
      (\ s a -> s{_oliAnnotations = a})
      . _Default
      . _Coerce

-- | Number of items ordered.
oliQuantityOrdered :: Lens' OrderLineItem (Maybe Word32)
oliQuantityOrdered
  = lens _oliQuantityOrdered
      (\ s a -> s{_oliQuantityOrdered = a})
      . mapping _Coerce

-- | Details of the return policy for the line item.
oliReturnInfo :: Lens' OrderLineItem (Maybe OrderLineItemReturnInfo)
oliReturnInfo
  = lens _oliReturnInfo
      (\ s a -> s{_oliReturnInfo = a})

-- | Number of items delivered.
oliQuantityDelivered :: Lens' OrderLineItem (Maybe Word32)
oliQuantityDelivered
  = lens _oliQuantityDelivered
      (\ s a -> s{_oliQuantityDelivered = a})
      . mapping _Coerce

-- | Details of the requested shipping for the line item.
oliShippingDetails :: Lens' OrderLineItem (Maybe OrderLineItemShippingDetails)
oliShippingDetails
  = lens _oliShippingDetails
      (\ s a -> s{_oliShippingDetails = a})

-- | Number of items pending.
oliQuantityPending :: Lens' OrderLineItem (Maybe Word32)
oliQuantityPending
  = lens _oliQuantityPending
      (\ s a -> s{_oliQuantityPending = a})
      . mapping _Coerce

-- | Cancellations of the line item.
oliCancellations :: Lens' OrderLineItem [OrderCancellation]
oliCancellations
  = lens _oliCancellations
      (\ s a -> s{_oliCancellations = a})
      . _Default
      . _Coerce

-- | Number of items canceled.
oliQuantityCanceled :: Lens' OrderLineItem (Maybe Word32)
oliQuantityCanceled
  = lens _oliQuantityCanceled
      (\ s a -> s{_oliQuantityCanceled = a})
      . mapping _Coerce

-- | The id of the line item.
oliId :: Lens' OrderLineItem (Maybe Text)
oliId = lens _oliId (\ s a -> s{_oliId = a})

-- | Total tax amount for the line item. For example, if two items are
-- purchased, and each have a cost tax of $2, the total tax amount will be
-- $4.
oliTax :: Lens' OrderLineItem (Maybe Price)
oliTax = lens _oliTax (\ s a -> s{_oliTax = a})

-- | Total price for the line item. For example, if two items for $10 are
-- purchased, the total price will be $20.
oliPrice :: Lens' OrderLineItem (Maybe Price)
oliPrice = lens _oliPrice (\ s a -> s{_oliPrice = a})

-- | Number of items shipped.
oliQuantityShipped :: Lens' OrderLineItem (Maybe Word32)
oliQuantityShipped
  = lens _oliQuantityShipped
      (\ s a -> s{_oliQuantityShipped = a})
      . mapping _Coerce

-- | Number of items returned.
oliQuantityReturned :: Lens' OrderLineItem (Maybe Word32)
oliQuantityReturned
  = lens _oliQuantityReturned
      (\ s a -> s{_oliQuantityReturned = a})
      . mapping _Coerce

-- | Product data as seen by customer from the time of the order placement.
-- Note that certain attributes values (e.g. title or gtin) might be
-- reformatted and no longer match values submitted via product feed.
oliProduct :: Lens' OrderLineItem (Maybe OrderLineItemProduct)
oliProduct
  = lens _oliProduct (\ s a -> s{_oliProduct = a})

-- | Returns of the line item.
oliReturns :: Lens' OrderLineItem [OrderReturn]
oliReturns
  = lens _oliReturns (\ s a -> s{_oliReturns = a}) .
      _Default
      . _Coerce

instance FromJSON OrderLineItem where
        parseJSON
          = withObject "OrderLineItem"
              (\ o ->
                 OrderLineItem' <$>
                   (o .:? "annotations" .!= mempty) <*>
                     (o .:? "quantityOrdered")
                     <*> (o .:? "returnInfo")
                     <*> (o .:? "quantityDelivered")
                     <*> (o .:? "shippingDetails")
                     <*> (o .:? "quantityPending")
                     <*> (o .:? "cancellations" .!= mempty)
                     <*> (o .:? "quantityCanceled")
                     <*> (o .:? "id")
                     <*> (o .:? "tax")
                     <*> (o .:? "price")
                     <*> (o .:? "quantityShipped")
                     <*> (o .:? "quantityReturned")
                     <*> (o .:? "product")
                     <*> (o .:? "returns" .!= mempty))

instance ToJSON OrderLineItem where
        toJSON OrderLineItem'{..}
          = object
              (catMaybes
                 [("annotations" .=) <$> _oliAnnotations,
                  ("quantityOrdered" .=) <$> _oliQuantityOrdered,
                  ("returnInfo" .=) <$> _oliReturnInfo,
                  ("quantityDelivered" .=) <$> _oliQuantityDelivered,
                  ("shippingDetails" .=) <$> _oliShippingDetails,
                  ("quantityPending" .=) <$> _oliQuantityPending,
                  ("cancellations" .=) <$> _oliCancellations,
                  ("quantityCanceled" .=) <$> _oliQuantityCanceled,
                  ("id" .=) <$> _oliId, ("tax" .=) <$> _oliTax,
                  ("price" .=) <$> _oliPrice,
                  ("quantityShipped" .=) <$> _oliQuantityShipped,
                  ("quantityReturned" .=) <$> _oliQuantityReturned,
                  ("product" .=) <$> _oliProduct,
                  ("returns" .=) <$> _oliReturns])

--
-- /See:/ 'service' smart constructor.
data Service = Service'
    { _sDeliveryCountry   :: !(Maybe Text)
    , _sRateGroups        :: !(Maybe [RateGroup])
    , _sDeliveryTime      :: !(Maybe DeliveryTime)
    , _sActive            :: !(Maybe Bool)
    , _sName              :: !(Maybe Text)
    , _sCurrency          :: !(Maybe Text)
    , _sEligibility       :: !(Maybe Text)
    , _sMinimumOrderValue :: !(Maybe Price)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Service' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sDeliveryCountry'
--
-- * 'sRateGroups'
--
-- * 'sDeliveryTime'
--
-- * 'sActive'
--
-- * 'sName'
--
-- * 'sCurrency'
--
-- * 'sEligibility'
--
-- * 'sMinimumOrderValue'
service
    :: Service
service =
    Service'
    { _sDeliveryCountry = Nothing
    , _sRateGroups = Nothing
    , _sDeliveryTime = Nothing
    , _sActive = Nothing
    , _sName = Nothing
    , _sCurrency = Nothing
    , _sEligibility = Nothing
    , _sMinimumOrderValue = Nothing
    }

-- | The CLDR territory code of the country to which the service applies.
-- Required.
sDeliveryCountry :: Lens' Service (Maybe Text)
sDeliveryCountry
  = lens _sDeliveryCountry
      (\ s a -> s{_sDeliveryCountry = a})

-- | Shipping rate group definitions. Only the last one is allowed to have an
-- empty applicableShippingLabels, which means \"everything else\". The
-- other applicableShippingLabels must not overlap.
sRateGroups :: Lens' Service [RateGroup]
sRateGroups
  = lens _sRateGroups (\ s a -> s{_sRateGroups = a}) .
      _Default
      . _Coerce

-- | Time spent in various aspects from order to the delivery of the product.
-- Required.
sDeliveryTime :: Lens' Service (Maybe DeliveryTime)
sDeliveryTime
  = lens _sDeliveryTime
      (\ s a -> s{_sDeliveryTime = a})

-- | A boolean exposing the active status of the shipping service. Required.
sActive :: Lens' Service (Maybe Bool)
sActive = lens _sActive (\ s a -> s{_sActive = a})

-- | Free-form name of the service. Must be unique within target account.
-- Required.
sName :: Lens' Service (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})

-- | The CLDR code of the currency to which this service applies. Must match
-- that of the prices in rate groups.
sCurrency :: Lens' Service (Maybe Text)
sCurrency
  = lens _sCurrency (\ s a -> s{_sCurrency = a})

-- | Eligibility for this service.
sEligibility :: Lens' Service (Maybe Text)
sEligibility
  = lens _sEligibility (\ s a -> s{_sEligibility = a})

-- | Minimum order value for this service. If set, indicates that customers
-- will have to spend at least this amount. All prices within a service
-- must have the same currency.
sMinimumOrderValue :: Lens' Service (Maybe Price)
sMinimumOrderValue
  = lens _sMinimumOrderValue
      (\ s a -> s{_sMinimumOrderValue = a})

instance FromJSON Service where
        parseJSON
          = withObject "Service"
              (\ o ->
                 Service' <$>
                   (o .:? "deliveryCountry") <*>
                     (o .:? "rateGroups" .!= mempty)
                     <*> (o .:? "deliveryTime")
                     <*> (o .:? "active")
                     <*> (o .:? "name")
                     <*> (o .:? "currency")
                     <*> (o .:? "eligibility")
                     <*> (o .:? "minimumOrderValue"))

instance ToJSON Service where
        toJSON Service'{..}
          = object
              (catMaybes
                 [("deliveryCountry" .=) <$> _sDeliveryCountry,
                  ("rateGroups" .=) <$> _sRateGroups,
                  ("deliveryTime" .=) <$> _sDeliveryTime,
                  ("active" .=) <$> _sActive, ("name" .=) <$> _sName,
                  ("currency" .=) <$> _sCurrency,
                  ("eligibility" .=) <$> _sEligibility,
                  ("minimumOrderValue" .=) <$> _sMinimumOrderValue])

--
-- /See:/ 'productstatusesCustomBatchResponse' smart constructor.
data ProductstatusesCustomBatchResponse = ProductstatusesCustomBatchResponse'
    { _proEntries :: !(Maybe [ProductstatusesCustomBatchResponseEntry])
    , _proKind    :: !Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProductstatusesCustomBatchResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'proEntries'
--
-- * 'proKind'
productstatusesCustomBatchResponse
    :: ProductstatusesCustomBatchResponse
productstatusesCustomBatchResponse =
    ProductstatusesCustomBatchResponse'
    { _proEntries = Nothing
    , _proKind = "content#productstatusesCustomBatchResponse"
    }

-- | The result of the execution of the batch requests.
proEntries :: Lens' ProductstatusesCustomBatchResponse [ProductstatusesCustomBatchResponseEntry]
proEntries
  = lens _proEntries (\ s a -> s{_proEntries = a}) .
      _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#productstatusesCustomBatchResponse\".
proKind :: Lens' ProductstatusesCustomBatchResponse Text
proKind = lens _proKind (\ s a -> s{_proKind = a})

instance FromJSON ProductstatusesCustomBatchResponse
         where
        parseJSON
          = withObject "ProductstatusesCustomBatchResponse"
              (\ o ->
                 ProductstatusesCustomBatchResponse' <$>
                   (o .:? "entries" .!= mempty) <*>
                     (o .:? "kind" .!=
                        "content#productstatusesCustomBatchResponse"))

instance ToJSON ProductstatusesCustomBatchResponse
         where
        toJSON ProductstatusesCustomBatchResponse'{..}
          = object
              (catMaybes
                 [("entries" .=) <$> _proEntries,
                  Just ("kind" .= _proKind)])

--
-- /See:/ 'productUnitPricingMeasure' smart constructor.
data ProductUnitPricingMeasure = ProductUnitPricingMeasure'
    { _pupmValue :: !(Maybe (Textual Double))
    , _pupmUnit  :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProductUnitPricingMeasure' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pupmValue'
--
-- * 'pupmUnit'
productUnitPricingMeasure
    :: ProductUnitPricingMeasure
productUnitPricingMeasure =
    ProductUnitPricingMeasure'
    { _pupmValue = Nothing
    , _pupmUnit = Nothing
    }

-- | The measure of an item.
pupmValue :: Lens' ProductUnitPricingMeasure (Maybe Double)
pupmValue
  = lens _pupmValue (\ s a -> s{_pupmValue = a}) .
      mapping _Coerce

-- | The unit of the measure.
pupmUnit :: Lens' ProductUnitPricingMeasure (Maybe Text)
pupmUnit = lens _pupmUnit (\ s a -> s{_pupmUnit = a})

instance FromJSON ProductUnitPricingMeasure where
        parseJSON
          = withObject "ProductUnitPricingMeasure"
              (\ o ->
                 ProductUnitPricingMeasure' <$>
                   (o .:? "value") <*> (o .:? "unit"))

instance ToJSON ProductUnitPricingMeasure where
        toJSON ProductUnitPricingMeasure'{..}
          = object
              (catMaybes
                 [("value" .=) <$> _pupmValue,
                  ("unit" .=) <$> _pupmUnit])

--
-- /See:/ 'ordersUpdateShipmentRequest' smart constructor.
data OrdersUpdateShipmentRequest = OrdersUpdateShipmentRequest'
    { _ousrCarrier      :: !(Maybe Text)
    , _ousrStatus       :: !(Maybe Text)
    , _ousrTrackingId   :: !(Maybe Text)
    , _ousrShipmentId   :: !(Maybe Text)
    , _ousrDeliveryDate :: !(Maybe Text)
    , _ousrOperationId  :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrdersUpdateShipmentRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ousrCarrier'
--
-- * 'ousrStatus'
--
-- * 'ousrTrackingId'
--
-- * 'ousrShipmentId'
--
-- * 'ousrDeliveryDate'
--
-- * 'ousrOperationId'
ordersUpdateShipmentRequest
    :: OrdersUpdateShipmentRequest
ordersUpdateShipmentRequest =
    OrdersUpdateShipmentRequest'
    { _ousrCarrier = Nothing
    , _ousrStatus = Nothing
    , _ousrTrackingId = Nothing
    , _ousrShipmentId = Nothing
    , _ousrDeliveryDate = Nothing
    , _ousrOperationId = Nothing
    }

-- | The carrier handling the shipment. Not updated if missing. See
-- shipments[].carrier in the Orders resource representation for a list of
-- acceptable values.
ousrCarrier :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrCarrier
  = lens _ousrCarrier (\ s a -> s{_ousrCarrier = a})

-- | New status for the shipment. Not updated if missing.
ousrStatus :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrStatus
  = lens _ousrStatus (\ s a -> s{_ousrStatus = a})

-- | The tracking id for the shipment. Not updated if missing.
ousrTrackingId :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrTrackingId
  = lens _ousrTrackingId
      (\ s a -> s{_ousrTrackingId = a})

-- | The ID of the shipment.
ousrShipmentId :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrShipmentId
  = lens _ousrShipmentId
      (\ s a -> s{_ousrShipmentId = a})

-- | Date on which the shipment has been delivered, in ISO 8601 format.
-- Optional and can be provided only if status is delivered.
ousrDeliveryDate :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrDeliveryDate
  = lens _ousrDeliveryDate
      (\ s a -> s{_ousrDeliveryDate = a})

-- | The ID of the operation. Unique across all operations for a given order.
ousrOperationId :: Lens' OrdersUpdateShipmentRequest (Maybe Text)
ousrOperationId
  = lens _ousrOperationId
      (\ s a -> s{_ousrOperationId = a})

instance FromJSON OrdersUpdateShipmentRequest where
        parseJSON
          = withObject "OrdersUpdateShipmentRequest"
              (\ o ->
                 OrdersUpdateShipmentRequest' <$>
                   (o .:? "carrier") <*> (o .:? "status") <*>
                     (o .:? "trackingId")
                     <*> (o .:? "shipmentId")
                     <*> (o .:? "deliveryDate")
                     <*> (o .:? "operationId"))

instance ToJSON OrdersUpdateShipmentRequest where
        toJSON OrdersUpdateShipmentRequest'{..}
          = object
              (catMaybes
                 [("carrier" .=) <$> _ousrCarrier,
                  ("status" .=) <$> _ousrStatus,
                  ("trackingId" .=) <$> _ousrTrackingId,
                  ("shipmentId" .=) <$> _ousrShipmentId,
                  ("deliveryDate" .=) <$> _ousrDeliveryDate,
                  ("operationId" .=) <$> _ousrOperationId])

--
-- /See:/ 'orderShipmentLineItemShipment' smart constructor.
data OrderShipmentLineItemShipment = OrderShipmentLineItemShipment'
    { _oslisQuantity   :: !(Maybe (Textual Word32))
    , _oslisLineItemId :: !(Maybe Text)
    , _oslisProductId  :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderShipmentLineItemShipment' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oslisQuantity'
--
-- * 'oslisLineItemId'
--
-- * 'oslisProductId'
orderShipmentLineItemShipment
    :: OrderShipmentLineItemShipment
orderShipmentLineItemShipment =
    OrderShipmentLineItemShipment'
    { _oslisQuantity = Nothing
    , _oslisLineItemId = Nothing
    , _oslisProductId = Nothing
    }

-- | The quantity that is shipped.
oslisQuantity :: Lens' OrderShipmentLineItemShipment (Maybe Word32)
oslisQuantity
  = lens _oslisQuantity
      (\ s a -> s{_oslisQuantity = a})
      . mapping _Coerce

-- | The id of the line item that is shipped. Either lineItemId or productId
-- is required.
oslisLineItemId :: Lens' OrderShipmentLineItemShipment (Maybe Text)
oslisLineItemId
  = lens _oslisLineItemId
      (\ s a -> s{_oslisLineItemId = a})

-- | The ID of the product to ship. This is the REST ID used in the products
-- service. Either lineItemId or productId is required.
oslisProductId :: Lens' OrderShipmentLineItemShipment (Maybe Text)
oslisProductId
  = lens _oslisProductId
      (\ s a -> s{_oslisProductId = a})

instance FromJSON OrderShipmentLineItemShipment where
        parseJSON
          = withObject "OrderShipmentLineItemShipment"
              (\ o ->
                 OrderShipmentLineItemShipment' <$>
                   (o .:? "quantity") <*> (o .:? "lineItemId") <*>
                     (o .:? "productId"))

instance ToJSON OrderShipmentLineItemShipment where
        toJSON OrderShipmentLineItemShipment'{..}
          = object
              (catMaybes
                 [("quantity" .=) <$> _oslisQuantity,
                  ("lineItemId" .=) <$> _oslisLineItemId,
                  ("productId" .=) <$> _oslisProductId])

--
-- /See:/ 'orderreportsListTransactionsResponse' smart constructor.
data OrderreportsListTransactionsResponse = OrderreportsListTransactionsResponse'
    { _oltrNextPageToken :: !(Maybe Text)
    , _oltrTransactions  :: !(Maybe [OrderReportTransaction])
    , _oltrKind          :: !Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OrderreportsListTransactionsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oltrNextPageToken'
--
-- * 'oltrTransactions'
--
-- * 'oltrKind'
orderreportsListTransactionsResponse
    :: OrderreportsListTransactionsResponse
orderreportsListTransactionsResponse =
    OrderreportsListTransactionsResponse'
    { _oltrNextPageToken = Nothing
    , _oltrTransactions = Nothing
    , _oltrKind = "content#orderreportsListTransactionsResponse"
    }

-- | The token for the retrieval of the next page of transactions.
oltrNextPageToken :: Lens' OrderreportsListTransactionsResponse (Maybe Text)
oltrNextPageToken
  = lens _oltrNextPageToken
      (\ s a -> s{_oltrNextPageToken = a})

-- | The list of transactions.
oltrTransactions :: Lens' OrderreportsListTransactionsResponse [OrderReportTransaction]
oltrTransactions
  = lens _oltrTransactions
      (\ s a -> s{_oltrTransactions = a})
      . _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#orderreportsListTransactionsResponse\".
oltrKind :: Lens' OrderreportsListTransactionsResponse Text
oltrKind = lens _oltrKind (\ s a -> s{_oltrKind = a})

instance FromJSON
         OrderreportsListTransactionsResponse where
        parseJSON
          = withObject "OrderreportsListTransactionsResponse"
              (\ o ->
                 OrderreportsListTransactionsResponse' <$>
                   (o .:? "nextPageToken") <*>
                     (o .:? "transactions" .!= mempty)
                     <*>
                     (o .:? "kind" .!=
                        "content#orderreportsListTransactionsResponse"))

instance ToJSON OrderreportsListTransactionsResponse
         where
        toJSON OrderreportsListTransactionsResponse'{..}
          = object
              (catMaybes
                 [("nextPageToken" .=) <$> _oltrNextPageToken,
                  ("transactions" .=) <$> _oltrTransactions,
                  Just ("kind" .= _oltrKind)])

--
-- /See:/ 'liaSettingsCustomBatchResponse' smart constructor.
data LiaSettingsCustomBatchResponse = LiaSettingsCustomBatchResponse'
    { _lscbrEntries :: !(Maybe [LiaSettingsCustomBatchResponseEntry])
    , _lscbrKind    :: !Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LiaSettingsCustomBatchResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lscbrEntries'
--
-- * 'lscbrKind'
liaSettingsCustomBatchResponse
    :: LiaSettingsCustomBatchResponse
liaSettingsCustomBatchResponse =
    LiaSettingsCustomBatchResponse'
    { _lscbrEntries = Nothing
    , _lscbrKind = "content#liasettingsCustomBatchResponse"
    }

-- | The result of the execution of the batch requests.
lscbrEntries :: Lens' LiaSettingsCustomBatchResponse [LiaSettingsCustomBatchResponseEntry]
lscbrEntries
  = lens _lscbrEntries (\ s a -> s{_lscbrEntries = a})
      . _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#liasettingsCustomBatchResponse\".
lscbrKind :: Lens' LiaSettingsCustomBatchResponse Text
lscbrKind
  = lens _lscbrKind (\ s a -> s{_lscbrKind = a})

instance FromJSON LiaSettingsCustomBatchResponse
         where
        parseJSON
          = withObject "LiaSettingsCustomBatchResponse"
              (\ o ->
                 LiaSettingsCustomBatchResponse' <$>
                   (o .:? "entries" .!= mempty) <*>
                     (o .:? "kind" .!=
                        "content#liasettingsCustomBatchResponse"))

instance ToJSON LiaSettingsCustomBatchResponse where
        toJSON LiaSettingsCustomBatchResponse'{..}
          = object
              (catMaybes
                 [("entries" .=) <$> _lscbrEntries,
                  Just ("kind" .= _lscbrKind)])

--
-- /See:/ 'loyaltyPoints' smart constructor.
data LoyaltyPoints = LoyaltyPoints'
    { _lpRatio       :: !(Maybe (Textual Double))
    , _lpPointsValue :: !(Maybe (Textual Int64))
    , _lpName        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LoyaltyPoints' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lpRatio'
--
-- * 'lpPointsValue'
--
-- * 'lpName'
loyaltyPoints
    :: LoyaltyPoints
loyaltyPoints =
    LoyaltyPoints'
    { _lpRatio = Nothing
    , _lpPointsValue = Nothing
    , _lpName = Nothing
    }

-- | The ratio of a point when converted to currency. Google assumes currency
-- based on Merchant Center settings. If ratio is left out, it defaults to
-- 1.0.
lpRatio :: Lens' LoyaltyPoints (Maybe Double)
lpRatio
  = lens _lpRatio (\ s a -> s{_lpRatio = a}) .
      mapping _Coerce

-- | The retailer\'s loyalty points in absolute value.
lpPointsValue :: Lens' LoyaltyPoints (Maybe Int64)
lpPointsValue
  = lens _lpPointsValue
      (\ s a -> s{_lpPointsValue = a})
      . mapping _Coerce

-- | Name of loyalty points program. It is recommended to limit the name to
-- 12 full-width characters or 24 Roman characters.
lpName :: Lens' LoyaltyPoints (Maybe Text)
lpName = lens _lpName (\ s a -> s{_lpName = a})

instance FromJSON LoyaltyPoints where
        parseJSON
          = withObject "LoyaltyPoints"
              (\ o ->
                 LoyaltyPoints' <$>
                   (o .:? "ratio") <*> (o .:? "pointsValue") <*>
                     (o .:? "name"))

instance ToJSON LoyaltyPoints where
        toJSON LoyaltyPoints'{..}
          = object
              (catMaybes
                 [("ratio" .=) <$> _lpRatio,
                  ("pointsValue" .=) <$> _lpPointsValue,
                  ("name" .=) <$> _lpName])

--
-- /See:/ 'liaSettingsSetPosDataProviderResponse' smart constructor.
newtype LiaSettingsSetPosDataProviderResponse = LiaSettingsSetPosDataProviderResponse'
    { _lsspdprKind :: Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LiaSettingsSetPosDataProviderResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lsspdprKind'
liaSettingsSetPosDataProviderResponse
    :: LiaSettingsSetPosDataProviderResponse
liaSettingsSetPosDataProviderResponse =
    LiaSettingsSetPosDataProviderResponse'
    { _lsspdprKind = "content#liasettingsSetPosDataProviderResponse"
    }

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#liasettingsSetPosDataProviderResponse\".
lsspdprKind :: Lens' LiaSettingsSetPosDataProviderResponse Text
lsspdprKind
  = lens _lsspdprKind (\ s a -> s{_lsspdprKind = a})

instance FromJSON
         LiaSettingsSetPosDataProviderResponse where
        parseJSON
          = withObject "LiaSettingsSetPosDataProviderResponse"
              (\ o ->
                 LiaSettingsSetPosDataProviderResponse' <$>
                   (o .:? "kind" .!=
                      "content#liasettingsSetPosDataProviderResponse"))

instance ToJSON LiaSettingsSetPosDataProviderResponse
         where
        toJSON LiaSettingsSetPosDataProviderResponse'{..}
          = object (catMaybes [Just ("kind" .= _lsspdprKind)])

-- | The status of an account, i.e., information about its products, which is
-- computed offline and not returned immediately at insertion time.
--
-- /See:/ 'accountStatus' smart constructor.
data AccountStatus = AccountStatus'
    { _asAccountLevelIssues :: !(Maybe [AccountStatusAccountLevelIssue])
    , _asKind               :: !Text
    , _asAccountId          :: !(Maybe Text)
    , _asProducts           :: !(Maybe [AccountStatusProducts])
    , _asWebsiteClaimed     :: !(Maybe Bool)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'asAccountLevelIssues'
--
-- * 'asKind'
--
-- * 'asAccountId'
--
-- * 'asProducts'
--
-- * 'asWebsiteClaimed'
accountStatus
    :: AccountStatus
accountStatus =
    AccountStatus'
    { _asAccountLevelIssues = Nothing
    , _asKind = "content#accountStatus"
    , _asAccountId = Nothing
    , _asProducts = Nothing
    , _asWebsiteClaimed = Nothing
    }

-- | A list of account level issues.
asAccountLevelIssues :: Lens' AccountStatus [AccountStatusAccountLevelIssue]
asAccountLevelIssues
  = lens _asAccountLevelIssues
      (\ s a -> s{_asAccountLevelIssues = a})
      . _Default
      . _Coerce

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#accountStatus\".
asKind :: Lens' AccountStatus Text
asKind = lens _asKind (\ s a -> s{_asKind = a})

-- | The ID of the account for which the status is reported.
asAccountId :: Lens' AccountStatus (Maybe Text)
asAccountId
  = lens _asAccountId (\ s a -> s{_asAccountId = a})

-- | List of product-related data by channel, destination, and country. Data
-- in this field may be delayed by up to 30 minutes.
asProducts :: Lens' AccountStatus [AccountStatusProducts]
asProducts
  = lens _asProducts (\ s a -> s{_asProducts = a}) .
      _Default
      . _Coerce

-- | Whether the account\'s website is claimed or not.
asWebsiteClaimed :: Lens' AccountStatus (Maybe Bool)
asWebsiteClaimed
  = lens _asWebsiteClaimed
      (\ s a -> s{_asWebsiteClaimed = a})

instance FromJSON AccountStatus where
        parseJSON
          = withObject "AccountStatus"
              (\ o ->
                 AccountStatus' <$>
                   (o .:? "accountLevelIssues" .!= mempty) <*>
                     (o .:? "kind" .!= "content#accountStatus")
                     <*> (o .:? "accountId")
                     <*> (o .:? "products" .!= mempty)
                     <*> (o .:? "websiteClaimed"))

instance ToJSON AccountStatus where
        toJSON AccountStatus'{..}
          = object
              (catMaybes
                 [("accountLevelIssues" .=) <$> _asAccountLevelIssues,
                  Just ("kind" .= _asKind),
                  ("accountId" .=) <$> _asAccountId,
                  ("products" .=) <$> _asProducts,
                  ("websiteClaimed" .=) <$> _asWebsiteClaimed])

-- | A batch entry encoding a single non-batch shippingsettings request.
--
-- /See:/ 'shippingSettingsCustomBatchRequestEntry' smart constructor.
data ShippingSettingsCustomBatchRequestEntry = ShippingSettingsCustomBatchRequestEntry'
    { _sscbreMerchantId       :: !(Maybe (Textual Word64))
    , _sscbreAccountId        :: !(Maybe (Textual Word64))
    , _sscbreMethod           :: !(Maybe Text)
    , _sscbreShippingSettings :: !(Maybe ShippingSettings)
    , _sscbreBatchId          :: !(Maybe (Textual Word32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ShippingSettingsCustomBatchRequestEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sscbreMerchantId'
--
-- * 'sscbreAccountId'
--
-- * 'sscbreMethod'
--
-- * 'sscbreShippingSettings'
--
-- * 'sscbreBatchId'
shippingSettingsCustomBatchRequestEntry
    :: ShippingSettingsCustomBatchRequestEntry
shippingSettingsCustomBatchRequestEntry =
    ShippingSettingsCustomBatchRequestEntry'
    { _sscbreMerchantId = Nothing
    , _sscbreAccountId = Nothing
    , _sscbreMethod = Nothing
    , _sscbreShippingSettings = Nothing
    , _sscbreBatchId = Nothing
    }

-- | The ID of the managing account.
sscbreMerchantId :: Lens' ShippingSettingsCustomBatchRequestEntry (Maybe Word64)
sscbreMerchantId
  = lens _sscbreMerchantId
      (\ s a -> s{_sscbreMerchantId = a})
      . mapping _Coerce

-- | The ID of the account for which to get\/update account shipping
-- settings.
sscbreAccountId :: Lens' ShippingSettingsCustomBatchRequestEntry (Maybe Word64)
sscbreAccountId
  = lens _sscbreAccountId
      (\ s a -> s{_sscbreAccountId = a})
      . mapping _Coerce

sscbreMethod :: Lens' ShippingSettingsCustomBatchRequestEntry (Maybe Text)
sscbreMethod
  = lens _sscbreMethod (\ s a -> s{_sscbreMethod = a})

-- | The account shipping settings to update. Only defined if the method is
-- update.
sscbreShippingSettings :: Lens' ShippingSettingsCustomBatchRequestEntry (Maybe ShippingSettings)
sscbreShippingSettings
  = lens _sscbreShippingSettings
      (\ s a -> s{_sscbreShippingSettings = a})

-- | An entry ID, unique within the batch request.
sscbreBatchId :: Lens' ShippingSettingsCustomBatchRequestEntry (Maybe Word32)
sscbreBatchId
  = lens _sscbreBatchId
      (\ s a -> s{_sscbreBatchId = a})
      . mapping _Coerce

instance FromJSON
         ShippingSettingsCustomBatchRequestEntry where
        parseJSON
          = withObject
              "ShippingSettingsCustomBatchRequestEntry"
              (\ o ->
                 ShippingSettingsCustomBatchRequestEntry' <$>
                   (o .:? "merchantId") <*> (o .:? "accountId") <*>
                     (o .:? "method")
                     <*> (o .:? "shippingSettings")
                     <*> (o .:? "batchId"))

instance ToJSON
         ShippingSettingsCustomBatchRequestEntry where
        toJSON ShippingSettingsCustomBatchRequestEntry'{..}
          = object
              (catMaybes
                 [("merchantId" .=) <$> _sscbreMerchantId,
                  ("accountId" .=) <$> _sscbreAccountId,
                  ("method" .=) <$> _sscbreMethod,
                  ("shippingSettings" .=) <$> _sscbreShippingSettings,
                  ("batchId" .=) <$> _sscbreBatchId])

--
-- /See:/ 'posInventoryResponse' smart constructor.
data PosInventoryResponse = PosInventoryResponse'
    { _pirStoreCode       :: !(Maybe Text)
    , _pirKind            :: !Text
    , _pirItemId          :: !(Maybe Text)
    , _pirQuantity        :: !(Maybe (Textual Int64))
    , _pirTargetCountry   :: !(Maybe Text)
    , _pirGtin            :: !(Maybe Text)
    , _pirPrice           :: !(Maybe Price)
    , _pirContentLanguage :: !(Maybe Text)
    , _pirTimestamp       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'PosInventoryResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pirStoreCode'
--
-- * 'pirKind'
--
-- * 'pirItemId'
--
-- * 'pirQuantity'
--
-- * 'pirTargetCountry'
--
-- * 'pirGtin'
--
-- * 'pirPrice'
--
-- * 'pirContentLanguage'
--
-- * 'pirTimestamp'
posInventoryResponse
    :: PosInventoryResponse
posInventoryResponse =
    PosInventoryResponse'
    { _pirStoreCode = Nothing
    , _pirKind = "content#posInventoryResponse"
    , _pirItemId = Nothing
    , _pirQuantity = Nothing
    , _pirTargetCountry = Nothing
    , _pirGtin = Nothing
    , _pirPrice = Nothing
    , _pirContentLanguage = Nothing
    , _pirTimestamp = Nothing
    }

-- | The identifier of the merchant\'s store. Either a storeCode inserted via
-- the API or the code of the store in Google My Business.
pirStoreCode :: Lens' PosInventoryResponse (Maybe Text)
pirStoreCode
  = lens _pirStoreCode (\ s a -> s{_pirStoreCode = a})

-- | Identifies what kind of resource this is. Value: the fixed string
-- \"content#posInventoryResponse\".
pirKind :: Lens' PosInventoryResponse Text
pirKind = lens _pirKind (\ s a -> s{_pirKind = a})

-- | A unique identifier for the item.
pirItemId :: Lens' PosInventoryResponse (Maybe Text)
pirItemId
  = lens _pirItemId (\ s a -> s{_pirItemId = a})

-- | The available quantity of the item.
pirQuantity :: Lens' PosInventoryResponse (Maybe Int64)
pirQuantity
  = lens _pirQuantity (\ s a -> s{_pirQuantity = a}) .
      mapping _Coerce

-- | The CLDR territory code for the item.
pirTargetCountry :: Lens' PosInventoryResponse (Maybe Text)
pirTargetCountry
  = lens _pirTargetCountry
      (\ s a -> s{_pirTargetCountry = a})

-- | Global Trade Item Number.
pirGtin :: Lens' PosInventoryResponse (Maybe Text)
pirGtin = lens _pirGtin (\ s a -> s{_pirGtin = a})

-- | The current price of the item.
pirPrice :: Lens' PosInventoryResponse (Maybe Price)
pirPrice = lens _pirPrice (\ s a -> s{_pirPrice = a})

-- | The two-letter ISO 639-1 language code for the item.
pirContentLanguage :: Lens' PosInventoryResponse (Maybe Text)
pirContentLanguage
  = lens _pirContentLanguage
      (\ s a -> s{_pirContentLanguage = a})

-- | The inventory timestamp, in ISO 8601 format.
pirTimestamp :: Lens' PosInventoryResponse (Maybe Text)
pirTimestamp
  = lens _pirTimestamp (\ s a -> s{_pirTimestamp = a})

instance FromJSON PosInventoryResponse where
        parseJSON
          = withObject "PosInventoryResponse"
              (\ o ->
                 PosInventoryResponse' <$>
                   (o .:? "storeCode")