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

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

-- |
-- Module      : Amazonka.DeviceFarm.GetOfferingStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the current status and future status of all offerings purchased by
-- an AWS account. The response indicates how many offerings are currently
-- available and the offerings that will be available in the next period.
-- The API returns a @NotEligible@ error if the user is not permitted to
-- invoke the operation. If you must be able to invoke this operation,
-- contact
-- <mailto:aws-devicefarm-support@amazon.com aws-devicefarm-support\@amazon.com>.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.GetOfferingStatus
  ( -- * Creating a Request
    GetOfferingStatus (..),
    newGetOfferingStatus,

    -- * Request Lenses
    getOfferingStatus_nextToken,

    -- * Destructuring the Response
    GetOfferingStatusResponse (..),
    newGetOfferingStatusResponse,

    -- * Response Lenses
    getOfferingStatusResponse_nextPeriod,
    getOfferingStatusResponse_current,
    getOfferingStatusResponse_nextToken,
    getOfferingStatusResponse_httpStatus,
  )
where

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

-- | Represents the request to retrieve the offering status for the specified
-- customer or account.
--
-- /See:/ 'newGetOfferingStatus' smart constructor.
data GetOfferingStatus = GetOfferingStatus'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    GetOfferingStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetOfferingStatus -> GetOfferingStatus -> Bool
(GetOfferingStatus -> GetOfferingStatus -> Bool)
-> (GetOfferingStatus -> GetOfferingStatus -> Bool)
-> Eq GetOfferingStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOfferingStatus -> GetOfferingStatus -> Bool
$c/= :: GetOfferingStatus -> GetOfferingStatus -> Bool
== :: GetOfferingStatus -> GetOfferingStatus -> Bool
$c== :: GetOfferingStatus -> GetOfferingStatus -> Bool
Prelude.Eq, ReadPrec [GetOfferingStatus]
ReadPrec GetOfferingStatus
Int -> ReadS GetOfferingStatus
ReadS [GetOfferingStatus]
(Int -> ReadS GetOfferingStatus)
-> ReadS [GetOfferingStatus]
-> ReadPrec GetOfferingStatus
-> ReadPrec [GetOfferingStatus]
-> Read GetOfferingStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOfferingStatus]
$creadListPrec :: ReadPrec [GetOfferingStatus]
readPrec :: ReadPrec GetOfferingStatus
$creadPrec :: ReadPrec GetOfferingStatus
readList :: ReadS [GetOfferingStatus]
$creadList :: ReadS [GetOfferingStatus]
readsPrec :: Int -> ReadS GetOfferingStatus
$creadsPrec :: Int -> ReadS GetOfferingStatus
Prelude.Read, Int -> GetOfferingStatus -> ShowS
[GetOfferingStatus] -> ShowS
GetOfferingStatus -> String
(Int -> GetOfferingStatus -> ShowS)
-> (GetOfferingStatus -> String)
-> ([GetOfferingStatus] -> ShowS)
-> Show GetOfferingStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOfferingStatus] -> ShowS
$cshowList :: [GetOfferingStatus] -> ShowS
show :: GetOfferingStatus -> String
$cshow :: GetOfferingStatus -> String
showsPrec :: Int -> GetOfferingStatus -> ShowS
$cshowsPrec :: Int -> GetOfferingStatus -> ShowS
Prelude.Show, (forall x. GetOfferingStatus -> Rep GetOfferingStatus x)
-> (forall x. Rep GetOfferingStatus x -> GetOfferingStatus)
-> Generic GetOfferingStatus
forall x. Rep GetOfferingStatus x -> GetOfferingStatus
forall x. GetOfferingStatus -> Rep GetOfferingStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetOfferingStatus x -> GetOfferingStatus
$cfrom :: forall x. GetOfferingStatus -> Rep GetOfferingStatus x
Prelude.Generic)

-- |
-- Create a value of 'GetOfferingStatus' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'getOfferingStatus_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
newGetOfferingStatus ::
  GetOfferingStatus
newGetOfferingStatus :: GetOfferingStatus
newGetOfferingStatus =
  GetOfferingStatus' :: Maybe Text -> GetOfferingStatus
GetOfferingStatus' {$sel:nextToken:GetOfferingStatus' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
getOfferingStatus_nextToken :: Lens.Lens' GetOfferingStatus (Prelude.Maybe Prelude.Text)
getOfferingStatus_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetOfferingStatus -> f GetOfferingStatus
getOfferingStatus_nextToken = (GetOfferingStatus -> Maybe Text)
-> (GetOfferingStatus -> Maybe Text -> GetOfferingStatus)
-> Lens
     GetOfferingStatus GetOfferingStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOfferingStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetOfferingStatus' :: GetOfferingStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetOfferingStatus
s@GetOfferingStatus' {} Maybe Text
a -> GetOfferingStatus
s {$sel:nextToken:GetOfferingStatus' :: Maybe Text
nextToken = Maybe Text
a} :: GetOfferingStatus)

instance Core.AWSPager GetOfferingStatus where
  page :: GetOfferingStatus
-> AWSResponse GetOfferingStatus -> Maybe GetOfferingStatus
page GetOfferingStatus
rq AWSResponse GetOfferingStatus
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetOfferingStatus
GetOfferingStatusResponse
rs
            GetOfferingStatusResponse
-> Getting (First Text) GetOfferingStatusResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetOfferingStatusResponse
-> Const (First Text) GetOfferingStatusResponse
Lens' GetOfferingStatusResponse (Maybe Text)
getOfferingStatusResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetOfferingStatusResponse
 -> Const (First Text) GetOfferingStatusResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetOfferingStatusResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetOfferingStatus
forall a. Maybe a
Prelude.Nothing
    | Maybe (HashMap Text OfferingStatus) -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetOfferingStatus
GetOfferingStatusResponse
rs
            GetOfferingStatusResponse
-> Getting
     (First (HashMap Text OfferingStatus))
     GetOfferingStatusResponse
     (HashMap Text OfferingStatus)
