Skip to content

expose() returns a sentinel object, similar in spirit to NULL, that tells the calling function to return its internal data structure. googledrive stores a lot of information about the Drive API, MIME types, etc., internally and then exploits it in helper functions, like drive_mime_type(), drive_fields(), drive_endpoints(), etc. We use these objects to provide nice defaults, check input validity, or lookup something cryptic, like MIME type, based on something friendlier, like a file extension. Pass expose() to such a function if you want to inspect its internal object, in its full glory. This is inspired by the waiver() object in ggplot2.

Usage

expose()

Examples

drive_mime_type(expose())
#> # A tibble: 78 × 5
#>    mime_type                          ext   description human_type default
#>    <chr>                              <chr> <chr>       <chr>      <lgl>  
#>  1 application/epub+zip               NA    NA          NA         NA     
#>  2 application/msword                 doc   NA          doc        TRUE   
#>  3 application/msword                 dot   NA          dot        FALSE  
#>  4 application/pdf                    pdf   NA          pdf        TRUE   
#>  5 application/rtf                    rtf   NA          rtf        TRUE   
#>  6 application/vnd.google-apps.audio  NA    NA          audio      NA     
#>  7 application/vnd.google-apps.docum… NA    Google Docs document   NA     
#>  8 application/vnd.google-apps.drawi… NA    Google Dra… drawing    NA     
#>  9 application/vnd.google-apps.drive… NA    3rd party … drive-sdk  NA     
#> 10 application/vnd.google-apps.file   NA    Google Dri… file       NA     
#> # ℹ 68 more rows
drive_fields(expose())
#> # A tibble: 55 × 2
#>    name                         desc                                      
#>    <chr>                        <chr>                                     
#>  1 appProperties                "A collection of arbitrary key-value pair…
#>  2 capabilities                 "Capabilities the current user has on thi…
#>  3 contentHints                 "Additional information about the content…
#>  4 copyRequiresWriterPermission "Whether the options to copy, print, or d…
#>  5 createdTime                  "The time at which the file was created (…
#>  6 description                  "A short description of the file."        
#>  7 driveId                      "ID of the shared drive the file resides …
#>  8 explicitlyTrashed            "Whether the file has been explicitly tra…
#>  9 exportLinks                  "Links for exporting Google Docs to speci…
#> 10 fileExtension                "The final component of fullFileExtension…
#> # ℹ 45 more rows