Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR automation/resource-manager] Fixing responses for update management swagger #2582

Merged
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 @@ -42,6 +42,7 @@
from .operations.software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations
from .operations.source_control_operations import SourceControlOperations
from .operations.source_control_sync_job_operations import SourceControlSyncJobOperations
from .operations.source_control_sync_job_streams_operations import SourceControlSyncJobStreamsOperations
from .operations.job_operations import JobOperations
from .operations.job_stream_operations import JobStreamOperations
from .operations.agent_registration_information_operations import AgentRegistrationInformationOperations
Expand Down Expand Up @@ -151,6 +152,8 @@ class AutomationClient(object):
:vartype source_control: azure.mgmt.automation.operations.SourceControlOperations
:ivar source_control_sync_job: SourceControlSyncJob operations
:vartype source_control_sync_job: azure.mgmt.automation.operations.SourceControlSyncJobOperations
:ivar source_control_sync_job_streams: SourceControlSyncJobStreams operations
:vartype source_control_sync_job_streams: azure.mgmt.automation.operations.SourceControlSyncJobStreamsOperations
:ivar job: Job operations
:vartype job: azure.mgmt.automation.operations.JobOperations
:ivar job_stream: JobStream operations
Expand Down Expand Up @@ -246,6 +249,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.source_control_sync_job = SourceControlSyncJobOperations(
self._client, self.config, self._serialize, self._deserialize)
self.source_control_sync_job_streams = SourceControlSyncJobStreamsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.job = JobOperations(
self._client, self.config, self._serialize, self._deserialize)
self.job_stream = JobStreamOperations(
Expand Down
12 changes: 10 additions & 2 deletions azure-mgmt-automation/azure/mgmt/automation/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
from .dsc_configuration_create_or_update_parameters import DscConfigurationCreateOrUpdateParameters
from .dsc_configuration_update_parameters import DscConfigurationUpdateParameters
from .dsc_meta_configuration import DscMetaConfiguration
from .dsc_node_configuration_create_or_update_parameters import DscNodeConfigurationCreateOrUpdateParameters
from .dsc_node_configuration_association_property import DscNodeConfigurationAssociationProperty
from .dsc_node_extension_handler_association_property import DscNodeExtensionHandlerAssociationProperty
from .dsc_node_update_parameters_properties import DscNodeUpdateParametersProperties
Expand Down Expand Up @@ -126,8 +125,11 @@
from .source_control_sync_job import SourceControlSyncJob
from .source_control_sync_job_create_parameters import SourceControlSyncJobCreateParameters
from .source_control_sync_job_by_id import SourceControlSyncJobById
from .source_control_sync_job_stream import SourceControlSyncJobStream
from .source_control_sync_job_stream_by_id import SourceControlSyncJobStreamById
from .dsc_node import DscNode
from .dsc_node_configuration import DscNodeConfiguration
from .dsc_node_configuration_create_or_update_parameters import DscNodeConfigurationCreateOrUpdateParameters
from .automation_account_paged import AutomationAccountPaged
from .operation_paged import OperationPaged
from .statistics_paged import StatisticsPaged
Expand All @@ -150,6 +152,7 @@
from .webhook_paged import WebhookPaged
from .source_control_paged import SourceControlPaged
from .source_control_sync_job_paged import SourceControlSyncJobPaged
from .source_control_sync_job_stream_paged import SourceControlSyncJobStreamPaged
from .job_collection_item_paged import JobCollectionItemPaged
from .dsc_node_paged import DscNodePaged
from .dsc_node_report_paged import DscNodeReportPaged
Expand Down Expand Up @@ -180,6 +183,7 @@
SourceType,
ProvisioningState,
StartType,
StreamType,
)

