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

allow sending params in transmission list endpoint #140

Merged
merged 4 commits into from
Mar 7, 2017
Merged

Conversation

rajumsys
Copy link
Contributor

@rajumsys rajumsys commented Mar 2, 2017

Handles #133

@rajumsys
Copy link
Contributor Author

rajumsys commented Mar 2, 2017

Duh! And I noticed it now that the endpoint is deprecated 🏅

@richleland
Copy link
Contributor

I would modify this endpoint (you can keep the work done to date) to do a deprecation warning (docs).

@rajumsys
Copy link
Contributor Author

rajumsys commented Mar 6, 2017

@richleland added the deprecation notice

:returns: list of transmissions
:raises: :exc:`SparkPostAPIException` if API call fails
"""
results = self.request('GET', self.uri)
return results
warnings.warn('deprecated', DeprecationWarning)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would customize the message rather than put in deprecated. For instance we could say it will be removed from the API soon. After looking a little more, you might want to use PendingDeprecationWarning. Curious - what does this look like at the command line for users?

Copy link
Contributor Author

@rajumsys rajumsys Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a giant message initially but seemed too much. something like

This endpoint is deprecated. For details, check https://developers.sparkpost.com/api/transmissions.html#transmissions-list-get

To me it seemed verbose. But if you find this (or modify as you want) helpful, I can put that.

Also the endpoint is already deprecated; so PendingDeprecationWarning may not be correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point on it already being deprecated, let's keep it as DeprecationWarning. Maybe use the URL shortener for that message. Otherwise the message you suggested seems OK to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can shorten; i hope it won't feel creepy to users :).

@@ -2,6 +2,8 @@
import json
import os
import tempfile
import warnings
from mock import patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this below the external libraries. The ordering should follow this format:

  1. Standard library (built-in) imports
  2. Standard library (built-in) froms

line break

  1. External library imports
  2. External library froms

line break

  1. Local imports
  2. Local froms

In each the imports/froms should be in alphabetical order.

@@ -276,7 +277,10 @@ def list(self, **kwargs):
:returns: list of transmissions
:raises: :exc:`SparkPostAPIException` if API call fails
"""
warnings.warn('deprecated', DeprecationWarning)
warn_msg = 'This endpoint is deprecated. For details, '
'check http://bit.ly/2lAKj60.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have our own URL shortener: https://sparkpo.st/mklink.php

@@ -2,6 +2,7 @@
import copy
import json
import warnings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no line break needed here - email is in the standard lib.

@rajumsys rajumsys force-pushed the issue133 branch 2 times, most recently from eddbe00 to 7153d37 Compare March 7, 2017 16:53
@@ -37,6 +37,7 @@ def request(self, method, uri, **kwargs):
'Content-Type': 'application/json',
'Authorization': self.api_key
}
print uri, kwargs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops!

@rajumsys rajumsys merged commit f3d2ec6 into master Mar 7, 2017
@richleland richleland deleted the issue133 branch March 7, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants