# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# 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       :  . Logging . Logs . List
  Copyright    : ( c ) 2015 - 2022  
  License      : Mozilla Public License , v. 2.0 .
  Maintainer   :   < brendan.g.hay+ >
-- Stability   : auto-generated
  Portability : non - portable ( GHC extensions )
--
-- Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
--
-- /See:/ </ Cloud Logging API Reference> for @logging.logs.list@.
module Gogol.Logging.Logs.List
  ( -- * Resource
    LoggingLogsListResource,

    -- ** Constructing a Request
    LoggingLogsList (..),
    newLoggingLogsList,
  )
where

import Gogol.Logging.Types
import qualified Gogol.Prelude as Core

  | A resource alias for @logging.logs.list@ method which the
-- 'LoggingLogsList' request conforms to.
type LoggingLogsListResource =
  "v2"
    Core.:> Core.Capture "parent" Core.Text
    Core.:> "logs"
    Core.:> Core.QueryParam "$.xgafv" Xgafv
    Core.:> Core.QueryParam "access_token" Core.Text
    Core.:> Core.QueryParam "callback" Core.Text
    Core.:> Core.QueryParam "pageSize" Core.Int32
    Core.:> Core.QueryParam "pageToken" Core.Text
    Core.:> Core.QueryParams "resourceNames" 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] ListLogsResponse

-- | Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
--
-- /See:/ 'newLoggingLogsList' smart constructor.
data LoggingLogsList = LoggingLogsList
  { -- | V1 error format.
    xgafv :: (Core.Maybe Xgafv),
    -- | OAuth access token.
    accessToken :: (Core.Maybe Core.Text),
  | JSONP
    callback :: (Core.Maybe Core.Text),
    -- | Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.
    pageSize :: (Core.Maybe Core.Int32),
  | Optional . If present , then retrieve the next batch of results from the preceding call to this method . pageToken must be the value of nextPageToken from the previous response . The values of other method parameters should be identical to those in the previous call .
    pageToken :: (Core.Maybe Core.Text),
  | Required . The resource name that owns the logs : projects\/[PROJECT / ID ] organizations\/[ORGANIZATION / ID ] billingAccounts\/[BILLING / ACCOUNT / ID ] folders\/[FOLDER_ID ]
    parent :: Core.Text,
    -- | Optional. The resource name that owns the logs: projects\/[PROJECT/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] organizations\/[ORGANIZATION/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] billingAccounts\/[BILLING/ACCOUNT/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] folders\/[FOLDER/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID]To support legacy queries, it could also be: projects\/[PROJECT/ID] organizations\/[ORGANIZATION/ID] billingAccounts\/[BILLING/ACCOUNT/ID] folders\/[FOLDER/ID]
    resourceNames :: (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 'LoggingLogsList' with the minimum fields required to make a request.
newLoggingLogsList ::
  -- |  Required. The resource name that owns the logs: projects\/[PROJECT/ID] organizations\/[ORGANIZATION/ID] billingAccounts\/[BILLING/ACCOUNT/ID] folders\/[FOLDER_ID] See 'parent'.
  Core.Text ->
  LoggingLogsList
newLoggingLogsList parent =
  LoggingLogsList
    { xgafv = Core.Nothing,
      accessToken = Core.Nothing,
      callback = Core.Nothing,
      pageSize = Core.Nothing,
      pageToken = Core.Nothing,
      parent = parent,
      resourceNames = Core.Nothing,
      uploadType = Core.Nothing,
      uploadProtocol = Core.Nothing
    }

instance Core.GoogleRequest LoggingLogsList where
  type Rs LoggingLogsList = ListLogsResponse
  type
    Scopes LoggingLogsList =
      '[ CloudPlatform'FullControl,
         CloudPlatform'ReadOnly,
         Logging'Admin,
         Logging'Read
       ]
  requestClient LoggingLogsList {..} =
    go
      parent
      xgafv
      accessToken
      callback
      pageSize
      pageToken
      (resourceNames Core.^. Core._Default)
      uploadType
      uploadProtocol
      (Core.Just Core.AltJSON)
      loggingService
    where
      go =
        Core.buildClient
          (Core.Proxy :: Core.Proxy LoggingLogsListResource)
          Core.mempty

# LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
 |
 Stability   : auto-generated

 Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

 /See:/ </ Cloud Logging API Reference> for @logging.logs.list@.
 * Resource
 ** Constructing a Request
 'LoggingLogsList' request conforms to.
 | Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

 /See:/ 'newLoggingLogsList' smart constructor.
 | V1 error format.
 | OAuth access token.
 | Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.
 | Optional. The resource name that owns the logs: projects\/[PROJECT/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] organizations\/[ORGANIZATION/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] billingAccounts\/[BILLING/ACCOUNT/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID] folders\/[FOLDER/ID]\/locations\/[LOCATION/ID]\/buckets\/[BUCKET/ID]\/views\/[VIEW/ID]To support legacy queries, it could also be: projects\/[PROJECT/ID] organizations\/[ORGANIZATION/ID] billingAccounts\/[BILLING/ACCOUNT/ID] folders\/[FOLDER/ID]
 | Upload protocol for media (e.g. \"raw\", \"multipart\").
 | Creates a value of 'LoggingLogsList' with the minimum fields required to make a request.
 |  Required. The resource name that owns the logs: projects\/[PROJECT/ID] organizations\/[ORGANIZATION/ID] billingAccounts\/[BILLING/ACCOUNT/ID] folders\/[FOLDER_ID] See 'parent'.
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# 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       :  . Logging . Logs . List
  Copyright    : ( c ) 2015 - 2022  
  License      : Mozilla Public License , v. 2.0 .
  Maintainer   :   < brendan.g.hay+ >
  Portability : non - portable ( GHC extensions )
module Gogol.Logging.Logs.List
    LoggingLogsListResource,

    LoggingLogsList (..),
    newLoggingLogsList,
  )
where

import Gogol.Logging.Types
import qualified Gogol.Prelude as Core

  | A resource alias for @logging.logs.list@ method which the
type LoggingLogsListResource =
  "v2"
    Core.:> Core.Capture "parent" Core.Text
    Core.:> "logs"
    Core.:> Core.QueryParam "$.xgafv" Xgafv
    Core.:> Core.QueryParam "access_token" Core.Text
    Core.:> Core.QueryParam "callback" Core.Text
    Core.:> Core.QueryParam "pageSize" Core.Int32
    Core.:> Core.QueryParam "pageToken" Core.Text
    Core.:> Core.QueryParams "resourceNames" 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] ListLogsResponse