__all__ = [
Expand Down Expand Up @@ -239,7 +243,6 @@
'DscConfigurationCreateOrUpdateParameters',
'DscConfigurationUpdateParameters',
'DscMetaConfiguration',
'DscNodeConfigurationCreateOrUpdateParameters',
'DscNodeConfigurationAssociationProperty',
'DscNodeExtensionHandlerAssociationProperty',
'DscNodeUpdateParametersProperties',
Expand Down Expand Up @@ -300,8 +303,11 @@
'SourceControlSyncJob',
'SourceControlSyncJobCreateParameters',
'SourceControlSyncJobById',
'SourceControlSyncJobStream',
'SourceControlSyncJobStreamById',
'DscNode',
'DscNodeConfiguration',
'DscNodeConfigurationCreateOrUpdateParameters',
'AutomationAccountPaged',
'OperationPaged',
'StatisticsPaged',
Expand All @@ -324,6 +330,7 @@
'WebhookPaged',
'SourceControlPaged',
'SourceControlSyncJobPaged',
'SourceControlSyncJobStreamPaged',
'JobCollectionItemPaged',
'DscNodePaged',
'DscNodeReportPaged',
Expand Down Expand Up @@ -353,4 +360,5 @@
'SourceType',
'ProvisioningState',
'StartType',
'StreamType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,9 @@ class StartType(Enum):

auto_sync = "AutoSync"
manual_sync = "ManualSync"


class StreamType(Enum):

error = "Error"
output = "Output"
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,35 @@ class DscNodeConfigurationCreateOrUpdateParameters(Model):

:param source: Gets or sets the source.
:type source: ~azure.mgmt.automation.models.ContentSource
:param name: Name of the node configuration.
:type name: str
:param configuration: Gets or sets the configuration of the node.
:type configuration:
~azure.mgmt.automation.models.DscConfigurationAssociationProperty
:param new_node_configuration_build_version_required: If a new build
version of NodeConfiguration is required.
:type new_node_configuration_build_version_required: bool
:param source1: Gets or sets the source.
:type source1: ~azure.mgmt.automation.models.ContentSource
:param name1: Gets or sets the type of the parameter.
:type name1: str
:param configuration1: Gets or sets the configuration of the node.
:type configuration1:
~azure.mgmt.automation.models.DscConfigurationAssociationProperty
:param increment_node_configuration_build: If a new build version of
NodeConfiguration is required.
:type increment_node_configuration_build: bool
:param name: Name of the node configuration.
:type name: str
:param tags: Gets or sets the tags attached to the resource.
:type tags: dict[str, str]
"""

_validation = {
'source': {'required': True},
'name': {'required': True},
'configuration': {'required': True},
'source1': {'required': True},
'name1': {'required': True},
'configuration1': {'required': True},
}

_attribute_map = {
'source': {'key': 'source', 'type': 'ContentSource'},
'name': {'key': 'name', 'type': 'str'},
'configuration': {'key': 'configuration', 'type': 'DscConfigurationAssociationProperty'},
'new_node_configuration_build_version_required': {'key': 'newNodeConfigurationBuildVersionRequired', 'type': 'bool'},
'source1': {'key': 'properties.source', 'type': 'ContentSource'},
'name1': {'key': 'properties.name', 'type': 'str'},
'configuration1': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'},
'source': {'key': 'properties.source', 'type': 'ContentSource'},
'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'},
'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'},
'name': {'key': 'name', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, source, name, configuration, source1, name1, configuration1, new_node_configuration_build_version_required=None, increment_node_configuration_build=None, tags=None):
def __init__(self, source, configuration, increment_node_configuration_build=None, name=None, tags=None):
super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__()
self.source = source
self.name = name
self.configuration = configuration
self.new_node_configuration_build_version_required = new_node_configuration_build_version_required
self.source1 = source1
self.name1 = name1
self.configuration1 = configuration1
self.increment_node_configuration_build = increment_node_configuration_build
self.name = name
self.tags = tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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 SourceControlSyncJobStream(Model):
"""Definition of the source control sync job stream.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource id.
:vartype id: str
:param sync_job_stream_id: Gets the sync job stream id.
:type sync_job_stream_id: str
:param summary: Gets the summary of the sync job stream.
:type summary: str
:ivar time: Gets the time of the sync job stream.
:vartype time: datetime
:param stream_type: Gets the type of the sync job stream. Possible values
include: 'Error', 'Output'
:type stream_type: str or ~azure.mgmt.automation.models.StreamType
"""

_validation = {
'id': {'readonly': True},
'time': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'sync_job_stream_id': {'key': 'properties.syncJobStreamId', 'type': 'str'},
'summary': {'key': 'properties.summary', 'type': 'str'},
'time': {'key': 'properties.time', 'type': 'iso-8601'},
'stream_type': {'key': 'properties.streamType', 'type': 'str'},
}

def __init__(self, sync_job_stream_id=None, summary=None, stream_type=None):
super(SourceControlSyncJobStream, self).__init__()
self.id = None
self.sync_job_stream_id = sync_job_stream_id
self.summary = summary
self.time = None
self.stream_type = stream_type
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 SourceControlSyncJobStreamById(Model):
"""Definition of the source control sync job stream by id.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource id.
:vartype id: str
:param sync_job_stream_id: Gets the sync job stream id.
:type sync_job_stream_id: str
:param summary: Gets the summary of the sync job stream.
:type summary: str
:ivar time: Gets the time of the sync job stream.
:vartype time: datetime
:param stream_type: Gets the type of the sync job stream. Possible values
include: 'Error', 'Output'
:type stream_type: str or ~azure.mgmt.automation.models.StreamType
:param stream_text: Gets the text of the sync job stream.
:type stream_text: str
:param value: Gets the value of the sync job stream.
:type value: str
"""

_validation = {
'id': {'readonly': True},
'time': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'sync_job_stream_id': {'key': 'properties.syncJobStreamId', 'type': 'str'},
'summary': {'key': 'properties.summary', 'type': 'str'},
'time': {'key': 'properties.time', 'type': 'iso-8601'},
'stream_type': {'key': 'properties.streamType', 'type': 'str'},
'stream_text': {'key': 'properties.streamText', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
}

def __init__(self, sync_job_stream_id=None, summary=None, stream_type=None, stream_text=None, value=None):
super(SourceControlSyncJobStreamById, self).__init__()
self.id = None
self.sync_job_stream_id = sync_job_stream_id
self.summary = summary
self.time = None
self.stream_type = stream_type
self.stream_text = stream_text
self.value = value
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 SourceControlSyncJobStreamPaged(Paged):
"""
A paging container for iterating over a list of :class:`SourceControlSyncJobStream <azure.mgmt.automation.models.SourceControlSyncJobStream>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[SourceControlSyncJobStream]'}
}

def __init__(self, *args, **kwargs):

super(SourceControlSyncJobStreamPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from .software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations
from .source_control_operations import SourceControlOperations
from .source_control_sync_job_operations import SourceControlSyncJobOperations
from .source_control_sync_job_streams_operations import SourceControlSyncJobStreamsOperations
from .job_operations import JobOperations
from .job_stream_operations import JobStreamOperations
from .agent_registration_information_operations import AgentRegistrationInformationOperations
Expand Down Expand Up @@ -77,6 +78,7 @@
'SoftwareUpdateConfigurationMachineRunsOperations',
'SourceControlOperations',
'SourceControlSyncJobOperations',
'SourceControlSyncJobStreamsOperations',
'JobOperations',
'JobStreamOperations',
'AgentRegistrationInformationOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -60,7 +59,8 @@ def get_by_id(
:rtype:
~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_by_id.metadata['url']
Expand Down Expand Up @@ -93,9 +93,7 @@ def get_by_id(
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

Expand Down Expand Up @@ -139,7 +137,8 @@ def list(
:rtype:
~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRunListResult
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
# Construct URL
url = self.list.metadata['url']
Expand Down Expand Up @@ -177,9 +176,7 @@ def list(
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

Expand Down
Loading