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
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model):
:param is_staging: Indicates if the staging slot should be used, instead
of the Production one. Default value: False .
:type is_staging: bool
:param region: The target region that the application is published to.
:type region: str
"""

_attribute_map = {
'version_id': {'key': 'versionId', 'type': 'str'},
'is_staging': {'key': 'isStaging', 'type': 'bool'},
'region': {'key': 'region', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ApplicationPublishObject, self).__init__(**kwargs)
self.version_id = kwargs.get('version_id', None)
self.is_staging = kwargs.get('is_staging', False)
self.region = kwargs.get('region', None)
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model):
:param is_staging: Indicates if the staging slot should be used, instead
of the Production one. Default value: False .
:type is_staging: bool
:param region: The target region that the application is published to.
:type region: str
"""

_attribute_map = {
'version_id': {'key': 'versionId', 'type': 'str'},
'is_staging': {'key': 'isStaging', 'type': 'bool'},
'region': {'key': 'region', 'type': 'str'},
}

def __init__(self, *, version_id: str=None, is_staging: bool=False, region: str=None, **kwargs) -> None:
def __init__(self, *, version_id: str=None, is_staging: bool=False, **kwargs) -> None:
super(ApplicationPublishObject, self).__init__(**kwargs)
self.version_id = version_id
self.is_staging = is_staging
self.region = region
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,16 @@ def delete(
delete.metadata = {'url': '/apps/{appId}'}

def publish(
self, app_id, application_publish_object, custom_headers=None, raw=False, **operation_config):
self, app_id, version_id=None, is_staging=False, custom_headers=None, raw=False, **operation_config):
"""Publishes a specific version of the application.

:param app_id: The application ID.
:type app_id: str
:param application_publish_object: The application publish object. The
region is the target region that the application is published to.
:type application_publish_object:
~azure.cognitiveservices.language.luis.authoring.models.ApplicationPublishObject
:param version_id: The version ID to publish.
:type version_id: str
:param is_staging: Indicates if the staging slot should be used,
instead of the Production one.
:type is_staging: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -668,6 +669,8 @@ def publish(
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
application_publish_object = models.ApplicationPublishObject(version_id=version_id, is_staging=is_staging)

# Construct URL
url = self.publish.metadata['url']
path_format_arguments = {
Expand Down