data LoggingLogsList = LoggingLogsList
    xgafv :: (Core.Maybe Xgafv),
    accessToken :: (Core.Maybe Core.Text),
  | JSONP
    callback :: (Core.Maybe Core.Text),
    pageSize :: (Core.Maybe Core.Int32),
  | Optional . If present , then retrieve the next batch of results from the preceding call to this method . pageToken must be the value of nextPageToken from the previous response . The values of other method parameters should be identical to those in the previous call .
    pageToken :: (Core.Maybe Core.Text),
  | Required . The resource name that owns the logs : projects\/[PROJECT / ID ] organizations\/[ORGANIZATION / ID ] billingAccounts\/[BILLING / ACCOUNT / ID ] folders\/[FOLDER_ID ]
    parent :: Core.Text,
    resourceNames :: (Core.Maybe [Core.Text]),
  | Legacy upload protocol for media ( e.g. \"media\ " , \"multipart\ " ) .
    uploadType :: (Core.Maybe Core.Text),
    uploadProtocol :: (Core.Maybe Core.Text)
  }
  deriving (Core.Eq, Core.Show, Core.Generic)

newLoggingLogsList ::
  Core.Text ->
  LoggingLogsList
newLoggingLogsList parent =
  LoggingLogsList
    { xgafv = Core.Nothing,
      accessToken = Core.Nothing,
      callback = Core.Nothing,
      pageSize = Core.Nothing,
      pageToken = Core.Nothing,
      parent = parent,
      resourceNames = Core.Nothing,
      uploadType = Core.Nothing,
      uploadProtocol = Core.Nothing
    }

instance Core.GoogleRequest LoggingLogsList where
  type Rs LoggingLogsList = ListLogsResponse
  type
    Scopes LoggingLogsList =
      '[ CloudPlatform'FullControl,
         CloudPlatform'ReadOnly,
         Logging'Admin,
         Logging'Read
       ]
  requestClient LoggingLogsList {..} =
    go
      parent
      xgafv
      accessToken
      callback
      pageSize
      pageToken
      (resourceNames Core.^. Core._Default)
      uploadType
      uploadProtocol
      (Core.Just Core.AltJSON)
      loggingService
    where
      go =
        Core.buildClient
          (Core.Proxy :: Core.Proxy LoggingLogsListResource)
          Core.mempty
