File.fromJson constructor

File.fromJson(
  1. Map json_
)

Implementation

File.fromJson(core.Map json_)
    : this(
        alternateLink: json_.containsKey('alternateLink')
            ? json_['alternateLink'] as core.String
            : null,
        appDataContents: json_.containsKey('appDataContents')
            ? json_['appDataContents'] as core.bool
            : null,
        canComment: json_.containsKey('canComment')
            ? json_['canComment'] as core.bool
            : null,
        canReadRevisions: json_.containsKey('canReadRevisions')
            ? json_['canReadRevisions'] as core.bool
            : null,
        capabilities: json_.containsKey('capabilities')
            ? FileCapabilities.fromJson(
                json_['capabilities'] as core.Map<core.String, core.dynamic>)
            : null,
        contentRestrictions: json_.containsKey('contentRestrictions')
            ? (json_['contentRestrictions'] as core.List)
                .map((value) => ContentRestriction.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        copyRequiresWriterPermission:
            json_.containsKey('copyRequiresWriterPermission')
                ? json_['copyRequiresWriterPermission'] as core.bool
                : null,
        copyable: json_.containsKey('copyable')
            ? json_['copyable'] as core.bool
            : null,
        createdDate: json_.containsKey('createdDate')
            ? core.DateTime.parse(json_['createdDate'] as core.String)
            : null,
        defaultOpenWithLink: json_.containsKey('defaultOpenWithLink')
            ? json_['defaultOpenWithLink'] as core.String
            : null,
        description: json_.containsKey('description')
            ? json_['description'] as core.String
            : null,
        downloadUrl: json_.containsKey('downloadUrl')
            ? json_['downloadUrl'] as core.String
            : null,
        driveId: json_.containsKey('driveId')
            ? json_['driveId'] as core.String
            : null,
        editable: json_.containsKey('editable')
            ? json_['editable'] as core.bool
            : null,
        embedLink: json_.containsKey('embedLink')
            ? json_['embedLink'] as core.String
            : null,
        etag: json_.containsKey('etag') ? json_['etag'] as core.String : null,
        explicitlyTrashed: json_.containsKey('explicitlyTrashed')
            ? json_['explicitlyTrashed'] as core.bool
            : null,
        exportLinks: json_.containsKey('exportLinks')
            ? (json_['exportLinks'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        fileExtension: json_.containsKey('fileExtension')
            ? json_['fileExtension'] as core.String
            : null,
        fileSize: json_.containsKey('fileSize')
            ? json_['fileSize'] as core.String
            : null,
        folderColorRgb: json_.containsKey('folderColorRgb')
            ? json_['folderColorRgb'] as core.String
            : null,
        fullFileExtension: json_.containsKey('fullFileExtension')
            ? json_['fullFileExtension'] as core.String
            : null,
        hasAugmentedPermissions: json_.containsKey('hasAugmentedPermissions')
            ? json_['hasAugmentedPermissions'] as core.bool
            : null,
        hasThumbnail: json_.containsKey('hasThumbnail')
            ? json_['hasThumbnail'] as core.bool
            : null,
        headRevisionId: json_.containsKey('headRevisionId')
            ? json_['headRevisionId'] as core.String
            : null,
        iconLink: json_.containsKey('iconLink')
            ? json_['iconLink'] as core.String
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        imageMediaMetadata: json_.containsKey('imageMediaMetadata')
            ? FileImageMediaMetadata.fromJson(json_['imageMediaMetadata']
                as core.Map<core.String, core.dynamic>)
            : null,
        indexableText: json_.containsKey('indexableText')
            ? FileIndexableText.fromJson(
                json_['indexableText'] as core.Map<core.String, core.dynamic>)
            : null,
        isAppAuthorized: json_.containsKey('isAppAuthorized')
            ? json_['isAppAuthorized'] as core.bool
            : null,
        kind: json_.containsKey('kind') ? json_['kind'] as core.String : null,
        labelInfo: json_.containsKey('labelInfo')
            ? FileLabelInfo.fromJson(
                json_['labelInfo'] as core.Map<core.String, core.dynamic>)
            : null,
        labels: json_.containsKey('labels')
            ? FileLabels.fromJson(
                json_['labels'] as core.Map<core.String, core.dynamic>)
            : null,
        lastModifyingUser: json_.containsKey('lastModifyingUser')
            ? User.fromJson(json_['lastModifyingUser']
                as core.Map<core.String, core.dynamic>)
            : null,
        lastModifyingUserName: json_.containsKey('lastModifyingUserName')
            ? json_['lastModifyingUserName'] as core.String
            : null,
        lastViewedByMeDate: json_.containsKey('lastViewedByMeDate')
            ? core.DateTime.parse(json_['lastViewedByMeDate'] as core.String)
            : null,
        linkShareMetadata: json_.containsKey('linkShareMetadata')
            ? FileLinkShareMetadata.fromJson(json_['linkShareMetadata']
                as core.Map<core.String, core.dynamic>)
            : null,
        markedViewedByMeDate: json_.containsKey('markedViewedByMeDate')
            ? core.DateTime.parse(
                json_['markedViewedByMeDate'] as core.String)
            : null,
        md5Checksum: json_.containsKey('md5Checksum')
            ? json_['md5Checksum'] as core.String
            : null,
        mimeType: json_.containsKey('mimeType')
            ? json_['mimeType'] as core.String
            : null,
        modifiedByMeDate: json_.containsKey('modifiedByMeDate')
            ? core.DateTime.parse(json_['modifiedByMeDate'] as core.String)
            : null,
        modifiedDate: json_.containsKey('modifiedDate')
            ? core.DateTime.parse(json_['modifiedDate'] as core.String)
            : null,
        openWithLinks: json_.containsKey('openWithLinks')
            ? (json_['openWithLinks'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        originalFilename: json_.containsKey('originalFilename')
            ? json_['originalFilename'] as core.String
            : null,
        ownedByMe: json_.containsKey('ownedByMe')
            ? json_['ownedByMe'] as core.bool
            : null,
        ownerNames: json_.containsKey('ownerNames')
            ? (json_['ownerNames'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        owners: json_.containsKey('owners')
            ? (json_['owners'] as core.List)
                .map((value) => User.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        parents: json_.containsKey('parents')
            ? (json_['parents'] as core.List)
                .map((value) => ParentReference.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        permissionIds: json_.containsKey('permissionIds')
            ? (json_['permissionIds'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        permissions: json_.containsKey('permissions')
            ? (json_['permissions'] as core.List)
                .map((value) => Permission.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        properties: json_.containsKey('properties')
            ? (json_['properties'] as core.List)
                .map((value) => Property.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        quotaBytesUsed: json_.containsKey('quotaBytesUsed')
            ? json_['quotaBytesUsed'] as core.String
            : null,
        resourceKey: json_.containsKey('resourceKey')
            ? json_['resourceKey'] as core.String
            : null,
        selfLink: json_.containsKey('selfLink')
            ? json_['selfLink'] as core.String
            : null,
        sha1Checksum: json_.containsKey('sha1Checksum')
            ? json_['sha1Checksum'] as core.String
            : null,
        sha256Checksum: json_.containsKey('sha256Checksum')
            ? json_['sha256Checksum'] as core.String
            : null,
        shareable: json_.containsKey('shareable')
            ? json_['shareable'] as core.bool
            : null,
        shared:
            json_.containsKey('shared') ? json_['shared'] as core.bool : null,
        sharedWithMeDate: json_.containsKey('sharedWithMeDate')
            ? core.DateTime.parse(json_['sharedWithMeDate'] as core.String)
            : null,
        sharingUser: json_.containsKey('sharingUser')
            ? User.fromJson(
                json_['sharingUser'] as core.Map<core.String, core.dynamic>)
            : null,
        shortcutDetails: json_.containsKey('shortcutDetails')
            ? FileShortcutDetails.fromJson(json_['shortcutDetails']
                as core.Map<core.String, core.dynamic>)
            : null,
        spaces: json_.containsKey('spaces')
            ? (json_['spaces'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        teamDriveId: json_.containsKey('teamDriveId')
            ? json_['teamDriveId'] as core.String
            : null,
        thumbnail: json_.containsKey('thumbnail')
            ? FileThumbnail.fromJson(
                json_['thumbnail'] as core.Map<core.String, core.dynamic>)
            : null,
        thumbnailLink: json_.containsKey('thumbnailLink')
            ? json_['thumbnailLink'] as core.String
            : null,
        thumbnailVersion: json_.containsKey('thumbnailVersion')
            ? json_['thumbnailVersion'] as core.String
            : null,
        title:
            json_.containsKey('title') ? json_['title'] as core.String : null,
        trashedDate: json_.containsKey('trashedDate')
            ? core.DateTime.parse(json_['trashedDate'] as core.String)
            : null,
        trashingUser: json_.containsKey('trashingUser')
            ? User.fromJson(
                json_['trashingUser'] as core.Map<core.String, core.dynamic>)
            : null,
        userPermission: json_.containsKey('userPermission')
            ? Permission.fromJson(json_['userPermission']
                as core.Map<core.String, core.dynamic>)
            : null,
        version: json_.containsKey('version')
            ? json_['version'] as core.String
            : null,
        videoMediaMetadata: json_.containsKey('videoMediaMetadata')
            ? FileVideoMediaMetadata.fromJson(json_['videoMediaMetadata']
                as core.Map<core.String, core.dynamic>)
            : null,
        webContentLink: json_.containsKey('webContentLink')
            ? json_['webContentLink'] as core.String
            : null,
        webViewLink: json_.containsKey('webViewLink')
            ? json_['webViewLink'] as core.String
            : null,
        writersCanShare: json_.containsKey('writersCanShare')
            ? json_['writersCanShare'] as core.bool
            : null,
      );