Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize a method for providing SOAP and REST headers #5

Closed
StevenMMortimer opened this issue May 26, 2018 · 2 comments
Closed

Generalize a method for providing SOAP and REST headers #5

StevenMMortimer opened this issue May 26, 2018 · 2 comments
Assignees
Labels
enhancement Feature request
Milestone

Comments

@StevenMMortimer
Copy link
Owner

Currently, functions like sf_create and sf_update have API call header options hard-coded into the function definition. For example, all_or_none being the option that "Allows a call to roll back all changes unless all records are processed successfully."

The problem is that there are many more header options for each of these functions that the user may want to take advantage of. We should create a method similar to glm.control() that allows users to freely specify the options in the main function in this case (glm()) or supply it as a list directly to the control argument inside the glm() function.

@StevenMMortimer
Copy link
Owner Author

StevenMMortimer commented May 26, 2018

Steps to do:

  1. Add a control-like argument to each of the functions to allow the specification of the options
  2. Add a glm.control()-like function to the package that is invoked when arguments are not supplied directly to the control argument.
  3. Create method validator function (maybe soap_method_header_validator()?) which checks whether the supplied option is available for the method.
  4. Implement the validator inside the functions to check whether the supplied controls apply to the method. For example, the DuplicateRuleHeader can only be used with sf_create, sf_update, and sf_upsert. So if someone uses it with sf_delete, then a warning should be thrown, saying that the option is ignored.

This should be done for REST headers and SOAP headers.

@StevenMMortimer StevenMMortimer self-assigned this May 26, 2018
@StevenMMortimer StevenMMortimer added the enhancement Feature request label May 26, 2018
@StevenMMortimer StevenMMortimer added this to the 0.1.3 milestone May 26, 2018
@StevenMMortimer
Copy link
Owner Author

Many of the REST headers exist in the SOAP headers as well. It is probably best to create a control-like argument defined as list(...) and have a validator that translates and checks anything that is passed into it based on the api_type if it exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request
Projects
None yet
Development

No branches or pull requests

1 participant