-> Maybe (HashMap Text OfferingStatus)
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (HashMap Text OfferingStatus)
 -> Const
      (First (HashMap Text OfferingStatus))
      (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse
-> Const
     (First (HashMap Text OfferingStatus)) GetOfferingStatusResponse
Lens'
  GetOfferingStatusResponse (Maybe (HashMap Text OfferingStatus))
getOfferingStatusResponse_current
              ((Maybe (HashMap Text OfferingStatus)
  -> Const
       (First (HashMap Text OfferingStatus))
       (Maybe (HashMap Text OfferingStatus)))
 -> GetOfferingStatusResponse
 -> Const
      (First (HashMap Text OfferingStatus)) GetOfferingStatusResponse)
-> ((HashMap Text OfferingStatus
     -> Const
          (First (HashMap Text OfferingStatus))
          (HashMap Text OfferingStatus))
    -> Maybe (HashMap Text OfferingStatus)
    -> Const
         (First (HashMap Text OfferingStatus))
         (Maybe (HashMap Text OfferingStatus)))
-> Getting
     (First (HashMap Text OfferingStatus))
     GetOfferingStatusResponse
     (HashMap Text OfferingStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text OfferingStatus
 -> Const
      (First (HashMap Text OfferingStatus))
      (HashMap Text OfferingStatus))
-> Maybe (HashMap Text OfferingStatus)
-> Const
     (First (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetOfferingStatus
forall a. Maybe a
Prelude.Nothing
    | Maybe (HashMap Text OfferingStatus) -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetOfferingStatus
GetOfferingStatusResponse
rs
            GetOfferingStatusResponse
-> Getting
     (First (HashMap Text OfferingStatus))
     GetOfferingStatusResponse
     (HashMap Text OfferingStatus)
-> Maybe (HashMap Text OfferingStatus)
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (HashMap Text OfferingStatus)
 -> Const
      (First (HashMap Text OfferingStatus))
      (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse
-> Const
     (First (HashMap Text OfferingStatus)) GetOfferingStatusResponse
Lens'
  GetOfferingStatusResponse (Maybe (HashMap Text OfferingStatus))
getOfferingStatusResponse_nextPeriod
              ((Maybe (HashMap Text OfferingStatus)
  -> Const
       (First (HashMap Text OfferingStatus))
       (Maybe (HashMap Text OfferingStatus)))
 -> GetOfferingStatusResponse
 -> Const
      (First (HashMap Text OfferingStatus)) GetOfferingStatusResponse)
-> ((HashMap Text OfferingStatus
     -> Const
          (First (HashMap Text OfferingStatus))
          (HashMap Text OfferingStatus))
    -> Maybe (HashMap Text OfferingStatus)
    -> Const
         (First (HashMap Text OfferingStatus))
         (Maybe (HashMap Text OfferingStatus)))
-> Getting
     (First (HashMap Text OfferingStatus))
     GetOfferingStatusResponse
     (HashMap Text OfferingStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text OfferingStatus
 -> Const
      (First (HashMap Text OfferingStatus))
      (HashMap Text OfferingStatus))
-> Maybe (HashMap Text OfferingStatus)
-> Const
     (First (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetOfferingStatus
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetOfferingStatus -> Maybe GetOfferingStatus
forall a. a -> Maybe a
Prelude.Just (GetOfferingStatus -> Maybe GetOfferingStatus)
-> GetOfferingStatus -> Maybe GetOfferingStatus
forall a b. (a -> b) -> a -> b
Prelude.$
        GetOfferingStatus
rq
          GetOfferingStatus
-> (GetOfferingStatus -> GetOfferingStatus) -> GetOfferingStatus
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetOfferingStatus -> Identity GetOfferingStatus
Lens GetOfferingStatus GetOfferingStatus (Maybe Text) (Maybe Text)
getOfferingStatus_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetOfferingStatus -> Identity GetOfferingStatus)
-> Maybe Text -> GetOfferingStatus -> GetOfferingStatus
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetOfferingStatus
GetOfferingStatusResponse
rs
          GetOfferingStatusResponse
-> Getting (First Text) GetOfferingStatusResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetOfferingStatusResponse
-> Const (First Text) GetOfferingStatusResponse
Lens' GetOfferingStatusResponse (Maybe Text)
getOfferingStatusResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetOfferingStatusResponse
 -> Const (First Text) GetOfferingStatusResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetOfferingStatusResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetOfferingStatus where
  type
    AWSResponse GetOfferingStatus =
      GetOfferingStatusResponse
  request :: GetOfferingStatus -> Request GetOfferingStatus
request = Service -> GetOfferingStatus -> Request GetOfferingStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetOfferingStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetOfferingStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetOfferingStatus))
-> Logger
-> Service
-> Proxy GetOfferingStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetOfferingStatus)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (HashMap Text OfferingStatus)
-> Maybe (HashMap Text OfferingStatus)
-> Maybe Text
-> Int
-> GetOfferingStatusResponse
GetOfferingStatusResponse'
            (Maybe (HashMap Text OfferingStatus)
 -> Maybe (HashMap Text OfferingStatus)
 -> Maybe Text
 -> Int
 -> GetOfferingStatusResponse)
-> Either String (Maybe (HashMap Text OfferingStatus))
-> Either
     String
     (Maybe (HashMap Text OfferingStatus)
      -> Maybe Text -> Int -> GetOfferingStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text OfferingStatus)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextPeriod" Either String (Maybe (Maybe (HashMap Text OfferingStatus)))
-> Maybe (HashMap Text OfferingStatus)
-> Either String (Maybe (HashMap Text OfferingStatus))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text OfferingStatus)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe (HashMap Text OfferingStatus)
   -> Maybe Text -> Int -> GetOfferingStatusResponse)
-> Either String (Maybe (HashMap Text OfferingStatus))
-> Either String (Maybe Text -> Int -> GetOfferingStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text OfferingStatus)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"current" Either String (Maybe (Maybe (HashMap Text OfferingStatus)))
-> Maybe (HashMap Text OfferingStatus)
-> Either String (Maybe (HashMap Text OfferingStatus))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text OfferingStatus)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetOfferingStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetOfferingStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> GetOfferingStatusResponse)
-> Either String Int -> Either String GetOfferingStatusResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetOfferingStatus

instance Prelude.NFData GetOfferingStatus

instance Core.ToHeaders GetOfferingStatus where
  toHeaders :: GetOfferingStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetOfferingStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DeviceFarm_20150623.GetOfferingStatus" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetOfferingStatus where
  toJSON :: GetOfferingStatus -> Value
toJSON GetOfferingStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetOfferingStatus' :: GetOfferingStatus -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken]
      )

instance Core.ToPath GetOfferingStatus where
  toPath :: GetOfferingStatus -> ByteString
toPath = ByteString -> GetOfferingStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Returns the status result for a device offering.
--
-- /See:/ 'newGetOfferingStatusResponse' smart constructor.
data GetOfferingStatusResponse = GetOfferingStatusResponse'
  { -- | When specified, gets the offering status for the next period.
    GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus)
nextPeriod :: Prelude.Maybe (Prelude.HashMap Prelude.Text OfferingStatus),
    -- | When specified, gets the offering status for the current period.
    GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus)
current :: Prelude.Maybe (Prelude.HashMap Prelude.Text OfferingStatus),
    -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    GetOfferingStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetOfferingStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool
(GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool)
-> (GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool)
-> Eq GetOfferingStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool
$c/= :: GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool
== :: GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool
$c== :: GetOfferingStatusResponse -> GetOfferingStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetOfferingStatusResponse]
ReadPrec GetOfferingStatusResponse
Int -> ReadS GetOfferingStatusResponse
ReadS [GetOfferingStatusResponse]
(Int -> ReadS GetOfferingStatusResponse)
-> ReadS [GetOfferingStatusResponse]
-> ReadPrec GetOfferingStatusResponse
-> ReadPrec [GetOfferingStatusResponse]
-> Read GetOfferingStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOfferingStatusResponse]
$creadListPrec :: ReadPrec [GetOfferingStatusResponse]
readPrec :: ReadPrec GetOfferingStatusResponse
$creadPrec :: ReadPrec GetOfferingStatusResponse
readList :: ReadS [GetOfferingStatusResponse]
$creadList :: ReadS [GetOfferingStatusResponse]
readsPrec :: Int -> ReadS GetOfferingStatusResponse
$creadsPrec :: Int -> ReadS GetOfferingStatusResponse
Prelude.Read, Int -> GetOfferingStatusResponse -> ShowS
[GetOfferingStatusResponse] -> ShowS
GetOfferingStatusResponse -> String
(Int -> GetOfferingStatusResponse -> ShowS)
-> (GetOfferingStatusResponse -> String)
-> ([GetOfferingStatusResponse] -> ShowS)
-> Show GetOfferingStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOfferingStatusResponse] -> ShowS
$cshowList :: [GetOfferingStatusResponse] -> ShowS
show :: GetOfferingStatusResponse -> String
$cshow :: GetOfferingStatusResponse -> String
showsPrec :: Int -> GetOfferingStatusResponse -> ShowS
$cshowsPrec :: Int -> GetOfferingStatusResponse -> ShowS
Prelude.Show, (forall x.
 GetOfferingStatusResponse -> Rep GetOfferingStatusResponse x)
-> (forall x.
    Rep GetOfferingStatusResponse x -> GetOfferingStatusResponse)
-> Generic GetOfferingStatusResponse
forall x.
Rep GetOfferingStatusResponse x -> GetOfferingStatusResponse
forall x.
GetOfferingStatusResponse -> Rep GetOfferingStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOfferingStatusResponse x -> GetOfferingStatusResponse
$cfrom :: forall x.
GetOfferingStatusResponse -> Rep GetOfferingStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetOfferingStatusResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextPeriod', 'getOfferingStatusResponse_nextPeriod' - When specified, gets the offering status for the next period.
--
-- 'current', 'getOfferingStatusResponse_current' - When specified, gets the offering status for the current period.
--
-- 'nextToken', 'getOfferingStatusResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'httpStatus', 'getOfferingStatusResponse_httpStatus' - The response's http status code.
newGetOfferingStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetOfferingStatusResponse
newGetOfferingStatusResponse :: Int -> GetOfferingStatusResponse
newGetOfferingStatusResponse Int
pHttpStatus_ =
  GetOfferingStatusResponse' :: Maybe (HashMap Text OfferingStatus)
