ConvertTo NotionObject - fasteiner/Notion GitHub Wiki


Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/update-property-schema-object schema: 2.0.0 Type: Command

ConvertTo-NotionObject

SYNOPSIS

Converts an object to a TypeScript Notion object.

SYNTAX

ConvertTo-NotionObject [-InputObject] <Object> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This function takes an object and converts it to a TypeScript Notion object.

EXAMPLES

EXAMPLE 1

$object = @{ object = "block"; type = "code" }
$convertedObject = ConvertTo-NotionObject -Object $object

Returns an block object of type "code".

EXAMPLE 2

$object = @{ object = "list"; results = @(@{ object = "block"; type = "paragraph" }, @{ object = "block"; type = "heading_1" }) }
$object | ConvertTo-NotionObject

Returns a list object with two block objects of type "paragraph" and "heading_1".

EXAMPLE 3

$object = @{ object = "block"; type = "bookmark" }
ConvertTo-NotionObject -InputObject $object

Returns a block object of type "bookmark".

PARAMETERS

-InputObject

The object to be converted.

Type: Object
Parameter Sets: (All)
Aliases: Object

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

The converted Notion object.

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️