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 logic/resource-manager] Change some string modelled enums back into enums #3237

Merged
merged 3 commits into from
Sep 10, 2018
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
2 changes: 1 addition & 1 deletion azure-mgmt-logic/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Logic Apps Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
5 changes: 0 additions & 5 deletions azure-mgmt-logic/azure/mgmt/logic/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
from .tracking_event_error_info_py3 import TrackingEventErrorInfo
from .tracking_event_py3 import TrackingEvent
from .tracking_events_definition_py3 import TrackingEventsDefinition
from .access_key_regenerate_action_definition_py3 import AccessKeyRegenerateActionDefinition
from .set_trigger_state_action_definition_py3 import SetTriggerStateActionDefinition
from .expression_root_py3 import ExpressionRoot
from .azure_resource_error_info_py3 import AzureResourceErrorInfo
Expand Down Expand Up @@ -234,7 +233,6 @@
from .tracking_event_error_info import TrackingEventErrorInfo
from .tracking_event import TrackingEvent
from .tracking_events_definition import TrackingEventsDefinition
from .access_key_regenerate_action_definition import AccessKeyRegenerateActionDefinition
from .set_trigger_state_action_definition import SetTriggerStateActionDefinition
from .expression_root import ExpressionRoot
from .azure_resource_error_info import AzureResourceErrorInfo
Expand Down Expand Up @@ -305,7 +303,6 @@
TrackEventsOperationOptions,
EventLevel,
TrackingRecordType,
AccessKeyType,
)

__all__ = [
Expand Down Expand Up @@ -410,7 +407,6 @@
'TrackingEventErrorInfo',
'TrackingEvent',
'TrackingEventsDefinition',
'AccessKeyRegenerateActionDefinition',
'SetTriggerStateActionDefinition',
'ExpressionRoot',
'AzureResourceErrorInfo',
Expand Down Expand Up @@ -480,5 +476,4 @@
'TrackEventsOperationOptions',
'EventLevel',
'TrackingRecordType',
'AccessKeyType',
]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class EdifactDelimiterOverride(Model):
'component_separator': {'key': 'componentSeparator', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'EdifactDecimalIndicator'},
'release_indicator': {'key': 'releaseIndicator', 'type': 'int'},
'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'},
'target_namespace': {'key': 'targetNamespace', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class EdifactDelimiterOverride(Model):
'component_separator': {'key': 'componentSeparator', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'EdifactDecimalIndicator'},
'release_indicator': {'key': 'releaseIndicator', 'type': 'int'},
'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'},
'target_namespace': {'key': 'targetNamespace', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class EdifactFramingSettings(Model):
'release_indicator': {'key': 'releaseIndicator', 'type': 'int'},
'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'},
'character_set': {'key': 'characterSet', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'EdifactDecimalIndicator'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class EdifactFramingSettings(Model):
'release_indicator': {'key': 'releaseIndicator', 'type': 'int'},
'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'},
'character_set': {'key': 'characterSet', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'EdifactDecimalIndicator'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
}

def __init__(self, *, protocol_version: int, data_element_separator: int, component_separator: int, segment_terminator: int, release_indicator: int, repetition_separator: int, character_set, decimal_point_indicator, segment_terminator_suffix, service_code_list_directory_version: str=None, character_encoding: str=None, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IntegrationAccountAgreement(Resource):
'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'},
'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'},
'metadata': {'key': 'properties.metadata', 'type': 'object'},
'agreement_type': {'key': 'properties.agreementType', 'type': 'str'},
'agreement_type': {'key': 'properties.agreementType', 'type': 'AgreementType'},
'host_partner': {'key': 'properties.hostPartner', 'type': 'str'},
'guest_partner': {'key': 'properties.guestPartner', 'type': 'str'},
'host_identity': {'key': 'properties.hostIdentity', 'type': 'BusinessIdentity'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IntegrationAccountAgreementFilter(Model):
}

