-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for oauth connection management in botservice (#213)
* add support for oauth to botservice cli * minor fixes * fix style warnings * more pylint error fixes * fix flake errors * addressed comments. bumped up version
- Loading branch information
1 parent
db60b07
commit 0093861
Showing
22 changed files
with
1,073 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
__all__ = ['AzureBotService'] | ||
|
||
__version__ = VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/botservice/azext_bot/botservice/models/connection_item_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
|
||
|
||
class ConnectionItemName(Model): | ||
"""The display name of a connection Item Setting registered with the Bot. | ||
Variables are only populated by the server, and will be ignored when | ||
sending a request. | ||
:ivar name: Connection Item name that has been added in the API | ||
:vartype name: str | ||
""" | ||
|
||
_validation = { | ||
'name': {'readonly': True}, | ||
} | ||
|
||
_attribute_map = { | ||
'name': {'key': 'name', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self): | ||
self.name = None |
63 changes: 63 additions & 0 deletions
63
src/botservice/azext_bot/botservice/models/connection_setting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from .resource import Resource | ||
|
||
|
||
class ConnectionSetting(Resource): | ||
"""Bot channel resource definition. | ||
Variables are only populated by the server, and will be ignored when | ||
sending a request. | ||
:ivar id: Specifies the resource ID. | ||
:vartype id: str | ||
:ivar name: Specifies the name of the resource. | ||
:vartype name: str | ||
:param location: Specifies the location of the resource. | ||
:type location: str | ||
:ivar type: Specifies the type of the resource. | ||
:vartype type: str | ||
:param tags: Contains resource tags defined as key/value pairs. | ||
:type tags: dict[str, str] | ||
:param sku: Gets or sets the SKU of the resource. | ||
:type sku: ~azure.mgmt.botservice.models.Sku | ||
:param kind: Required. Gets or sets the Kind of the resource. Possible | ||
values include: 'sdk', 'designer', 'bot', 'function' | ||
:type kind: str or ~azure.mgmt.botservice.models.Kind | ||
:param etag: Entity Tag | ||
:type etag: str | ||
:param properties: The set of properties specific to bot channel resource | ||
:type properties: | ||
~azure.mgmt.botservice.models.ConnectionSettingProperties | ||
""" | ||
|
||
_validation = { | ||
'id': {'readonly': True}, | ||
'name': {'readonly': True}, | ||
'type': {'readonly': True}, | ||
} | ||
|
||
_attribute_map = { | ||
'id': {'key': 'id', 'type': 'str'}, | ||
'name': {'key': 'name', 'type': 'str'}, | ||
'location': {'key': 'location', 'type': 'str'}, | ||
'type': {'key': 'type', 'type': 'str'}, | ||
'tags': {'key': 'tags', 'type': '{str}'}, | ||
'sku': {'key': 'sku', 'type': 'Sku'}, | ||
'kind': {'key': 'kind', 'type': 'str'}, | ||
'etag': {'key': 'etag', 'type': 'str'}, | ||
'properties': {'key': 'properties', 'type': 'ConnectionSettingProperties'}, | ||
} | ||
|
||
def __init__(self, location=None, tags=None, sku=None, kind=None, etag=None, properties=None): | ||
super(ConnectionSetting, self).__init__(location=location, tags=tags, sku=sku, kind=kind, etag=etag) | ||
self.properties = properties |
27 changes: 27 additions & 0 deletions
27
src/botservice/azext_bot/botservice/models/connection_setting_paged.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.paging import Paged | ||
|
||
|
||
class ConnectionSettingPaged(Paged): | ||
""" | ||
A paging container for iterating over a list of :class:`ConnectionSetting <azure.mgmt.botservice.models.ConnectionSetting>` object | ||
""" | ||
|
||
_attribute_map = { | ||
'next_link': {'key': 'nextLink', 'type': 'str'}, | ||
'current_page': {'key': 'value', 'type': '[ConnectionSetting]'} | ||
} | ||
|
||
def __init__(self, *args, **kwargs): | ||
|
||
super(ConnectionSettingPaged, self).__init__(*args, **kwargs) |
32 changes: 32 additions & 0 deletions
32
src/botservice/azext_bot/botservice/models/connection_setting_parameter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
|
||
|
||
class ConnectionSettingParameter(Model): | ||
"""Extra Parameter in a Connection Setting Properties to indicate service | ||
provider specific properties. | ||
:param key: Key for the Connection Setting Parameter. | ||
:type key: str | ||
:param value: Value associated with the Connection Setting Parameter. | ||
:type value: str | ||
""" | ||
|
||
_attribute_map = { | ||
'key': {'key': 'key', 'type': 'str'}, | ||
'value': {'key': 'value', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self, key=None, value=None): | ||
self.key = key | ||
self.value = value |
63 changes: 63 additions & 0 deletions
63
src/botservice/azext_bot/botservice/models/connection_setting_properties.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
|
||
|
||
class ConnectionSettingProperties(Model): | ||
"""Properties for a Connection Setting Item. | ||
Variables are only populated by the server, and will be ignored when | ||
sending a request. | ||
:param client_id: Client Id associated with the Connection Setting. | ||
:type client_id: str | ||
:ivar setting_id: Setting Id set by the service for the Connection | ||
Setting. | ||
:vartype setting_id: str | ||
:param client_secret: Client Secret associated with the Connection Setting | ||
:type client_secret: str | ||
:param scopes: Scopes associated with the Connection Setting | ||
:type scopes: str | ||
:param service_provider_id: Service Provider Id associated with the | ||
Connection Setting | ||
:type service_provider_id: str | ||
:param service_provider_display_name: Service Provider Display Name | ||
associated with the Connection Setting | ||
:type service_provider_display_name: str | ||
:param parameters: Service Provider Parameters associated with the | ||
Connection Setting | ||
:type parameters: | ||
list[~azure.mgmt.botservice.models.ConnectionSettingParameter] | ||
""" | ||
|
||
_validation = { | ||
'setting_id': {'readonly': True}, | ||
} | ||
|
||
_attribute_map = { | ||
'client_id': {'key': 'clientId', 'type': 'str'}, | ||
'setting_id': {'key': 'settingId', 'type': 'str'}, | ||
'client_secret': {'key': 'clientSecret', 'type': 'str'}, | ||
'scopes': {'key': 'scopes', 'type': 'str'}, | ||
'service_provider_id': {'key': 'serviceProviderId', 'type': 'str'}, | ||
'service_provider_display_name': {'key': 'serviceProviderDisplayName', 'type': 'str'}, | ||
'parameters': {'key': 'parameters', 'type': '[ConnectionSettingParameter]'}, | ||
} | ||
|
||
def __init__(self, client_id=None, client_secret=None, scopes=None, service_provider_id=None, service_provider_display_name=None, parameters=None): | ||
self.client_id = client_id | ||
self.setting_id = None | ||
self.client_secret = client_secret | ||
self.scopes = scopes | ||
self.service_provider_id = service_provider_id | ||
self.service_provider_display_name = service_provider_display_name | ||
self.parameters = parameters |
27 changes: 27 additions & 0 deletions
27
src/botservice/azext_bot/botservice/models/service_provider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
|
||
|
||
class ServiceProvider(Model): | ||
"""Service Provider Definition. | ||
:param properties: The Properties of a Service Provider Object | ||
:type properties: ~azure.mgmt.botservice.models.ServiceProviderProperties | ||
""" | ||
|
||
_attribute_map = { | ||
'properties': {'key': 'properties', 'type': 'ServiceProviderProperties'}, | ||
} | ||
|
||
def __init__(self, properties=None): | ||
self.properties = properties |
Oops, something went wrong.