Skip to content

Commit 1c7f31d

Browse files
authored
Merge branch 'master' into feature/adaptive_cards
2 parents c1271e7 + 1bfcdae commit 1c7f31d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1692
-542
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
"e1839a8" = {editable = true, path = "."}
7+
webexteamssdk = {editable = true,path = "."}
88

99
[dev-packages]
1010
versioneer = "*"

Pipfile.lock

Lines changed: 168 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ webexteamssdk
77
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
88
:target: https://github.com/CiscoDevNet/webexteamssdk/blob/master/LICENSE
99
.. image:: https://img.shields.io/pypi/v/webexteamssdk.svg
10-
:target: https://pypi.python.org/pypi/webexteamssdk
10+
:target: https://pypi.org/project/webexteamssdk/
11+
.. image:: https://img.shields.io/pypi/dw/webexteamssdk.svg
12+
:target: https://pypi.org/project/webexteamssdk/
1113
.. image:: https://travis-ci.org/CiscoDevNet/webexteamssdk.svg?branch=master
1214
:target: https://travis-ci.org/CiscoDevNet/webexteamssdk
1315
.. image:: https://readthedocs.org/projects/webexteamssdk/badge/?version=latest
@@ -16,9 +18,9 @@ webexteamssdk
1618
-------------------------------------------------------------------------------
1719

1820

19-
Looking for **``ciscosparkapi``**? You are in the right place. ``ciscosparkapi`` is now ``webexteamssdk``! It still has all of the native and natural Webex Teams Python functionality that you love and now we have made room for even more functionality to be added in the future.
21+
Looking for ``ciscosparkapi``? You are in the right place. ``ciscosparkapi`` is now ``webexteamssdk``! It still has all of the native and natural Webex Teams Python functionality that you love and now we have made room for even more functionality to be added in the future.
2022

21-
We will maintain the ``ciscosparkapi`` package (bug fixes, etc.) in the `ciscosparkapi`_ branch of this repository and continue to publish package updates with these fixes to PyPI (through the;nd of 2019). Maintaining the ``ciscosparkapi`` package should keep your code and projects up and running while giving you 12+ months to migrate your code to the new ``webexteamssdk`` library.
23+
We will maintain the ``ciscosparkapi`` package (bug fixes, etc.) in the `ciscosparkapi`_ branch of this repository and continue to publish package updates with these fixes to PyPI (through the end of 2019). Maintaining the ``ciscosparkapi`` package should keep your code and projects up and running while giving you 12+ months to migrate your code to the new ``webexteamssdk`` library.
2224

2325
*Migration Note:* Migrating should be easy. The ``WebexTeamsAPI`` class and the Python objects returned by the API calls are nearly identical to their ``CiscoSparkAPI`` predecessors. Does the word "nearly" scare you? Here are some specifics:
2426

docs/contributing.rst

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ Notes on the Test Suite
3131

3232
To test all the API endpoints, the account that you use for testing must be an *admin* user for your Webex Teams Organization. Additionally, you should know that that the testing process creates some test people, rooms, messages, teams, and etc. as part of executing the test suite. We strongly recommend *NOT* running the test suite using your personal Webex Teams account (not that you can't; it's just that you probably don't want it cluttering your account with all these test artifacts).
3333

34-
If you cannot create a test account with *admin* privileges or configure your environment to run the test suite locally, you may always submit your code via a pull request. Our GitHub/Travis CI setup runs the test suite against all pull requests. All tests must pass before your pull request is accepted.
34+
If you cannot create a test account with *admin* privileges or configure your environment to run the test suite locally, you may always submit your code via a pull request. We will test your code before merging and releasing the changes.
3535

3636

37-
Contributing Code - Using the CI Automated Testing
38-
--------------------------------------------------
37+
Contributing Code
38+
-----------------
3939

4040
1. Check for open `issues`_ or create a new *issue* for the item you want to work on and make sure to comment and let us know that you are working on it.
4141

@@ -57,54 +57,33 @@ Contributing Code - Using the CI Automated Testing
5757

5858
7. Commit your changes.
5959

60-
8. Submit a `pull request`_. The GitHub/Travis CI system runs the test suite against your pull request code. If any tests fail, please review your changes. If everything looks good, we will gladly merge your request!
61-
62-
63-
Contributing Code - Running the Test Suite Locally
64-
--------------------------------------------------
65-
66-
1. Check for open `issues`_ or create a new 'issue' for the item you want to work on and make sure to comment and let us know that you are working on it.
67-
68-
2. Fork a copy of the `repository`_ and clone your forked repository to your development environment.
69-
70-
Run ``script/setup`` to install the development dependencies and setup your environment.
71-
72-
3. Configure the following environment variables in your development environment:
60+
8. Submit a `pull request`_.
7361

74-
* ``WEBEX_TEAMS_ACCESS_TOKEN`` - Your test account's Webex Teams access token.
75-
76-
* ``WEBEX_TEAMS_TEST_DOMAIN`` - The test suite creates some users as part of the testing process. The test suite uses this domain name as the e-mail suffix of for the user's e-mail addresses.
77-
78-
* ``WEBEX_TEAMS_TEST_ID_START`` - The test suite uses this integer as the starting number for creating test user accounts (example: "test42@domain.com").
79-
80-
* ``WEBEX_TEAMS_TEST_FILE_URL`` - Configure this environment variable with a URL referencing a file that can be downloaded and posted to Webex Teams as part of the testing process.
8162

82-
*Example:*
63+
Running the Test Suite Locally
64+
------------------------------
8365

84-
.. code-block:: bash
66+
Configure the following environment variables in your development environment:
8567

86-
#!/usr/bin/env bash
87-
export WEBEX_TEAMS_ACCESS_TOKEN="<test account's access token>"
88-
export WEBEX_TEAMS_TEST_DOMAIN="domain.com"
89-
export WEBEX_TEAMS_TEST_ID_START=42
90-
export WEBEX_TEAMS_TEST_FILE_URL="https://www.webex.com/content/dam/wbx/us/images/dg-integ/teams_icon.png"
68+
* ``WEBEX_TEAMS_ACCESS_TOKEN`` - Your test account's Webex Teams access token.
9169

70+
* ``WEBEX_TEAMS_TEST_DOMAIN`` - The test suite creates some users as part of the testing process. The test suite uses this domain name as the e-mail suffix of for the user's e-mail addresses.
9271

93-
4. Add your code to your forked repository.
72+
* ``WEBEX_TEAMS_TEST_ID_START`` - The test suite uses this integer as the starting number for creating test user accounts (example: "test42@domain.com").
9473

95-
If you are creating some new feature or functionality (excellent!), please also write a `test`_ to verify that your code works as expected.
96-
97-
5. We follow `PEP8`_ reasonably strictly for this project. Please make sure your code passes the linter.
98-
99-
Run ``script/test lint`` or simply run ``flake8`` from the project root.
74+
* ``WEBEX_TEAMS_TEST_FILE_URL`` - Configure this environment variable with a URL referencing a file that can be downloaded and posted to Webex Teams as part of the testing process.
10075

101-
6. Commit your changes.
76+
*Example:*
10277

103-
7. Ensure your code passes all of the default tests.
78+
.. code-block:: bash
10479
105-
Run ``script/test`` and ensure all tests execute successfully.
80+
#!/usr/bin/env bash
81+
export WEBEX_TEAMS_ACCESS_TOKEN="<test account's access token>"
82+
export WEBEX_TEAMS_TEST_DOMAIN="domain.com"
83+
export WEBEX_TEAMS_TEST_ID_START=42
84+
export WEBEX_TEAMS_TEST_FILE_URL="https://www.webex.com/content/dam/wbx/us/images/dg-integ/teams_icon.png"
10685
107-
8. Submit a `pull request`_. If everything looks good, we will gladly merge your request!
86+
Ensure your code passes all of the default tests. Run ``script/test`` and ensure all tests execute successfully.
10887

10988

11089
.. _script: https://github.com/CiscoDevNet/webexteamssdk/tree/master/script

docs/user/api.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ roles
102102

103103
.. autoclass:: webexteamssdk.api.roles.RolesAPI()
104104

105-
106105
.. _events:
107106

108107
events
@@ -118,6 +117,12 @@ access_tokens
118117

119118
.. autoclass:: webexteamssdk.api.access_tokens.AccessTokensAPI()
120119

120+
.. _guest_issuer:
121+
122+
guest_issuer
123+
------------
124+
125+
.. autoclass:: webexteamssdk.api.guest_issuer.GuestIssuerAPI()
121126

122127
.. _Webex Teams Data Objects:
123128

@@ -241,7 +246,6 @@ Access Token
241246
.. autoclass:: AccessToken()
242247
:inherited-members:
243248

244-
245249
.. _Exceptions:
246250

247251
Exceptions

docs/user/api_structure_table.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@
5555
| | :ref:`access_tokens` | :meth:`get() <webeteamssdk.api.access_tokens.AccessTokensAPI.get>` |
5656
| | | :meth:`refresh() <webeteamssdk.api.access_tokens.AccessTokensAPI.refresh>` |
5757
+-----------------------+-------------------------+---------------------------------------------------------------------------------+
58+
| | :ref:`guest_issuer` | :meth:`create() <webexteamssdk.api.guest_issuer.create>` |
59+
+-----------------------+-------------------------+---------------------------------------------------------------------------------+

docs/user/quickstart.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,31 @@ object.
134134
>>> chris_api = WebexTeamsAPI(access_token=chris_at)
135135
>>> veronica_api = WebexTeamsAPI(access_token=veronica_at)
136136
137+
If you authenticate a user via a OAuth flow you can also initialize a api object
138+
directly by providing the OAuth information.
139+
140+
.. code-block:: python
141+
142+
>>> from webexteamssdk import WebexTeamsAPI
143+
>>> client_id = "<from oauth>"
144+
>>> client_secret = "<from oauth>"
145+
>>> oauth_code = "<from oauth>"
146+
>>> redirect_uri = "<from oauth>"
147+
>>> api = WebexTeamsAPI(client_id=client_id,
148+
client_secret=client_secret,
149+
oauth_code=oauth_code,
150+
redirect_uri=redirect_uri
151+
)
152+
153+
You can also pass a proxy configuration upon initialization in case you are behind a firewall. See the `requests
154+
documentation on Proxies <https://2.python-requests.org/en/master/user/advanced/#proxies>`_ for details.
155+
156+
.. code-block:: python
157+
158+
>>> from webexteamssdk import WebexTeamsAPI
159+
>>> proxy = {'https': 'http://<proxy_ip>:<proxy_port>'}
160+
>>> api = WebexTeamsAPI(access_token=<your_access_token>, proxies=proxy)
161+
137162
138163
Making API Calls
139164
----------------
@@ -443,6 +468,25 @@ contain all of the returned objects.
443468
>>> rooms_list = list(rooms_iterable)
444469
445470
471+
472+
Extending the API with bound methods
473+
------------------------------------
474+
475+
As the Webex Teams API is developed and features are added, it may be necessary to extend the webexteamssdk to access those features.
476+
Extending the API is simple by binding your own methods to the WebexTeamsAPI connection object. By binding a method, you can
477+
extend functionality and leverage all of the objects and quality of life features of webexteamssdk.
478+
479+
.. code-block:: python
480+
481+
>>> new_method(self, param):
482+
... json_obj = self._session.get('/example/action/' + param)
483+
... return json_obj
484+
485+
>>> api = WebexTeamsAPI()
486+
>>> api.new_method = new_method
487+
>>> output = WebexTeamsAPI.new_method(param)
488+
489+
446490
*Copyright (c) 2016-2019 Cisco and/or its affiliates.*
447491

448492

0 commit comments

Comments
 (0)