Skip to content

Commit

Permalink
add delete custom object record API
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloromolini committed Sep 29, 2023
1 parent 1a23c1a commit bedd24d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions zendesk/custom_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type CustomObjectAPI interface {
targetType string,
opts *PageOptions,
) ([]CustomObjectRecord, Page, error)
DeleteCustomObjectRecord(
ctx context.Context,
record CustomObjectRecord,
) error
}

// CustomObjectAutocompleteOptions custom object search options
Expand Down Expand Up @@ -253,3 +257,17 @@ func (z *Client) GetSourcesByTarget(
}
return result.CustomObjectRecords, result.Page, nil
}

// DeleteCustomObjectRecord Delete a custom object record
// https://developer.zendesk.com/api-reference/custom-data/custom-objects/custom_object_records/#delete-custom-object-record
func (z *Client) DeleteCustomObjectRecord(
ctx context.Context,
record CustomObjectRecord,
) error {
endpointURL := fmt.Sprintf("/custom_objects/%s/records/%s", record.CustomObjectKey, record.ID)
err := z.delete(ctx, endpointURL)
if err != nil {
return err
}
return nil
}
14 changes: 14 additions & 0 deletions zendesk/mock/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bedd24d

Please sign in to comment.