Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

API usability notes #11

Open
2 of 5 tasks
mfridman opened this issue Jun 6, 2018 · 0 comments
Open
2 of 5 tasks

API usability notes #11

mfridman opened this issue Jun 6, 2018 · 0 comments

Comments

@mfridman
Copy link
Owner

mfridman commented Jun 6, 2018

This ticket tracks API usability of the various methods.

  • GetFaxOutbox
  • GetFaxInbox

  • DeleteFax

Delete fax (despite what the official docs state) deletes items based on ID only. Currently a user has to pass in a slice of string representing fax job ID's as ID's or filenames. Consider changing the function signature from:
DeleteFax(ids []string, direction string) (*DeleteResp, error)
to
DeleteFax(direction string, id ...int) (*DeleteResp, error)

Pros:

  • easier to read (imo)
  • brings method's signature inline with the rest of the pkg; i.e., using int for ID's instead of string

Cons:

  • may cause confusion to pkg users. SRFax docs specify ability to use filename, sFaxFileName_, or ID, sFaxDetailsID_. But from using their API deletes are only triggered when a valid ID is present. For this reason a string was passed in, to be able to support a mixture of filename and ID's

  • GetMulFaxStatus ... change sig to use int instead of string
  • RetrieveFax ... change sig to use int instead of string
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant