Skip to content
Closed
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
51 changes: 37 additions & 14 deletions azure-mgmt-subscription/azure/mgmt/subscription/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,61 @@
# regenerated.
# --------------------------------------------------------------------------

from .subscription_definition import SubscriptionDefinition
from .operation_display import OperationDisplay
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .location import Location
from .subscription_policies import SubscriptionPolicies
from .subscription import Subscription
from .tenant_id_description import TenantIdDescription
from .operation_paged import OperationPaged
from .subscription_definition_paged import SubscriptionDefinitionPaged
try:
from .subscription_creation_result_py3 import SubscriptionCreationResult
from .ad_principal_py3 import AdPrincipal
from .subscription_creation_parameters_py3 import SubscriptionCreationParameters
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .subscription_operation_py3 import SubscriptionOperation
from .subscription_operation_list_result_py3 import SubscriptionOperationListResult
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .operation_list_result_py3 import OperationListResult
from .location_py3 import Location
from .subscription_policies_py3 import SubscriptionPolicies
from .subscription_py3 import Subscription
from .tenant_id_description_py3 import TenantIdDescription
except (SyntaxError, ImportError):
from .subscription_creation_result import SubscriptionCreationResult
from .ad_principal import AdPrincipal
from .subscription_creation_parameters import SubscriptionCreationParameters
from .error_response import ErrorResponse, ErrorResponseException
from .subscription_operation import SubscriptionOperation
from .subscription_operation_list_result import SubscriptionOperationListResult
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .location import Location
from .subscription_policies import SubscriptionPolicies
from .subscription import Subscription
from .tenant_id_description import TenantIdDescription
from .location_paged import LocationPaged
from .subscription_paged import SubscriptionPaged
from .tenant_id_description_paged import TenantIdDescriptionPaged
from .subscription_client_enums import (
OfferType,
SubscriptionState,
SpendingLimit,
)

__all__ = [
'SubscriptionDefinition',
'SubscriptionCreationResult',
'AdPrincipal',
'SubscriptionCreationParameters',
'ErrorResponse', 'ErrorResponseException',
'SubscriptionOperation',
'SubscriptionOperationListResult',
'OperationDisplay',
'Operation',
'ErrorResponse', 'ErrorResponseException',
'OperationListResult',
'Location',
'SubscriptionPolicies',
'Subscription',
'TenantIdDescription',
'OperationPaged',
'SubscriptionDefinitionPaged',
'LocationPaged',
'SubscriptionPaged',
'TenantIdDescriptionPaged',
'OfferType',
'SubscriptionState',
'SpendingLimit',
]
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 AdPrincipal(Model):
"""Active Directory Principal for subscription creation delegated permission.

All required parameters must be populated in order to send to Azure.

:param object_id: Required. Object id of the Principal
:type object_id: str
"""

_validation = {
'object_id': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AdPrincipal, self).__init__(**kwargs)
self.object_id = kwargs.get('object_id', None)
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 AdPrincipal(Model):
"""Active Directory Principal for subscription creation delegated permission.

All required parameters must be populated in order to send to Azure.

:param object_id: Required. Object id of the Principal
:type object_id: str
"""

_validation = {
'object_id': {'required': True},
}

_attribute_map = {
'object_id': {'key': 'objectId', 'type': 'str'},
}

def __init__(self, *, object_id: str, **kwargs) -> None:
super(AdPrincipal, self).__init__(**kwargs)
self.object_id = object_id
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class ErrorResponse(Model):
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, code=None, message=None):
self.code = code
self.message = message
def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)


class ErrorResponseException(HttpOperationError):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""Describes the format of Error response.

:param code: Error code
:type code: str
:param message: Error message indicating why the operation failed.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.code = code
self.message = message


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class Location(Model):
'longitude': {'key': 'longitude', 'type': 'str'},
}

def __init__(self):
def __init__(self, **kwargs):
super(Location, self).__init__(**kwargs)
self.id = None
self.subscription_id = None
self.name = None
Expand Down
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 Location(Model):
"""Location information.

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

:ivar id: The fully qualified ID of the location. For example,
/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
:vartype id: str
:ivar subscription_id: The subscription ID.
:vartype subscription_id: str
:ivar name: The location name.
:vartype name: str
:ivar display_name: The display name of the location.
:vartype display_name: str
:ivar latitude: The latitude of the location.
:vartype latitude: str
:ivar longitude: The longitude of the location.
:vartype longitude: str
"""

_validation = {
'id': {'readonly': True},
'subscription_id': {'readonly': True},
'name': {'readonly': True},
'display_name': {'readonly': True},
'latitude': {'readonly': True},
'longitude': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'latitude': {'key': 'latitude', 'type': 'str'},
'longitude': {'key': 'longitude', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(Location, self).__init__(**kwargs)
self.id = None
self.subscription_id = None
self.name = None
self.display_name = None
self.latitude = None
self.longitude = None
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Operation(Model):
'display': {'key': 'display', 'type': 'OperationDisplay'},
}

def __init__(self, name=None, display=None):
self.name = name
self.display = display
def __init__(self, **kwargs):
super(Operation, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.display = kwargs.get('display', None)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class OperationDisplay(Model):
'operation': {'key': 'operation', 'type': 'str'},
}

def __init__(self, provider=None, resource=None, operation=None):
self.provider = provider
self.resource = resource
self.operation = operation
def __init__(self, **kwargs):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = kwargs.get('provider', None)
self.resource = kwargs.get('resource', None)
self.operation = kwargs.get('operation', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 OperationDisplay(Model):
"""The object that represents the operation.

:param provider: Service provider: Microsoft.Subscription
:type provider: str
:param resource: Resource on which the operation is performed: Profile,
endpoint, etc.
:type resource: str
:param operation: Operation type: Read, write, delete, etc.
:type operation: str
"""

_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
}

def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None:
super(OperationDisplay, self).__init__(**kwargs)
self.provider = provider
self.resource = resource
self.operation = operation
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 OperationListResult(Model):
"""Result of the request to list operations. It contains a list of operations
and a URL link to get the next set of results.

:param value: List of operations.
:type value: list[~azure.mgmt.subscription.models.Operation]
:param next_link: URL to get the next set of operation list results if
there are any.
:type next_link: str
"""

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

def __init__(self, **kwargs):
super(OperationListResult, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.next_link = kwargs.get('next_link', None)
Loading