Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ bandwidth/models/rbm_message_content_file.py
bandwidth/models/rbm_message_content_rich_card.py
bandwidth/models/rbm_message_content_text.py
bandwidth/models/rbm_message_media.py
bandwidth/models/rbm_open_url_enum.py
bandwidth/models/rbm_standalone_card.py
bandwidth/models/rbm_suggestion_response.py
bandwidth/models/rbm_web_view_enum.py
bandwidth/models/recording_available_callback.py
bandwidth/models/recording_complete_callback.py
bandwidth/models/recording_state_enum.py
Expand Down Expand Up @@ -328,8 +330,10 @@ docs/RbmMessageContentFile.md
docs/RbmMessageContentRichCard.md
docs/RbmMessageContentText.md
docs/RbmMessageMedia.md
docs/RbmOpenUrlEnum.md
docs/RbmStandaloneCard.md
docs/RbmSuggestionResponse.md
docs/RbmWebViewEnum.md
docs/RecordingAvailableCallback.md
docs/RecordingCompleteCallback.md
docs/RecordingStateEnum.md
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ Class | Method | HTTP request | Description
- [RbmMessageContentRichCard](docs/RbmMessageContentRichCard.md)
- [RbmMessageContentText](docs/RbmMessageContentText.md)
- [RbmMessageMedia](docs/RbmMessageMedia.md)
- [RbmOpenUrlEnum](docs/RbmOpenUrlEnum.md)
- [RbmStandaloneCard](docs/RbmStandaloneCard.md)
- [RbmSuggestionResponse](docs/RbmSuggestionResponse.md)
- [RbmWebViewEnum](docs/RbmWebViewEnum.md)
- [RecordingAvailableCallback](docs/RecordingAvailableCallback.md)
- [RecordingCompleteCallback](docs/RecordingCompleteCallback.md)
- [RecordingStateEnum](docs/RecordingStateEnum.md)
Expand Down
35 changes: 34 additions & 1 deletion bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ info:
email: letstalk@bandwidth.com
version: 1.0.0
security:
- OAuth2: []
- Basic: []
- OAuth2: []
tags:
- name: Messages
- name: Media
Expand Down Expand Up @@ -2378,6 +2378,35 @@ components:
- OPEN_URL
- REQUEST_LOCATION
example: REPLY
rbmOpenUrlEnum:
type: string
description: >-
Specifies how the URL should be opened on a mobile device.

- `BROWSER` Opens the URL in the device's default browser. If
application is not set or the device doesn’t support WebView, this
option is used by default.

- `WEBVIEW` Opens the URL in an in-app WebView.
enum:
- BROWSER
- WEBVIEW
example: WEBVIEW
rbmWebViewEnum:
type: string
description: >-
Defines the layout of the WebView on a mobile device. It must be defined
when application is set to `WEBVIEW`

- `FULL` WebView takes the full screen.

- `HALF` WebView takes half of the screen.

- `TALL` WebView takes three-quarters of the screen.
enum:
- FULL
- HALF
- TALL
rbmActionText:
title: Text
type: string
Expand Down Expand Up @@ -2482,6 +2511,10 @@ components:
description: The URL to open in browser.
example: https://dev.bandwidth.com
maxLength: 2048
application:
$ref: '#/components/schemas/rbmOpenUrlEnum'
webviewViewMode:
$ref: '#/components/schemas/rbmWebViewEnum'
required:
- url
multiChannelFullActions:
Expand Down
4 changes: 4 additions & 0 deletions bandwidth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@
"RbmMessageContentRichCard",
"RbmMessageContentText",
"RbmMessageMedia",
"RbmOpenUrlEnum",
"RbmStandaloneCard",
"RbmSuggestionResponse",
"RbmWebViewEnum",
"RecordingAvailableCallback",
"RecordingCompleteCallback",
"RecordingStateEnum",
Expand Down Expand Up @@ -366,8 +368,10 @@
from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard as RbmMessageContentRichCard
from bandwidth.models.rbm_message_content_text import RbmMessageContentText as RbmMessageContentText
from bandwidth.models.rbm_message_media import RbmMessageMedia as RbmMessageMedia
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum as RbmOpenUrlEnum
from bandwidth.models.rbm_standalone_card import RbmStandaloneCard as RbmStandaloneCard
from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse as RbmSuggestionResponse
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum as RbmWebViewEnum
from bandwidth.models.recording_available_callback import RecordingAvailableCallback as RecordingAvailableCallback
from bandwidth.models.recording_complete_callback import RecordingCompleteCallback as RecordingCompleteCallback
from bandwidth.models.recording_state_enum import RecordingStateEnum as RecordingStateEnum
Expand Down
2 changes: 2 additions & 0 deletions bandwidth/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@
from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard
from bandwidth.models.rbm_message_content_text import RbmMessageContentText
from bandwidth.models.rbm_message_media import RbmMessageMedia
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum
from bandwidth.models.rbm_standalone_card import RbmStandaloneCard
from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum
from bandwidth.models.recording_available_callback import RecordingAvailableCallback
from bandwidth.models.recording_complete_callback import RecordingCompleteCallback
from bandwidth.models.recording_state_enum import RecordingStateEnum
Expand Down
12 changes: 9 additions & 3 deletions bandwidth/models/rbm_action_open_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import json

from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Union
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -33,8 +35,10 @@ class RbmActionOpenUrl(BaseModel):
text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click")
postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser.")
application: Optional[RbmOpenUrlEnum] = None
webview_view_mode: Optional[RbmWebViewEnum] = Field(default=None, alias="webviewViewMode")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "text", "postbackData", "url"]
__properties: ClassVar[List[str]] = ["type", "text", "postbackData", "url", "application", "webviewViewMode"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -97,7 +101,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"type": obj.get("type"),
"text": obj.get("text"),
"postbackData": obj.get("postbackData"),
"url": obj.get("url")
"url": obj.get("url"),
"application": obj.get("application"),
"webviewViewMode": obj.get("webviewViewMode")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
38 changes: 38 additions & 0 deletions bandwidth/models/rbm_open_url_enum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding: utf-8

"""
Bandwidth

Bandwidth's Communication APIs

The version of the OpenAPI document: 1.0.0
Contact: letstalk@bandwidth.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class RbmOpenUrlEnum(str, Enum):
"""
Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView.
"""

"""
allowed enum values
"""
BROWSER = 'BROWSER'
WEBVIEW = 'WEBVIEW'

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of RbmOpenUrlEnum from a JSON string"""
return cls(json.loads(json_str))


39 changes: 39 additions & 0 deletions bandwidth/models/rbm_web_view_enum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding: utf-8

"""
Bandwidth

Bandwidth's Communication APIs

The version of the OpenAPI document: 1.0.0
Contact: letstalk@bandwidth.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class RbmWebViewEnum(str, Enum):
"""
Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen.
"""

"""
allowed enum values
"""
FULL = 'FULL'
HALF = 'HALF'
TALL = 'TALL'

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of RbmWebViewEnum from a JSON string"""
return cls(json.loads(json_str))


1 change: 0 additions & 1 deletion custom_templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ conf = {{{packageName}}}.Configuration(
if self.temp_access_token and self.temp_access_token_expiration > now + 60:
return self.temp_access_token
else:
print("Fetching new access token")
_bytes = f"{self.client_id}:{self.client_secret}".encode('utf-8')
_encoded_string = base64.b64encode(_bytes).decode('utf-8')
auth_header = f"Basic {_encoded_string}"
Expand Down
2 changes: 2 additions & 0 deletions docs/MultiChannelAction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Name | Type | Description | Notes
**end_time** | **datetime** | The end time of the event. |
**description** | **str** | The description of the event. | [optional]
**url** | **str** | The URL to open in browser. |
**application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional]
**webview_view_mode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional]

## Example

Expand Down
2 changes: 2 additions & 0 deletions docs/RbmActionOpenUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Name | Type | Description | Notes
**text** | **str** | Displayed text for user to click |
**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. |
**url** | **str** | The URL to open in browser. |
**application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional]
**webview_view_mode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional]

## Example

Expand Down
13 changes: 13 additions & 0 deletions docs/RbmOpenUrlEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# RbmOpenUrlEnum

Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView.

## Enum

* `BROWSER` (value: `'BROWSER'`)

* `WEBVIEW` (value: `'WEBVIEW'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


15 changes: 15 additions & 0 deletions docs/RbmWebViewEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# RbmWebViewEnum

Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen.

## Enum

* `FULL` (value: `'FULL'`)

* `HALF` (value: `'HALF'`)

* `TALL` (value: `'TALL'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 9 additions & 2 deletions test/unit/models/test_rbm_action_open_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import unittest

from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl
from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum

class TestRbmActionOpenUrl(unittest.TestCase):
"""RbmActionOpenUrl unit test stubs"""
Expand All @@ -33,10 +36,12 @@ def make_instance(self, include_optional) -> RbmActionOpenUrl:
optional params are included """
if include_optional:
return RbmActionOpenUrl(
type = 'REPLY',
type = RbmActionTypeEnum.REPLY,
text = 'Hello world',
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
url = 'https://dev.bandwidth.com'
url = 'https://dev.bandwidth.com',
application=RbmOpenUrlEnum.BROWSER,
webview_view_mode=RbmWebViewEnum.FULL,
)
else:
return RbmActionOpenUrl(
Expand All @@ -55,6 +60,8 @@ def testRbmActionOpenUrl(self):
assert instance.text == 'Hello world'
assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
assert instance.url == 'https://dev.bandwidth.com'
assert instance.application == 'BROWSER'
assert instance.webview_view_mode == 'FULL'

if __name__ == '__main__':
unittest.main()
35 changes: 35 additions & 0 deletions test/unit/models/test_rbm_open_url_enum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding: utf-8

"""
Bandwidth

Bandwidth's Communication APIs

The version of the OpenAPI document: 1.0.0
Contact: letstalk@bandwidth.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


import unittest

from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum

class TestRbmOpenUrlEnum(unittest.TestCase):
"""RbmOpenUrlEnum unit test stubs"""

def setUp(self):
pass

def tearDown(self):
pass

def testRbmOpenUrlEnum(self):
"""Test RbmOpenUrlEnum"""
assert RbmOpenUrlEnum('BROWSER') == 'BROWSER'
assert RbmOpenUrlEnum('WEBVIEW') == 'WEBVIEW'

if __name__ == '__main__':
unittest.main()
Loading