Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.
func chilkatTest() {
let rest = CkoRest()
var success: Bool
// Provide a previously obtained OAuth2 access token.
let oauth2 = CkoOAuth2()
oauth2.AccessToken = "OAUTH2_ACCESS_TOKEN"
rest.SetAuthOAuth2(oauth2)
success = rest.Connect("www.googleapis.com", port: 443, tls: true, autoReconnect: true)
if success != true {
print("\(rest.LastErrorText)")
return
}
rest.AddQueryParam("supportsTeamDrives", value: "true")
let sbResponse = CkoStringBuilder()
success = rest.FullRequestNoBodySb("DELETE", uriPath: "/drive/v3/files/1xx378JF8abx17LXlRt65031J9TQkolQX", sb: sbResponse)
if success != true {
print("\(rest.LastErrorText)")
return
}
if rest.ResponseStatusCode.integerValue != 204 {
print("Received error response code: \(rest.ResponseStatusCode.integerValue)")
print("Response body:")
print("\(sbResponse.GetAsString())")
return
}
print("Example Completed.")
}