Skip to content

Commit

Permalink
Add support for block colors (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstotijn authored Aug 13, 2022
1 parent 1320ab0 commit 51efbea
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type ParagraphBlock struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -134,6 +135,7 @@ type BulletedListItemBlock struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -155,6 +157,7 @@ type NumberedListItemBlock struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -176,6 +179,7 @@ type QuoteBlock struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -197,6 +201,7 @@ type ToggleBlock struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand Down Expand Up @@ -239,6 +244,7 @@ type Heading1Block struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -260,6 +266,7 @@ type Heading2Block struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -281,6 +288,7 @@ type Heading3Block struct {

RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand All @@ -303,6 +311,7 @@ type ToDoBlock struct {
RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Checked *bool `json:"checked,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand Down Expand Up @@ -365,6 +374,7 @@ type CalloutBlock struct {
RichText []RichText `json:"rich_text"`
Children []Block `json:"children,omitempty"`
Icon *Icon `json:"icon,omitempty"`
Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand Down Expand Up @@ -739,6 +749,8 @@ func (b DividerBlock) MarshalJSON() ([]byte, error) {

type TableOfContentsBlock struct {
baseBlock

Color Color `json:"color,omitempty"`
}

// MarshalJSON implements json.Marshaler.
Expand Down

0 comments on commit 51efbea

Please sign in to comment.