content: {-# LANGUAGE DataKinds #-}
  {-# LANGUAGE DerivingStrategies #-}
  {-# LANGUAGE DuplicateRecordFields #-}
  {-# LANGUAGE ImportQualifiedPost #-}
  {-# LANGUAGE LambdaCase #-}
  {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE PatternSynonyms #-}
  {-# LANGUAGE RecordWildCards #-}
  {-# LANGUAGE StrictData #-}
  {-# LANGUAGE TypeFamilies #-}
  {-# LANGUAGE NoImplicitPrelude #-}
  {-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
  {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
  {-# OPTIONS_GHC -fno-warn-unused-binds #-}
  {-# OPTIONS_GHC -fno-warn-unused-imports #-}
  {-# OPTIONS_GHC -fno-warn-unused-matches #-}
  
  -- |
  -- Module      : Gogol.Partners.Offers.History.List
  -- Copyright   : (c) 2015-2025 Brendan Hay
  -- License     : Mozilla Public License, v. 2.0.
  -- Maintainer  : Brendan Hay <brendan.g.hay+gogol@gmail.com>
  --               Toni Cebrián <toni@tonicebrian.com>
  -- Stability   : auto-generated
  -- Portability : non-portable (GHC extensions)
  --
  -- Lists the Historical Offers for the current user (or user\'s entire company)
  --
  -- /See:/ <https://developers.google.com/partners/ Google Partners API Reference> for @partners.offers.history.list@.
  module Gogol.Partners.Offers.History.List
    ( -- * Resource
      PartnersOffersHistoryListResource,
  
      -- ** Constructing a Request
      PartnersOffersHistoryList (..),
      newPartnersOffersHistoryList,
    )
  where
  
  import Gogol.Partners.Types
  import Gogol.Prelude qualified as Core
  
  -- | A resource alias for @partners.offers.history.list@ method which the
  -- 'PartnersOffersHistoryList' request conforms to.
  type PartnersOffersHistoryListResource =
    "v2"
      Core.:> "offers"
      Core.:> "history"
      Core.:> Core.QueryParam "$.xgafv" Xgafv
      Core.:> Core.QueryParam "access_token" Core.Text
      Core.:> Core.QueryParam "callback" Core.Text
      Core.:> Core.QueryParam "entireCompany" Core.Bool
      Core.:> Core.QueryParam "orderBy" Core.Text
      Core.:> Core.QueryParam "pageSize" Core.Int32
      Core.:> Core.QueryParam "pageToken" Core.Text
      Core.:> Core.QueryParams "requestMetadata.experimentIds" Core.Text
      Core.:> Core.QueryParam "requestMetadata.locale" Core.Text
      Core.:> Core.QueryParam "requestMetadata.partnersSessionId" Core.Text
      Core.:> Core.QueryParam
                "requestMetadata.trafficSource.trafficSourceId"
                Core.Text
      Core.:> Core.QueryParam
                "requestMetadata.trafficSource.trafficSubId"
                Core.Text
      Core.:> Core.QueryParam
                "requestMetadata.userOverrides.ipAddress"
                Core.Text
      Core.:> Core.QueryParam
                "requestMetadata.userOverrides.userId"
                Core.Text
      Core.:> Core.QueryParam "uploadType" Core.Text
      Core.:> Core.QueryParam "upload_protocol" Core.Text
      Core.:> Core.QueryParam "alt" Core.AltJSON
      Core.:> Core.Get '[Core.JSON] ListOffersHistoryResponse
  
  -- | Lists the Historical Offers for the current user (or user\'s entire company)
  --
  -- /See:/ 'newPartnersOffersHistoryList' smart constructor.
  data PartnersOffersHistoryList = PartnersOffersHistoryList
    { -- | V1 error format.
      xgafv :: (Core.Maybe Xgafv),
      -- | OAuth access token.
      accessToken :: (Core.Maybe Core.Text),
      -- | JSONP
      callback :: (Core.Maybe Core.Text),
      -- | if true, show history for the entire company. Requires user to be admin.
      entireCompany :: (Core.Maybe Core.Bool),
      -- | Comma-separated list of fields to order by, e.g.: \"foo,bar,baz\". Use \"foo desc\" to sort descending. List of valid field names is: name, offer/code, expiration/time, status, last/modified/time, sender/name, creation/time, country/code, offer/type.
      orderBy :: (Core.Maybe Core.Text),
      -- | Maximum number of rows to return per page.
      pageSize :: (Core.Maybe Core.Int32),
      -- | Token to retrieve a specific page.
      pageToken :: (Core.Maybe Core.Text),
      -- | Experiment IDs the current request belongs to.
      requestMetadataExperimentIds :: (Core.Maybe [Core.Text]),
      -- | Locale to use for the current request.
      requestMetadataLocale :: (Core.Maybe Core.Text),
      -- | Google Partners session ID.
      requestMetadataPartnersSessionId :: (Core.Maybe Core.Text),
      -- | Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.
      requestMetadataTrafficSourceTrafficSourceId :: (Core.Maybe Core.Text),
      -- | Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.
      requestMetadataTrafficSourceTrafficSubId :: (Core.Maybe Core.Text),
      -- | IP address to use instead of the user\'s geo-located IP address.
      requestMetadataUserOverridesIpAddress :: (Core.Maybe Core.Text),
      -- | Logged-in user ID to impersonate instead of the user\'s ID.
      requestMetadataUserOverridesUserId :: (Core.Maybe Core.Text),
      -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
      uploadType :: (Core.Maybe Core.Text),
      -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
      uploadProtocol :: (Core.Maybe Core.Text)
    }
    deriving (Core.Eq, Core.Show, Core.Generic)
  
  -- | Creates a value of 'PartnersOffersHistoryList' with the minimum fields required to make a request.
  newPartnersOffersHistoryList ::
    PartnersOffersHistoryList
  newPartnersOffersHistoryList =
    PartnersOffersHistoryList
      { xgafv = Core.Nothing,
        accessToken = Core.Nothing,
        callback = Core.Nothing,
        entireCompany = Core.Nothing,
        orderBy = Core.Nothing,
        pageSize = Core.Nothing,
        pageToken = Core.Nothing,
        requestMetadataExperimentIds = Core.Nothing,
        requestMetadataLocale = Core.Nothing,
        requestMetadataPartnersSessionId = Core.Nothing,
        requestMetadataTrafficSourceTrafficSourceId = Core.Nothing,
        requestMetadataTrafficSourceTrafficSubId = Core.Nothing,
        requestMetadataUserOverridesIpAddress = Core.Nothing,
        requestMetadataUserOverridesUserId = Core.Nothing,
        uploadType = Core.Nothing,
        uploadProtocol = Core.Nothing
      }
  
  instance Core.GoogleRequest PartnersOffersHistoryList where
    type Rs PartnersOffersHistoryList = ListOffersHistoryResponse
    type Scopes PartnersOffersHistoryList = '[]
    requestClient PartnersOffersHistoryList {..} =
      go
        xgafv
        accessToken
        callback
        entireCompany
        orderBy
        pageSize
        pageToken
        (requestMetadataExperimentIds Core.^. Core._Default)
        requestMetadataLocale
        requestMetadataPartnersSessionId
        requestMetadataTrafficSourceTrafficSourceId
        requestMetadataTrafficSourceTrafficSubId
        requestMetadataUserOverridesIpAddress
        requestMetadataUserOverridesUserId
        uploadType
        uploadProtocol
        (Core.Just Core.AltJSON)
        partnersService
      where
        go =
          Core.buildClient
            (Core.Proxy :: Core.Proxy PartnersOffersHistoryListResource)
            Core.mempty
  