I'm trying to add a footer to my docs in Go. Here is my code.
createFooterReq := &docs.Request{
CreateFooter: &docs.CreateFooterRequest{
SectionBreakLocation: &docs.Location{},
Type: "DEFAULT_FOOTER",
},
}
// Insert text into the footer
footerText := "This is a footer added with Go"
insertTextReq := &docs.Request{
InsertText: &docs.InsertTextRequest{
Text: footerText,
EndOfSegmentLocation: &docs.EndOfSegmentLocation{
SegmentId: "",
},
},
}
But in the editor (I use vscode) there is no error but when I try to run, this error comes.
Error 400: Invalid value at 'requests[0].create_footer.type' (type.googleapis.com/google.apps.docs.v1.HeaderFooterType), "DEFAULT_FOOTER"Details:[{"@type": "type.googleapis.com/google.rpc.BadRequest","fieldViolations": [{"description": "Invalid value at 'requests[0].create_footer.type' (type.googleapis.com/google.apps.docs.v1.HeaderFooterType), "DEFAULT_FOOTER"","field": "requests[0].create_footer.type"}]}], invalidexit status 1