{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the different functions to run the operation getRadarValueLists
module StripeAPI.Operations.GetRadarValueLists where

import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Either
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified Network.HTTP.Client
import qualified Network.HTTP.Client as Network.HTTP.Client.Request
import qualified Network.HTTP.Client as Network.HTTP.Client.Types
import qualified Network.HTTP.Simple
import qualified Network.HTTP.Types
import qualified Network.HTTP.Types as Network.HTTP.Types.Status
import qualified Network.HTTP.Types as Network.HTTP.Types.URI
import qualified StripeAPI.Common
import StripeAPI.Types
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | > GET /v1/radar/value_lists
--
-- \<p>Returns a list of \<code>ValueList\<\/code> objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.\<\/p>
getRadarValueLists ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  GetRadarValueListsParameters ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetRadarValueListsResponse)
getRadarValueLists :: GetRadarValueListsParameters
-> ClientT m (Response GetRadarValueListsResponse)
getRadarValueLists GetRadarValueListsParameters
parameters =
  (Response ByteString -> Response GetRadarValueListsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response GetRadarValueListsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
    ( \Response ByteString
response_0 ->
        (ByteString -> GetRadarValueListsResponse)
-> Response ByteString -> Response GetRadarValueListsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
          ( (String -> GetRadarValueListsResponse)
-> (GetRadarValueListsResponse -> GetRadarValueListsResponse)
-> Either String GetRadarValueListsResponse
-> GetRadarValueListsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetRadarValueListsResponse
GetRadarValueListsResponseError GetRadarValueListsResponse -> GetRadarValueListsResponse
forall a. a -> a
GHC.Base.id
              (Either String GetRadarValueListsResponse
 -> GetRadarValueListsResponse)
-> (ByteString -> Either String GetRadarValueListsResponse)
-> ByteString
-> GetRadarValueListsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                             if
                                 | (\Status
status_1 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_1 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
200) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   GetRadarValueListsResponseBody200 -> GetRadarValueListsResponse
GetRadarValueListsResponse200
                                     (GetRadarValueListsResponseBody200 -> GetRadarValueListsResponse)
-> Either String GetRadarValueListsResponseBody200
-> Either String GetRadarValueListsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetRadarValueListsResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            GetRadarValueListsResponseBody200
                                                      )
                                 | Bool -> Status -> Bool
forall a b. a -> b -> a
GHC.Base.const Bool
GHC.Types.True (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   Error -> GetRadarValueListsResponse
GetRadarValueListsResponseDefault
                                     (Error -> GetRadarValueListsResponse)
-> Either String Error -> Either String GetRadarValueListsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Error
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            Error
                                                      )
                                 | Bool
GHC.Base.otherwise -> String -> Either String GetRadarValueListsResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                         )
                Response ByteString
response_0
          )
          Response ByteString
response_0
    )
    ( Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
StripeAPI.Common.doCallWithConfigurationM
        (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"GET")
        (String -> Text
Data.Text.pack String
"/v1/radar/value_lists")
        [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"alias") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryAlias GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"contains") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryContains GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"created") (GetRadarValueListsParametersQueryCreated'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetRadarValueListsParametersQueryCreated'Variants -> Value)
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
getRadarValueListsParametersQueryCreated GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"ending_before") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryEndingBefore GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"expand") ([Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON ([Text] -> Value) -> Maybe [Text] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe [Text]
getRadarValueListsParametersQueryExpand GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"limit") (Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Int -> Value) -> Maybe Int -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe Int
getRadarValueListsParametersQueryLimit GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"starting_after") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryStartingAfter GetRadarValueListsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
        ]
    )