-> Maybe (HashMap Text OfferingStatus)
-> Maybe Text
-> Int
-> GetOfferingStatusResponse
GetOfferingStatusResponse'
    { $sel:nextPeriod:GetOfferingStatusResponse' :: Maybe (HashMap Text OfferingStatus)
nextPeriod =
        Maybe (HashMap Text OfferingStatus)
forall a. Maybe a
Prelude.Nothing,
      $sel:current:GetOfferingStatusResponse' :: Maybe (HashMap Text OfferingStatus)
current = Maybe (HashMap Text OfferingStatus)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetOfferingStatusResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetOfferingStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When specified, gets the offering status for the next period.
getOfferingStatusResponse_nextPeriod :: Lens.Lens' GetOfferingStatusResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text OfferingStatus))
getOfferingStatusResponse_nextPeriod :: (Maybe (HashMap Text OfferingStatus)
 -> f (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse -> f GetOfferingStatusResponse
getOfferingStatusResponse_nextPeriod = (GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus))
-> (GetOfferingStatusResponse
    -> Maybe (HashMap Text OfferingStatus)
    -> GetOfferingStatusResponse)
-> Lens'
     GetOfferingStatusResponse (Maybe (HashMap Text OfferingStatus))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOfferingStatusResponse' {Maybe (HashMap Text OfferingStatus)
nextPeriod :: Maybe (HashMap Text OfferingStatus)
$sel:nextPeriod:GetOfferingStatusResponse' :: GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus)
nextPeriod} -> Maybe (HashMap Text OfferingStatus)
nextPeriod) (\s :: GetOfferingStatusResponse
s@GetOfferingStatusResponse' {} Maybe (HashMap Text OfferingStatus)
a -> GetOfferingStatusResponse
s {$sel:nextPeriod:GetOfferingStatusResponse' :: Maybe (HashMap Text OfferingStatus)
nextPeriod = Maybe (HashMap Text OfferingStatus)
a} :: GetOfferingStatusResponse) ((Maybe (HashMap Text OfferingStatus)
  -> f (Maybe (HashMap Text OfferingStatus)))
 -> GetOfferingStatusResponse -> f GetOfferingStatusResponse)
-> ((Maybe (HashMap Text OfferingStatus)
     -> f (Maybe (HashMap Text OfferingStatus)))
    -> Maybe (HashMap Text OfferingStatus)
    -> f (Maybe (HashMap Text OfferingStatus)))
-> (Maybe (HashMap Text OfferingStatus)
    -> f (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse
-> f GetOfferingStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
-> Iso
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When specified, gets the offering status for the current period.
getOfferingStatusResponse_current :: Lens.Lens' GetOfferingStatusResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text OfferingStatus))
getOfferingStatusResponse_current :: (Maybe (HashMap Text OfferingStatus)
 -> f (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse -> f GetOfferingStatusResponse
getOfferingStatusResponse_current = (GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus))
-> (GetOfferingStatusResponse
    -> Maybe (HashMap Text OfferingStatus)
    -> GetOfferingStatusResponse)
-> Lens'
     GetOfferingStatusResponse (Maybe (HashMap Text OfferingStatus))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOfferingStatusResponse' {Maybe (HashMap Text OfferingStatus)
current :: Maybe (HashMap Text OfferingStatus)
$sel:current:GetOfferingStatusResponse' :: GetOfferingStatusResponse -> Maybe (HashMap Text OfferingStatus)
current} -> Maybe (HashMap Text OfferingStatus)
current) (\s :: GetOfferingStatusResponse
s@GetOfferingStatusResponse' {} Maybe (HashMap Text OfferingStatus)
a -> GetOfferingStatusResponse
s {$sel:current:GetOfferingStatusResponse' :: Maybe (HashMap Text OfferingStatus)
current = Maybe (HashMap Text OfferingStatus)
a} :: GetOfferingStatusResponse) ((Maybe (HashMap Text OfferingStatus)
  -> f (Maybe (HashMap Text OfferingStatus)))
 -> GetOfferingStatusResponse -> f GetOfferingStatusResponse)
-> ((Maybe (HashMap Text OfferingStatus)
     -> f (Maybe (HashMap Text OfferingStatus)))
    -> Maybe (HashMap Text OfferingStatus)
    -> f (Maybe (HashMap Text OfferingStatus)))
-> (Maybe (HashMap Text OfferingStatus)
    -> f (Maybe (HashMap Text OfferingStatus)))
-> GetOfferingStatusResponse
-> f GetOfferingStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
-> Iso
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
     (Maybe (HashMap Text OfferingStatus))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
  (HashMap Text OfferingStatus)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
getOfferingStatusResponse_nextToken :: Lens.Lens' GetOfferingStatusResponse (Prelude.Maybe Prelude.Text)
getOfferingStatusResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetOfferingStatusResponse -> f GetOfferingStatusResponse
getOfferingStatusResponse_nextToken = (GetOfferingStatusResponse -> Maybe Text)
-> (GetOfferingStatusResponse
    -> Maybe Text -> GetOfferingStatusResponse)
-> Lens' GetOfferingStatusResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOfferingStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetOfferingStatusResponse' :: GetOfferingStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetOfferingStatusResponse
s@GetOfferingStatusResponse' {} Maybe Text
a -> GetOfferingStatusResponse
s {$sel:nextToken:GetOfferingStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetOfferingStatusResponse)

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

instance Prelude.NFData GetOfferingStatusResponse