@@ -44,11 +44,13 @@ serviceDecl s n = sfun noLoc n [] (UnGuardedRhs rhs) noBinds
44 , str . stripSuffix "/" $ stripPrefix "https://" (s ^. dRootUrl)
44 , str . stripSuffix "/" $ stripPrefix "https://" (s ^. dRootUrl)
47−scopeSig :: Name -> Decl
47+scopeSig :: Name -> Text -> Decl
48−scopeSig n = TypeSig noLoc [n] (TyCon "OAuthScope")
48+scopeSig n v = TypeSig noLoc [n] $
49+ TyApp (TyCon "Proxy") $
50+ TyPromoted $ PromotedList True [PromotedString (Text.unpack v)]
50−scopeDecl :: Name -> Text -> Decl
52+scopeDecl :: Name -> Decl
51−scopeDecl n s = sfun noLoc n [] (UnGuardedRhs (str s)) noBinds
53+scopeDecl n = sfun noLoc n [] (UnGuardedRhs (var "Proxy")) noBinds
53apiAlias :: Name -> [Name] -> Decl
55apiAlias :: Name -> [Name] -> Decl
54apiAlias n ls = TypeDecl noLoc n [] alias
56apiAlias n ls = TypeDecl noLoc n [] alias
@@ -302,6 +304,7 @@ googleRequestDecl :: Global
302googleRequestDecl g n assoc extras p api url fields m pat prec =
304googleRequestDecl g n assoc extras p api url fields m pat prec =
303 InstDecl noLoc Nothing [] [] (unqual "GoogleRequest") [n]
305 InstDecl noLoc Nothing [] [] (unqual "GoogleRequest") [n]
305 , request
308 , request
@@ -338,6 +341,11 @@ googleRequestDecl g n assoc extras p api url fields m pat prec =
338 ps = _mParameters m
341 ps = _mParameters m
339 v = var . fname p
342 v = var . fname p
344+ ss = InsType noLoc (TyApp (TyCon "Ss") (tycon g)) $
345+ TyPromoted (PromotedList True (map scope (_mScopes m)))
347+ scope = PromotedString . Text.unpack
341 fs = delete "alt"
349 fs = delete "alt"
342 . orderParams id (Map.keys (_mParameters m))
350 . orderParams id (Map.keys (_mParameters m))