Skip to content

Commit

Permalink
✨ Added the Ancestor field on the ContentScheme
Browse files Browse the repository at this point in the history
1. Closes #62
  • Loading branch information
ctreminiom committed Oct 24, 2021
1 parent c4670a7 commit 38345d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions confluence/content.go
Expand Up @@ -60,6 +60,7 @@ type ContentScheme struct {
Body *BodyScheme `json:"body,omitempty"`
Version *VersionScheme `json:"version,omitempty"`
Extensions *ContentExtensionScheme `json:"extensions,omitempty"`
Ancestors []*ContentScheme `json:"ancestors,omitempty"`
}

type ContentExtensionScheme struct {
Expand Down
5 changes: 5 additions & 0 deletions confluence/examples/content/create/create.go
Expand Up @@ -33,6 +33,11 @@ func main() {
Representation: "storage",
},
},
Ancestors: []*confluence.ContentScheme{
{
ID: "78643265",
},
},
}

newConfluence, response, err := instance.Content.Create(context.Background(), payload)
Expand Down
15 changes: 9 additions & 6 deletions confluence/examples/content/get/get.go
Expand Up @@ -7,7 +7,7 @@ import (
"os"
)

func main() {
func main() {

var (
host = os.Getenv("HOST")
Expand All @@ -23,11 +23,10 @@ func main() {
instance.Auth.SetBasicAuth(mail, token)
instance.Auth.SetUserAgent("curl/7.54.0")


var (
contentID = "64290828"
expand = []string{"any"}
version = 1
contentID = "78643301"
expand = []string{"any", "ancestors"}
version = 1
)

content, response, err := instance.Content.Get(context.Background(), contentID, expand, version)
Expand All @@ -40,7 +39,11 @@ func main() {
log.Fatal(err)
}

log.Println("Endpoint:", response.Endpoint)
log.Println("Endpoint:", response.Endpoint)
log.Println("Status Code:", response.Code)
log.Println(content)

for index, ancestors := range content.Ancestors {
log.Println(index, ancestors.Title)
}
}

0 comments on commit 38345d3

Please sign in to comment.