Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WebexCommunity/WebexPythonSDK
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.1
Choose a base ref
...
head repository: WebexCommunity/WebexPythonSDK
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Aug 9, 2024

  1. Copy the full SHA
    8105311 View commit details
  2. Copy the full SHA
    4656bcb View commit details

Commits on Aug 27, 2024

  1. feat(Messages): Change message editing method to update() (#241)

    Reopening and updating for @zhenyamorozov. Replaces #222 
    
    Tested locally and passing
    adamweeks authored Aug 27, 2024
    Copy the full SHA
    470225f View commit details
  2. Update contributing.rst

    adamweeks authored Aug 27, 2024
    Copy the full SHA
    c0cc333 View commit details
  3. docs(Contributing): add sandbox test acct details (#240)

    Added a bit more guidance on how to run the integration tests locally.
    adamweeks authored Aug 27, 2024
    Copy the full SHA
    5d29998 View commit details

Commits on Sep 1, 2024

  1. Remove Adaptive Card Version 1.1

    Remove Adaptive Card Version 1.1 codes as some code refactoring is done to make way for Adaptive Card version 1.3
    Sakthivel Ramasamy (sakthram) committed Sep 1, 2024
    Copy the full SHA
    605bc7d View commit details

Commits on Sep 2, 2024

  1. Migrate to Adaptive Card 1.3 Version

    Code changes commit for webexpythonsdk's Adaptive Card 1.1 to 1.3 version upgrade
    Sakthivel Ramasamy (sakthram) committed Sep 2, 2024
    Copy the full SHA
    9d25de7 View commit details

Commits on Sep 7, 2024

  1. Correct minor non-service impacting cosmetic issues

    Sakthivel Ramasamy (sakthram) committed Sep 7, 2024
    Copy the full SHA
    3148e5a View commit details

Commits on Oct 28, 2024

  1. Correct error messages

    Sakthivel Ramasamy (sakthram) committed Oct 28, 2024
    Copy the full SHA
    ad65a86 View commit details
  2. Migrate to Adaptive Card 1.3 Version (#243)

    Code changes commit for webexpythonsdk's Adaptive Card 1.1 to 1.3
    version upgrade. Changes involve code files restructuring inline with
    Adaptive Card's official documentation
    (https://adaptivecards.io/explorer/).
    Joezanini authored Oct 28, 2024
    Copy the full SHA
    4a556eb View commit details

Commits on Nov 2, 2024

  1. fix(test): mark test_get_room_meeting_info as expected to fail

    The API is not returning the correct/expected response. The API is returning a `200 OK` response with an empty JSON body `{}`.
    cmlccie committed Nov 2, 2024
    Copy the full SHA
    36f0f3a View commit details
  2. Mark test_get_room_meeting_info Expected Fail (#245)

    The API is not returning the correct/expected response. The API is
    returning a `200 OK` response with an empty JSON body `{}`.
    cmlccie authored Nov 2, 2024
    Copy the full SHA
    39901e5 View commit details
  3. Copy the full SHA
    ea3916f View commit details
  4. Copy the full SHA
    1e13d2e View commit details

Commits on Nov 8, 2024

  1. Add additional properties to Room and fix missing arguments in rooms …

    …API (#246)
    
    This pull request includes two commits; these changes enhance the
    functionality and completeness of the Room class and ensure that the
    rooms API works correctly.
    
    The first commit adds additional properties to the Room class, including
    `classificationId`, `isAnnouncementOnly`, `isReadOnly`, `isPublic`,
    `madePublic`, and `description`.
    
    The second commit fixes missing arguments in the rooms API by adding the
    create room args to the `post_data`.
    
    Fixes #244
    Joezanini authored Nov 8, 2024
    Copy the full SHA
    e851508 View commit details

Commits on Jan 8, 2025

  1. Remove backslash from f-string

    Remove backslash from f-string to maintain backward compatibility with Python 3.10 and 3.11 versions.
    
    Also, corrected little (very minor non-impacting) cosmetic issues.
    Sakthivel Ramasamy (sakthram) committed Jan 8, 2025
    Copy the full SHA
    9e3acba View commit details

Commits on Jan 9, 2025

  1. Format code

    "make format" runs
    Sakthivel Ramasamy (sakthram) committed Jan 9, 2025
    Copy the full SHA
    03dfb3e View commit details

Commits on Jan 11, 2025

  1. Remove backslash from f-string (Patch for Issue: #247) (#248)

    Remove backslash from f-string to maintain backward compatibility with
    Python 3.10 and 3.11 versions.
    
    Also, corrected little (very minor non-impacting) cosmetic issues.
    
    Patch for Issue: #247
    Joezanini authored Jan 11, 2025
    Copy the full SHA
    99a570d View commit details

Commits on Jan 17, 2025

  1. Copy the full SHA
    2f12231 View commit details
  2. Copy the full SHA
    8d26a00 View commit details

Commits on Apr 2, 2025

  1. updated migration doc and cards doc

    jozanini committed Apr 2, 2025
    Copy the full SHA
    86dc866 View commit details

Commits on Apr 4, 2025

  1. updated migration doc and cards doc (#254)

    Updated documentation per migration issue
    [252](#252)
    ashjorda authored Apr 4, 2025
    Copy the full SHA
    c2decd2 View commit details
6 changes: 5 additions & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -26,7 +26,11 @@ See the project's `Makefile` targets for a list of common developer tasks, which
Notes on the Test Suite
-----------------------

To test all the API endpoints, the account that you use for testing must be an *admin* user for your Webex 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 account (not that you can't; it's just that you probably don't want it cluttering your account with all these test artifacts).
To test all the API endpoints, the account that you use for testing must be an *admin* and *compliance officer* user for your Webex 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 account (not that you can't; it's just that you probably don't want it cluttering your account with all these test artifacts).

Webex now offers a free developer sandbox organization that you can use for testing purposes. You can request the sandbox at https://developer.webex.com/docs/developer-sandbox-guide. Once you have your sandbox organization, you can create a test account with *admin* and *compliance officer* privileges via [Webex Control Hub](https://admin.webex.com) and use that account for testing. (Be sure to login to Control Hub with the new admin so that the roles are assigned properly to the Webex token.)

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.

4 changes: 2 additions & 2 deletions docs/user/cards.rst
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Webex supports `AdaptiveCards <https://www.adaptivecards.io/>`_ to allow
new levels of interactivity for bots and integrations. You can read more about
how cards and buttons work `in the official guide <https://developer.webex.com/docs/api/guides/cards>`_.

In this guide I want to cover the abstraction built into the webexpythonsdk that
In this guide we want to cover the abstraction built into the webexpythonsdk that
lets you author adaptive cards in pure python without having to touch the
underlying JSON of an adaptive card.

@@ -22,7 +22,7 @@ Lets dive into a simple example that sends a card to a room
from webexpythonsdk import WebexAPI
from webexpythonsdk.models.cards.card import AdaptiveCard
from webexpythonsdk.models.cards.inputs import Text, Number
from webexpythonsdk.models.cards.components import TextBlock
from webexpythonsdk.models.cards.card_elements import TextBlock
from webexpythonsdk.models.cards.actions import Submit
greeting = TextBlock("Hey hello there! I am a adaptive card")
82 changes: 79 additions & 3 deletions docs/user/migrate.rst
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Migration

This *should* 🤞 be easy!

``webexpythonsdk`` is designed to be a drop-in replacement for the ``webexteamssdk`` package. The SDK interface and data objects are largely unchanged with only a few minor name changes.
The transition from `webexteamssdk` to `webexpythonsdk` is not entirely a "drop-in replacement" due to substantial changes in class structures and functionalities. This guide aims to clarify these changes and offer solutions to ease the migration process.

Major changes that you should be aware of:

@@ -17,7 +17,6 @@ Major changes that you should be aware of:
* The primary API object has changed from ``WebexTeamsAPI`` to ``WebexAPI``



---------------
Migration Guide
---------------
@@ -39,7 +38,9 @@ The following table summarizes the name changes that need to be made to migrate

*Note:* The old ``WEBEX_TEAMS_ACCESS_TOKEN`` environment variable should continue to work with the new package; however, you will receive a deprecation warning. It is recommended to update the environment variable name to ``WEBEX_ACCESS_TOKEN``.

**Doing a quick search-and-replace in your codebase should be all you need to do to migrate.**


**Doing a quick search-and-replace in your codebase will help when migrating.**

Detailed Steps
--------------
@@ -64,6 +65,80 @@ Detailed Steps

**Primary API Object:** Replace all instances of ``WebexTeamsAPI`` with ``WebexAPI``.

Key Changes For Adaptive Cards
------------------------------

Module and Class Changes
~~~~~~~~~~~~~~~~~~~~~~~~

The following table outlines the changes in module and class names:

.. list-table::
:widths: 25 25 50
:header-rows: 1

* - Old Module/Class
- New Module/Class
- Example Usage
* - `webexteamssdk.models.cards.components.TextBlock`
- `webexpythonsdk.models.cards.card_elements.TextBlock`
- `TextBlock(color=Colors.light)`
* - `webexteamssdk.models.cards.container.ColumnSet`
- `webexpythonsdk.models.cards.containers.ColumnSet`
- `ColumnSet(columns=[Column()])`
* - `webexteamssdk.models.cards.components.Image`
- `webexpythonsdk.models.cards.card_elements.Image`
- `Image(url="https://example.com/image.jpg")`
* - `webexteamssdk.models.cards.components.Choice`
- `webexpythonsdk.models.cards.inputs.Choice`
- `Choice(title="Option", value="option")`
* - `webexteamssdk.models.cards.options.BlockElementHeight`
- `webexpythonsdk.models.cards.options.BlockElementHeight`
- `BlockElementHeight(height="stretch")`
* - New Imports
- `webexpythonsdk.models.cards.actions.OpenUrl`, `Submit`, `ShowCard`
- `OpenUrl(url="https://example.com")`
* - New Imports
- `webexpythonsdk.models.cards.types.BackgroundImage`
- `BackgroundImage(url="https://example.com/image.jpg")`

Enums and Case Sensitivity
~~~~~~~~~~~~~~~~~~~~~~~~~~

Attributes now require specific enums for values, which are case-sensitive. For example:

- **Previous**: `TextBlock.color = "Light"`
- **New**: `TextBlock.color = Colors.light`

Refer to the `Adaptive Cards TextBlock documentation <https://adaptivecards.io/explorer/TextBlock.html>`_ for valid enum values.

Compatibility Solutions
-----------------------

Wrapper Classes
~~~~~~~~~~~~~~~

To facilitate backward compatibility, consider using the following wrapper classes:

.. code-block:: python
# Example wrapper for components.py
from webexpythonsdk.models.cards.card_elements import TextBlock, Image
from webexpythonsdk.models.cards.containers import Column, Fact
# Example wrapper for container.py
from webexpythonsdk.models.cards.containers import Container, ColumnSet, FactSet
Module Flag for Compatibility
-----------------------------

A module flag can be introduced to bypass the `validate_input` function where backward compatibility is needed. Ensure this flag is set before executing legacy code.

.. code-block:: python
# Example usage
webexpythonsdk.enable_backward_compatibility(True)
----------------
For Contributors
----------------
@@ -95,6 +170,7 @@ Project changes that you should be aware of:
+-------------------------------------+-------------------------------+



*Copyright (c) 2016-2024 Cisco and/or its affiliates.*


7 changes: 5 additions & 2 deletions src/webexpythonsdk/api/messages.py
Original file line number Diff line number Diff line change
@@ -357,8 +357,8 @@ def delete(self, messageId):
# API request
self._session.delete(API_ENDPOINT + "/" + messageId)

def edit(self, messageId=None, roomId=None, text=None, markdown=None):
"""Edit a message.
def update(self, messageId=None, roomId=None, text=None, markdown=None):
"""Update (edit) a message.
Args:
messageId(str): The ID of the message to be edit.
@@ -391,3 +391,6 @@ def edit(self, messageId=None, roomId=None, text=None, markdown=None):

# Return a message object created from the response JSON data
return self._object_factory(OBJECT_TYPE, json_data)

# Add edit() as an alias to the update() method for backward compatibility
edit = update
5 changes: 5 additions & 0 deletions src/webexpythonsdk/api/rooms.py
Original file line number Diff line number Diff line change
@@ -176,6 +176,11 @@ def create(
request_parameters,
title=title,
teamId=teamId,
classificationId=classificationId,
isLocked=isLocked,
isPublic=isPublic,
description=description,
isAnnouncementOnly=isAnnouncementOnly,
)

# API request
66 changes: 49 additions & 17 deletions src/webexpythonsdk/models/cards/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Webex Adaptive Cards data models.
"""Webex Adaptive Card - Init File.
Copyright (c) 2016-2024 Cisco and/or its affiliates.
@@ -21,30 +21,62 @@
SOFTWARE.
"""

from .adaptive_card_component import AdaptiveCardComponent
from .card import AdaptiveCard
from .components import (
Choice,
Column,
Fact,
from webexpythonsdk.models.cards.adaptive_card_component import (
AdaptiveCardComponent,
)
from webexpythonsdk.models.cards.cards import AdaptiveCard
from webexpythonsdk.models.cards.card_elements import (
TextBlock,
Image,
Media,
MediaSource,
TextBlock,
RichTextBlock,
TextRun,
)
from .container import ColumnSet, Container, FactSet, ImageSet
from .inputs import Choices, Date, Number, Text, Time, Toggle
from .options import (
BlockElementHeight,
ChoiceInputStyle,
Colors,
ContainerStyle,
from webexpythonsdk.models.cards.containers import (
ActionSet,
Container,
ColumnSet,
Column,
FactSet,
Fact,
ImageSet,
)
from webexpythonsdk.models.cards.actions import (
OpenUrl,
Submit,
ShowCard,
ToggleVisibility,
TargetElement,
)
from webexpythonsdk.models.cards.inputs import (
Text,
Number,
Date,
Time,
Toggle,
ChoiceSet,
Choice,
)
from webexpythonsdk.models.cards.types import (
BackgroundImage,
)
from webexpythonsdk.models.cards.options import (
AbstractOption,
FontSize,
FontType,
FontWeight,
Colors,
BlockElementHeight,
VerticalContentAlignment,
HorizontalAlignment,
Spacing,
ImageSize,
ImageStyle,
Spacing,
ContainerStyle,
TextInputStyle,
VerticalContentAlignment,
ChoiceInputStyle,
ActionStyle,
AssociatedInputs,
ImageFillMode,
)
Loading