Something went wrong. Try again.
Dagger 1.0.0 beta SDK experiments
dagger purescript gleam clojure
Something went wrong. Try again.
5.5 kB · 153 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154-- Generated by scripts/generate.mjs. Do not edit.module Dagger.Function ( args , deprecated , description , id , name , returnType , sourceMap , sourceModuleName , withAgent , withArg , withArgWith , WithArgOpts , defaultWithArgOpts , withCachePolicy , withCachePolicyWith , WithCachePolicyOpts , defaultWithCachePolicyOpts , withCheck , withDeprecated , withDeprecatedWith , WithDeprecatedOpts , defaultWithDeprecatedOpts , withDescription , withGenerator , withSourceMap , withUp ) where
import Data.Maybe (Maybe(..))import Effect.Aff (Aff)import Dagger.Internal.Runtime as Rimport Dagger.Types as T
-- | Arguments accepted by the function, if any.args :: T.Function -> Aff (Array T.FunctionArg)args = R.objectList "FunctionArg" "args" []
-- | The reason this function is deprecated, if any.deprecated :: T.Function -> Aff (Maybe String)deprecated = R.scalar "deprecated" []
-- | A doc string for the function, if any.description :: T.Function -> Aff Stringdescription = R.scalar "description" []
-- | A unique identifier for this Function.id :: T.Function -> Aff T.IDid = R.scalar "id" []
-- | The name of the function.name :: T.Function -> Aff Stringname = R.scalar "name" []
-- | The type returned by the function.returnType :: T.Function -> T.TypeDefreturnType = R.select "returnType" []
-- | The location of this function declaration.sourceMap :: T.Function -> Aff (Maybe T.SourceMap)sourceMap = R.nullableObject "SourceMap" "sourceMap" []
-- | If this function is provided by a module, the name of the module. Unset otherwise.sourceModuleName :: T.Function -> Aff StringsourceModuleName = R.scalar "sourceModuleName" []
-- | Returns the function with a flag indicating it is a source of expertise.withAgent :: T.Function -> T.FunctionwithAgent = R.select "withAgent" []
type WithArgOpts = { description :: Maybe String , defaultValue :: Maybe T.JSON , defaultPath :: Maybe String , ignore :: Maybe (Array String) , sourceMap :: Maybe T.SourceMap , deprecated :: Maybe String , defaultAddress :: Maybe String }
defaultWithArgOpts :: WithArgOptsdefaultWithArgOpts = { description: Nothing , defaultValue: Nothing , defaultPath: Nothing , ignore: Nothing , sourceMap: Nothing , deprecated: Nothing , defaultAddress: Nothing }
-- | Returns the function with the provided argumentwithArg :: String -> T.TypeDef -> T.Function -> T.FunctionwithArg argName argTypeDef = withArgWith argName argTypeDef defaultWithArgOpts
-- | Returns the function with the provided argumentwithArgWith :: String -> T.TypeDef -> WithArgOpts -> T.Function -> T.FunctionwithArgWith argName argTypeDef opts = R.select "withArg" [R.argument "name" "String!" argName, R.objectArgument "typeDef" "ID!" argTypeDef, R.optional (R.argument "description" "String") opts.description, R.optional (R.argument "defaultValue" "JSON") opts.defaultValue, R.optional (R.argument "defaultPath" "String") opts.defaultPath, R.optional (R.argument "ignore" "[String!]") opts.ignore, R.optional (R.objectArgument "sourceMap" "ID") opts.sourceMap, R.optional (R.argument "deprecated" "String") opts.deprecated, R.optional (R.argument "defaultAddress" "String") opts.defaultAddress]
type WithCachePolicyOpts = { timeToLive :: Maybe String }
defaultWithCachePolicyOpts :: WithCachePolicyOptsdefaultWithCachePolicyOpts = { timeToLive: Nothing }
-- | Returns the function updated to use the provided cache policy.withCachePolicy :: T.FunctionCachePolicy -> T.Function -> T.FunctionwithCachePolicy argPolicy = withCachePolicyWith argPolicy defaultWithCachePolicyOpts
-- | Returns the function updated to use the provided cache policy.withCachePolicyWith :: T.FunctionCachePolicy -> WithCachePolicyOpts -> T.Function -> T.FunctionwithCachePolicyWith argPolicy opts = R.select "withCachePolicy" [R.argument "policy" "FunctionCachePolicy!" argPolicy, R.optional (R.argument "timeToLive" "String") opts.timeToLive]
-- | Returns the function with a flag indicating it's a check.withCheck :: T.Function -> T.FunctionwithCheck = R.select "withCheck" []
type WithDeprecatedOpts = { reason :: Maybe String }
defaultWithDeprecatedOpts :: WithDeprecatedOptsdefaultWithDeprecatedOpts = { reason: Nothing }
-- | Returns the function with the provided deprecation reason.withDeprecated :: T.Function -> T.FunctionwithDeprecated = withDeprecatedWith defaultWithDeprecatedOpts
-- | Returns the function with the provided deprecation reason.withDeprecatedWith :: WithDeprecatedOpts -> T.Function -> T.FunctionwithDeprecatedWith opts = R.select "withDeprecated" [R.optional (R.argument "reason" "String") opts.reason]
-- | Returns the function with the given doc string.withDescription :: String -> T.Function -> T.FunctionwithDescription argDescription = R.select "withDescription" [R.argument "description" "String!" argDescription]
-- | Returns the function with a flag indicating it's a generator.withGenerator :: T.Function -> T.FunctionwithGenerator = R.select "withGenerator" []
-- | Returns the function with the given source map.withSourceMap :: T.SourceMap -> T.Function -> T.FunctionwithSourceMap argSourceMap = R.select "withSourceMap" [R.objectArgument "sourceMap" "ID!" argSourceMap]
-- | Returns the function with a flag indicating it returns a service for dagger up.withUp :: T.Function -> T.FunctionwithUp = R.select "withUp" []