-- | Defines the object schema located at @paths.\/v1\/radar\/value_lists.GET.parameters@ in the specification.
data GetRadarValueListsParameters = GetRadarValueListsParameters
  { -- | queryAlias: Represents the parameter named \'alias\'
    --
    -- The alias used to reference the value list when writing rules.
    --
    -- Constraints:
    --
    -- * Maximum length of 100
    GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryAlias :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryContains: Represents the parameter named \'contains\'
    --
    -- A value contained within a value list - returns all value lists containing this value.
    --
    -- Constraints:
    --
    -- * Maximum length of 800
    GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryContains :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryCreated: Represents the parameter named \'created\'
    GetRadarValueListsParameters
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
getRadarValueListsParametersQueryCreated :: (GHC.Maybe.Maybe GetRadarValueListsParametersQueryCreated'Variants),
    -- | queryEnding_before: Represents the parameter named \'ending_before\'
    --
    -- A cursor for use in pagination. \`ending_before\` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with \`obj_bar\`, your subsequent call can include \`ending_before=obj_bar\` in order to fetch the previous page of the list.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryExpand: Represents the parameter named \'expand\'
    --
    -- Specifies which fields in the response should be expanded.
    GetRadarValueListsParameters -> Maybe [Text]
getRadarValueListsParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | queryLimit: Represents the parameter named \'limit\'
    --
    -- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
    GetRadarValueListsParameters -> Maybe Int
getRadarValueListsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | queryStarting_after: Represents the parameter named \'starting_after\'
    --
    -- A cursor for use in pagination. \`starting_after\` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with \`obj_foo\`, your subsequent call can include \`starting_after=obj_foo\` in order to fetch the next page of the list.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> GetRadarValueListsParameters -> ShowS
[GetRadarValueListsParameters] -> ShowS
GetRadarValueListsParameters -> String
(Int -> GetRadarValueListsParameters -> ShowS)
-> (GetRadarValueListsParameters -> String)
-> ([GetRadarValueListsParameters] -> ShowS)
-> Show GetRadarValueListsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRadarValueListsParameters] -> ShowS
$cshowList :: [GetRadarValueListsParameters] -> ShowS
show :: GetRadarValueListsParameters -> String
$cshow :: GetRadarValueListsParameters -> String
showsPrec :: Int -> GetRadarValueListsParameters -> ShowS
$cshowsPrec :: Int -> GetRadarValueListsParameters -> ShowS
GHC.Show.Show,
      GetRadarValueListsParameters
-> GetRadarValueListsParameters -> Bool
(GetRadarValueListsParameters
 -> GetRadarValueListsParameters -> Bool)
-> (GetRadarValueListsParameters
    -> GetRadarValueListsParameters -> Bool)
-> Eq GetRadarValueListsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRadarValueListsParameters
-> GetRadarValueListsParameters -> Bool
$c/= :: GetRadarValueListsParameters
-> GetRadarValueListsParameters -> Bool
== :: GetRadarValueListsParameters
-> GetRadarValueListsParameters -> Bool
$c== :: GetRadarValueListsParameters
-> GetRadarValueListsParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetRadarValueListsParameters where
  toJSON :: GetRadarValueListsParameters -> Value
toJSON GetRadarValueListsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryAlias" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryAlias GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryContains" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryContains GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryCreated" Text
-> Maybe GetRadarValueListsParametersQueryCreated'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
getRadarValueListsParametersQueryCreated GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryEnding_before" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryEndingBefore GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryExpand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe [Text]
getRadarValueListsParametersQueryExpand GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryLimit" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Int
getRadarValueListsParametersQueryLimit GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryStarting_after" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryStartingAfter GetRadarValueListsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetRadarValueListsParameters -> Encoding
toEncoding GetRadarValueListsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryAlias" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryAlias GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryContains" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryContains GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryCreated" Text
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
getRadarValueListsParametersQueryCreated GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryEnding_before" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryEndingBefore GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryExpand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe [Text]
getRadarValueListsParametersQueryExpand GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryLimit" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Int
getRadarValueListsParametersQueryLimit GetRadarValueListsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryStarting_after" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParameters -> Maybe Text
getRadarValueListsParametersQueryStartingAfter GetRadarValueListsParameters
obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON GetRadarValueListsParameters where
  parseJSON :: Value -> Parser GetRadarValueListsParameters
parseJSON = String
-> (Object -> Parser GetRadarValueListsParameters)
-> Value
-> Parser GetRadarValueListsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetRadarValueListsParameters" (\Object
obj -> (((((((Maybe Text
 -> Maybe Text
 -> Maybe GetRadarValueListsParametersQueryCreated'Variants
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> GetRadarValueListsParameters)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe GetRadarValueListsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetRadarValueListsParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetRadarValueListsParameters
GetRadarValueListsParameters Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe GetRadarValueListsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetRadarValueListsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe GetRadarValueListsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryAlias")) Parser
  (Maybe Text
   -> Maybe GetRadarValueListsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetRadarValueListsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe GetRadarValueListsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryContains")) Parser
  (Maybe GetRadarValueListsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetRadarValueListsParameters)
-> Parser (Maybe GetRadarValueListsParametersQueryCreated'Variants)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe GetRadarValueListsParametersQueryCreated'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryCreated")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetRadarValueListsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Int -> Maybe Text -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryEnding_before")) Parser
  (Maybe [Text]
   -> Maybe Int -> Maybe Text -> GetRadarValueListsParameters)
-> Parser (Maybe [Text])
-> Parser (Maybe Int -> Maybe Text -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryExpand")) Parser (Maybe Int -> Maybe Text -> GetRadarValueListsParameters)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> GetRadarValueListsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryLimit")) Parser (Maybe Text -> GetRadarValueListsParameters)
-> Parser (Maybe Text) -> Parser GetRadarValueListsParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryStarting_after"))

-- | Create a new 'GetRadarValueListsParameters' with all required fields.
mkGetRadarValueListsParameters :: GetRadarValueListsParameters
mkGetRadarValueListsParameters :: GetRadarValueListsParameters
mkGetRadarValueListsParameters =
  GetRadarValueListsParameters :: Maybe Text
-> Maybe Text
-> Maybe GetRadarValueListsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetRadarValueListsParameters
GetRadarValueListsParameters
    { getRadarValueListsParametersQueryAlias :: Maybe Text
getRadarValueListsParametersQueryAlias = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryContains :: Maybe Text
getRadarValueListsParametersQueryContains = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryCreated :: Maybe GetRadarValueListsParametersQueryCreated'Variants
getRadarValueListsParametersQueryCreated = Maybe GetRadarValueListsParametersQueryCreated'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryEndingBefore :: Maybe Text
getRadarValueListsParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryExpand :: Maybe [Text]
getRadarValueListsParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryLimit :: Maybe Int
getRadarValueListsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryStartingAfter :: Maybe Text
getRadarValueListsParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @paths.\/v1\/radar\/value_lists.GET.parameters.properties.queryCreated.anyOf@ in the specification.
data GetRadarValueListsParametersQueryCreated'OneOf1 = GetRadarValueListsParametersQueryCreated'OneOf1
  { -- | gt
    GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | gte
    GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gte :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lt
    GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lte
    GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lte :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GetRadarValueListsParametersQueryCreated'OneOf1 -> ShowS
[GetRadarValueListsParametersQueryCreated'OneOf1] -> ShowS
GetRadarValueListsParametersQueryCreated'OneOf1 -> String
(Int -> GetRadarValueListsParametersQueryCreated'OneOf1 -> ShowS)
-> (GetRadarValueListsParametersQueryCreated'OneOf1 -> String)
-> ([GetRadarValueListsParametersQueryCreated'OneOf1] -> ShowS)
-> Show GetRadarValueListsParametersQueryCreated'OneOf1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRadarValueListsParametersQueryCreated'OneOf1] -> ShowS
$cshowList :: [GetRadarValueListsParametersQueryCreated'OneOf1] -> ShowS
show :: GetRadarValueListsParametersQueryCreated'OneOf1 -> String
$cshow :: GetRadarValueListsParametersQueryCreated'OneOf1 -> String
showsPrec :: Int -> GetRadarValueListsParametersQueryCreated'OneOf1 -> ShowS
$cshowsPrec :: Int -> GetRadarValueListsParametersQueryCreated'OneOf1 -> ShowS
GHC.Show.Show,
      GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool
(GetRadarValueListsParametersQueryCreated'OneOf1
 -> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool)
-> (GetRadarValueListsParametersQueryCreated'OneOf1
    -> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool)
-> Eq GetRadarValueListsParametersQueryCreated'OneOf1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool
$c/= :: GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool
== :: GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool
$c== :: GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'OneOf1 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetRadarValueListsParametersQueryCreated'OneOf1 where
  toJSON :: GetRadarValueListsParametersQueryCreated'OneOf1 -> Value
toJSON GetRadarValueListsParametersQueryCreated'OneOf1
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"gt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gt GetRadarValueListsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"gte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gte GetRadarValueListsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lt GetRadarValueListsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lte GetRadarValueListsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetRadarValueListsParametersQueryCreated'OneOf1 -> Encoding
toEncoding GetRadarValueListsParametersQueryCreated'OneOf1
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"gt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gt GetRadarValueListsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"gte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gte GetRadarValueListsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"lt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lt GetRadarValueListsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"lte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsParametersQueryCreated'OneOf1 -> Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lte GetRadarValueListsParametersQueryCreated'OneOf1
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON GetRadarValueListsParametersQueryCreated'OneOf1 where
  parseJSON :: Value -> Parser GetRadarValueListsParametersQueryCreated'OneOf1
parseJSON = String
-> (Object
    -> Parser GetRadarValueListsParametersQueryCreated'OneOf1)
-> Value
-> Parser GetRadarValueListsParametersQueryCreated'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetRadarValueListsParametersQueryCreated'OneOf1" (\Object
obj -> ((((Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> GetRadarValueListsParametersQueryCreated'OneOf1)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetRadarValueListsParametersQueryCreated'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetRadarValueListsParametersQueryCreated'OneOf1
GetRadarValueListsParametersQueryCreated'OneOf1 Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetRadarValueListsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetRadarValueListsParametersQueryCreated'OneOf1)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"gt")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetRadarValueListsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int -> GetRadarValueListsParametersQueryCreated'OneOf1)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"gte")) Parser
  (Maybe Int
   -> Maybe Int -> GetRadarValueListsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> GetRadarValueListsParametersQueryCreated'OneOf1)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"lt")) Parser
  (Maybe Int -> GetRadarValueListsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser GetRadarValueListsParametersQueryCreated'OneOf1
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"lte"))

-- | Create a new 'GetRadarValueListsParametersQueryCreated'OneOf1' with all required fields.
mkGetRadarValueListsParametersQueryCreated'OneOf1 :: GetRadarValueListsParametersQueryCreated'OneOf1
mkGetRadarValueListsParametersQueryCreated'OneOf1 :: GetRadarValueListsParametersQueryCreated'OneOf1
mkGetRadarValueListsParametersQueryCreated'OneOf1 =
  GetRadarValueListsParametersQueryCreated'OneOf1 :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetRadarValueListsParametersQueryCreated'OneOf1
GetRadarValueListsParametersQueryCreated'OneOf1
    { getRadarValueListsParametersQueryCreated'OneOf1Gt :: Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryCreated'OneOf1Gte :: Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Gte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryCreated'OneOf1Lt :: Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getRadarValueListsParametersQueryCreated'OneOf1Lte :: Maybe Int
getRadarValueListsParametersQueryCreated'OneOf1Lte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/radar\/value_lists.GET.parameters.properties.queryCreated.anyOf@ in the specification.
--
-- Represents the parameter named \'created\'
data GetRadarValueListsParametersQueryCreated'Variants
  = GetRadarValueListsParametersQueryCreated'GetRadarValueListsParametersQueryCreated'OneOf1 GetRadarValueListsParametersQueryCreated'OneOf1
  | GetRadarValueListsParametersQueryCreated'Int GHC.Types.Int
  deriving (Int -> GetRadarValueListsParametersQueryCreated'Variants -> ShowS
[GetRadarValueListsParametersQueryCreated'Variants] -> ShowS
GetRadarValueListsParametersQueryCreated'Variants -> String
(Int -> GetRadarValueListsParametersQueryCreated'Variants -> ShowS)
-> (GetRadarValueListsParametersQueryCreated'Variants -> String)
-> ([GetRadarValueListsParametersQueryCreated'Variants] -> ShowS)
-> Show GetRadarValueListsParametersQueryCreated'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRadarValueListsParametersQueryCreated'Variants] -> ShowS
$cshowList :: [GetRadarValueListsParametersQueryCreated'Variants] -> ShowS
show :: GetRadarValueListsParametersQueryCreated'Variants -> String
$cshow :: GetRadarValueListsParametersQueryCreated'Variants -> String
showsPrec :: Int -> GetRadarValueListsParametersQueryCreated'Variants -> ShowS
$cshowsPrec :: Int -> GetRadarValueListsParametersQueryCreated'Variants -> ShowS
GHC.Show.Show, GetRadarValueListsParametersQueryCreated'Variants
-> GetRadarValueListsParametersQueryCreated'Variants -> Bool
(GetRadarValueListsParametersQueryCreated'Variants
 -> GetRadarValueListsParametersQueryCreated'Variants -> Bool)
-> (GetRadarValueListsParametersQueryCreated'Variants
    -> GetRadarValueListsParametersQueryCreated'Variants -> Bool)
-> Eq GetRadarValueListsParametersQueryCreated'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRadarValueListsParametersQueryCreated'Variants
-> GetRadarValueListsParametersQueryCreated'Variants -> Bool
$c/= :: GetRadarValueListsParametersQueryCreated'Variants
-> GetRadarValueListsParametersQueryCreated'Variants -> Bool
== :: GetRadarValueListsParametersQueryCreated'Variants
-> GetRadarValueListsParametersQueryCreated'Variants -> Bool
$c== :: GetRadarValueListsParametersQueryCreated'Variants
-> GetRadarValueListsParametersQueryCreated'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GetRadarValueListsParametersQueryCreated'Variants where
  toJSON :: GetRadarValueListsParametersQueryCreated'Variants -> Value
toJSON (GetRadarValueListsParametersQueryCreated'GetRadarValueListsParametersQueryCreated'OneOf1 GetRadarValueListsParametersQueryCreated'OneOf1
a) = GetRadarValueListsParametersQueryCreated'OneOf1 -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON GetRadarValueListsParametersQueryCreated'OneOf1
a
  toJSON (GetRadarValueListsParametersQueryCreated'Int Int
a) = Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Int
a

instance Data.Aeson.Types.FromJSON.FromJSON GetRadarValueListsParametersQueryCreated'Variants where
  parseJSON :: Value -> Parser GetRadarValueListsParametersQueryCreated'Variants
parseJSON Value
val = case (GetRadarValueListsParametersQueryCreated'OneOf1
-> GetRadarValueListsParametersQueryCreated'Variants
GetRadarValueListsParametersQueryCreated'GetRadarValueListsParametersQueryCreated'OneOf1 (GetRadarValueListsParametersQueryCreated'OneOf1
 -> GetRadarValueListsParametersQueryCreated'Variants)
-> Result GetRadarValueListsParametersQueryCreated'OneOf1
-> Result GetRadarValueListsParametersQueryCreated'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result GetRadarValueListsParametersQueryCreated'OneOf1
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetRadarValueListsParametersQueryCreated'Variants
-> Result GetRadarValueListsParametersQueryCreated'Variants
-> Result GetRadarValueListsParametersQueryCreated'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Int -> GetRadarValueListsParametersQueryCreated'Variants
GetRadarValueListsParametersQueryCreated'Int (Int -> GetRadarValueListsParametersQueryCreated'Variants)
-> Result Int
-> Result GetRadarValueListsParametersQueryCreated'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Int
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetRadarValueListsParametersQueryCreated'Variants
-> Result GetRadarValueListsParametersQueryCreated'Variants
-> Result GetRadarValueListsParametersQueryCreated'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result GetRadarValueListsParametersQueryCreated'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success GetRadarValueListsParametersQueryCreated'Variants
a -> GetRadarValueListsParametersQueryCreated'Variants
-> Parser GetRadarValueListsParametersQueryCreated'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure GetRadarValueListsParametersQueryCreated'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser GetRadarValueListsParametersQueryCreated'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Represents a response of the operation 'getRadarValueLists'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetRadarValueListsResponseError' is used.
data GetRadarValueListsResponse
  = -- | Means either no matching case available or a parse error
    GetRadarValueListsResponseError GHC.Base.String
  | -- | Successful response.
    GetRadarValueListsResponse200 GetRadarValueListsResponseBody200
  | -- | Error response.
    GetRadarValueListsResponseDefault Error
  deriving (Int -> GetRadarValueListsResponse -> ShowS
[GetRadarValueListsResponse] -> ShowS
GetRadarValueListsResponse -> String
(Int -> GetRadarValueListsResponse -> ShowS)
-> (GetRadarValueListsResponse -> String)
-> ([GetRadarValueListsResponse] -> ShowS)
-> Show GetRadarValueListsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRadarValueListsResponse] -> ShowS
$cshowList :: [GetRadarValueListsResponse] -> ShowS
show :: GetRadarValueListsResponse -> String
$cshow :: GetRadarValueListsResponse -> String
showsPrec :: Int -> GetRadarValueListsResponse -> ShowS
$cshowsPrec :: Int -> GetRadarValueListsResponse -> ShowS
GHC.Show.Show, GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool
(GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool)
-> (GetRadarValueListsResponse
    -> GetRadarValueListsResponse -> Bool)
-> Eq GetRadarValueListsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool
$c/= :: GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool
== :: GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool
$c== :: GetRadarValueListsResponse -> GetRadarValueListsResponse -> Bool
GHC.Classes.Eq)

-- | Defines the object schema located at @paths.\/v1\/radar\/value_lists.GET.responses.200.content.application\/json.schema@ in the specification.
data GetRadarValueListsResponseBody200 = GetRadarValueListsResponseBody200
  { -- | data
    GetRadarValueListsResponseBody200 -> [Radar'valueList]
getRadarValueListsResponseBody200Data :: ([Radar'valueList]),
    -- | has_more: True if this list has another page of items after this one that can be fetched.
    GetRadarValueListsResponseBody200 -> Bool
getRadarValueListsResponseBody200HasMore :: GHC.Types.Bool,
    -- | url: The URL where this list can be accessed.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    -- * Must match pattern \'^\/v1\/radar\/value_lists\'
    GetRadarValueListsResponseBody200 -> Text
getRadarValueListsResponseBody200Url :: Data.Text.Internal.Text
  }
  deriving
    ( Int -> GetRadarValueListsResponseBody200 -> ShowS
[GetRadarValueListsResponseBody200] -> ShowS
GetRadarValueListsResponseBody200 -> String
(Int -> GetRadarValueListsResponseBody200 -> ShowS)
-> (GetRadarValueListsResponseBody200 -> String)
-> ([GetRadarValueListsResponseBody200] -> ShowS)
-> Show GetRadarValueListsResponseBody200
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRadarValueListsResponseBody200] -> ShowS
$cshowList :: [GetRadarValueListsResponseBody200] -> ShowS
show :: GetRadarValueListsResponseBody200 -> String
$cshow :: GetRadarValueListsResponseBody200 -> String
showsPrec :: Int -> GetRadarValueListsResponseBody200 -> ShowS
$cshowsPrec :: Int -> GetRadarValueListsResponseBody200 -> ShowS
GHC.Show.Show,
      GetRadarValueListsResponseBody200
-> GetRadarValueListsResponseBody200 -> Bool
(GetRadarValueListsResponseBody200
 -> GetRadarValueListsResponseBody200 -> Bool)
-> (GetRadarValueListsResponseBody200
    -> GetRadarValueListsResponseBody200 -> Bool)
-> Eq GetRadarValueListsResponseBody200
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRadarValueListsResponseBody200
-> GetRadarValueListsResponseBody200 -> Bool
$c/= :: GetRadarValueListsResponseBody200
-> GetRadarValueListsResponseBody200 -> Bool
== :: GetRadarValueListsResponseBody200
-> GetRadarValueListsResponseBody200 -> Bool
$c== :: GetRadarValueListsResponseBody200
-> GetRadarValueListsResponseBody200 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetRadarValueListsResponseBody200 where
  toJSON :: GetRadarValueListsResponseBody200 -> Value
toJSON GetRadarValueListsResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [Radar'valueList] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> [Radar'valueList]
getRadarValueListsResponseBody200Data GetRadarValueListsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"has_more" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> Bool
getRadarValueListsResponseBody200HasMore GetRadarValueListsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> Text
getRadarValueListsResponseBody200Url GetRadarValueListsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"list" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetRadarValueListsResponseBody200 -> Encoding
toEncoding GetRadarValueListsResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [Radar'valueList] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> [Radar'valueList]
getRadarValueListsResponseBody200Data GetRadarValueListsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"has_more" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> Bool
getRadarValueListsResponseBody200HasMore GetRadarValueListsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetRadarValueListsResponseBody200 -> Text
getRadarValueListsResponseBody200Url GetRadarValueListsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"list"))))

instance Data.Aeson.Types.FromJSON.FromJSON GetRadarValueListsResponseBody200 where
  parseJSON :: Value -> Parser GetRadarValueListsResponseBody200
parseJSON = String
-> (Object -> Parser GetRadarValueListsResponseBody200)
-> Value
-> Parser GetRadarValueListsResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetRadarValueListsResponseBody200" (\Object
obj -> ((([Radar'valueList]
 -> Bool -> Text -> GetRadarValueListsResponseBody200)
-> Parser
     ([Radar'valueList]
      -> Bool -> Text -> GetRadarValueListsResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [Radar'valueList]
-> Bool -> Text -> GetRadarValueListsResponseBody200
GetRadarValueListsResponseBody200 Parser
  ([Radar'valueList]
   -> Bool -> Text -> GetRadarValueListsResponseBody200)
-> Parser [Radar'valueList]
-> Parser (Bool -> Text -> GetRadarValueListsResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [Radar'valueList]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> GetRadarValueListsResponseBody200)
-> Parser Bool
-> Parser (Text -> GetRadarValueListsResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"has_more")) Parser (Text -> GetRadarValueListsResponseBody200)
-> Parser Text -> Parser GetRadarValueListsResponseBody200
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"url"))

-- | Create a new 'GetRadarValueListsResponseBody200' with all required fields.
mkGetRadarValueListsResponseBody200 ::
  -- | 'getRadarValueListsResponseBody200Data'
  [Radar'valueList] ->
  -- | 'getRadarValueListsResponseBody200HasMore'
  GHC.Types.Bool ->
  -- | 'getRadarValueListsResponseBody200Url'
  Data.Text.Internal.Text ->
  GetRadarValueListsResponseBody200
mkGetRadarValueListsResponseBody200 :: [Radar'valueList]
-> Bool -> Text -> GetRadarValueListsResponseBody200
mkGetRadarValueListsResponseBody200 [Radar'valueList]
getRadarValueListsResponseBody200Data Bool
getRadarValueListsResponseBody200HasMore Text
getRadarValueListsResponseBody200Url =
  GetRadarValueListsResponseBody200 :: [Radar'valueList]
-> Bool -> Text -> GetRadarValueListsResponseBody200
GetRadarValueListsResponseBody200
    { getRadarValueListsResponseBody200Data :: [Radar'valueList]
getRadarValueListsResponseBody200Data = [Radar'valueList]
getRadarValueListsResponseBody200Data,
      getRadarValueListsResponseBody200HasMore :: Bool
getRadarValueListsResponseBody200HasMore = Bool
getRadarValueListsResponseBody200HasMore,
      getRadarValueListsResponseBody200Url :: Text
getRadarValueListsResponseBody200Url = Text
getRadarValueListsResponseBody200Url
    }