_attribute_map = {
'agreement_type': {'key': 'agreementType', 'type': 'str'},
'agreement_type': {'key': 'agreementType', 'type': 'AgreementType'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IntegrationAccountAgreementFilter(Model):
}

_attribute_map = {
'agreement_type': {'key': 'agreementType', 'type': 'str'},
'agreement_type': {'key': 'agreementType', 'type': 'AgreementType'},
}

def __init__(self, *, agreement_type, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IntegrationAccountAgreement(Resource):
'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'},
'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'},
'metadata': {'key': 'properties.metadata', 'type': 'object'},
'agreement_type': {'key': 'properties.agreementType', 'type': 'str'},
'agreement_type': {'key': 'properties.agreementType', 'type': 'AgreementType'},
'host_partner': {'key': 'properties.hostPartner', 'type': 'str'},
'guest_partner': {'key': 'properties.guestPartner', 'type': 'str'},
'host_identity': {'key': 'properties.hostIdentity', 'type': 'BusinessIdentity'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,3 @@ class TrackingRecordType(str, Enum):
edifact_interchange_acknowledgment = "EdifactInterchangeAcknowledgment"
edifact_functional_group_acknowledgment = "EdifactFunctionalGroupAcknowledgment"
edifact_transaction_set_acknowledgment = "EdifactTransactionSetAcknowledgment"


class AccessKeyType(str, Enum):

not_specified = "NotSpecified"
primary = "Primary"
secondary = "Secondary"
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RecurrenceSchedule(Model):
_attribute_map = {
'minutes': {'key': 'minutes', 'type': '[int]'},
'hours': {'key': 'hours', 'type': '[int]'},
'week_days': {'key': 'weekDays', 'type': '[str]'},
'week_days': {'key': 'weekDays', 'type': '[DaysOfWeek]'},
'month_days': {'key': 'monthDays', 'type': '[int]'},
'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[RecurrenceScheduleOccurrence]'},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RecurrenceScheduleOccurrence(Model):
"""

_attribute_map = {
'day': {'key': 'day', 'type': 'str'},
'day': {'key': 'day', 'type': 'DayOfWeek'},
'occurrence': {'key': 'occurrence', 'type': 'int'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RecurrenceScheduleOccurrence(Model):
"""

_attribute_map = {
'day': {'key': 'day', 'type': 'str'},
'day': {'key': 'day', 'type': 'DayOfWeek'},
'occurrence': {'key': 'occurrence', 'type': 'int'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RecurrenceSchedule(Model):
_attribute_map = {
'minutes': {'key': 'minutes', 'type': '[int]'},
'hours': {'key': 'hours', 'type': '[int]'},
'week_days': {'key': 'weekDays', 'type': '[str]'},
'week_days': {'key': 'weekDays', 'type': '[DaysOfWeek]'},
'month_days': {'key': 'monthDays', 'type': '[int]'},
'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[RecurrenceScheduleOccurrence]'},
}
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-logic/azure/mgmt/logic/models/tracking_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TrackingEvent(Model):
}

_attribute_map = {
'event_level': {'key': 'eventLevel', 'type': 'str'},
'event_level': {'key': 'eventLevel', 'type': 'EventLevel'},
'event_time': {'key': 'eventTime', 'type': 'iso-8601'},
'record_type': {'key': 'recordType', 'type': 'str'},
'error': {'key': 'error', 'type': 'TrackingEventErrorInfo'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TrackingEvent(Model):
}

_attribute_map = {
'event_level': {'key': 'eventLevel', 'type': 'str'},
'event_level': {'key': 'eventLevel', 'type': 'EventLevel'},
'event_time': {'key': 'eventTime', 'type': 'iso-8601'},
'record_type': {'key': 'recordType', 'type': 'str'},
'error': {'key': 'error', 'type': 'TrackingEventErrorInfo'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class X12DelimiterOverrides(Model):
'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'},
'component_separator': {'key': 'componentSeparator', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
'replace_character': {'key': 'replaceCharacter', 'type': 'int'},
'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'},
'target_namespace': {'key': 'targetNamespace', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class X12DelimiterOverrides(Model):
'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'},
'component_separator': {'key': 'componentSeparator', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
'replace_character': {'key': 'replaceCharacter', 'type': 'int'},
'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'},
'target_namespace': {'key': 'targetNamespace', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class X12FramingSettings(Model):
'replace_character': {'key': 'replaceCharacter', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'character_set': {'key': 'characterSet', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class X12FramingSettings(Model):
'replace_character': {'key': 'replaceCharacter', 'type': 'int'},
'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'},
'character_set': {'key': 'characterSet', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'},
'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'SegmentTerminatorSuffix'},
}

def __init__(self, *, data_element_separator: int, component_separator: int, replace_separators_in_payload: bool, replace_character: int, segment_terminator: int, character_set, segment_terminator_suffix, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

from .. import models

Expand Down Expand Up @@ -267,8 +268,7 @@ def delete(
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.logic.models.ErrorResponseException>`
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.delete.metadata['url']
Expand Down Expand Up @@ -298,7 +298,9 @@ def delete(
response = self._client.send(request, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand Down
4 changes: 3 additions & 1 deletion azure-mgmt-logic/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(exclude=["tests"]),
install_requires=[
'msrestazure>=0.4.27,<2.0.0',
'msrest>=0.5.0',
'msrestazure>=0.4.32,<2.0.0',
'azure-common~=1.1',
],
cmdclass=cmdclass
Expand Down