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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .event_hub_management_client import EventHubManagementClient
from .version import VERSION

__all__ = ['EventHubManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# 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.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.namespaces_operations import NamespacesOperations
from .operations.event_hubs_operations import EventHubsOperations
from .operations.consumer_groups_operations import ConsumerGroupsOperations
from . import models


class EventHubManagementClientConfiguration(AzureConfiguration):
"""Configuration for EventHubManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials that uniquely identify a
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(EventHubManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-eventhub/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class EventHubManagementClient(SDKClient):
"""Azure Event Hubs client

:ivar config: Configuration for client.
:vartype config: EventHubManagementClientConfiguration

:ivar operations: Operations operations
:vartype operations: azure.mgmt.eventhub.v2015_08_01.operations.Operations
:ivar namespaces: Namespaces operations
:vartype namespaces: azure.mgmt.eventhub.v2015_08_01.operations.NamespacesOperations
:ivar event_hubs: EventHubs operations
:vartype event_hubs: azure.mgmt.eventhub.v2015_08_01.operations.EventHubsOperations
:ivar consumer_groups: ConsumerGroups operations
:vartype consumer_groups: azure.mgmt.eventhub.v2015_08_01.operations.ConsumerGroupsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials that uniquely identify a
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = EventHubManagementClientConfiguration(credentials, subscription_id, base_url)
super(EventHubManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2015-08-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.namespaces = NamespacesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.event_hubs = EventHubsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.consumer_groups = ConsumerGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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.
# --------------------------------------------------------------------------

try:
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .tracked_resource_py3 import TrackedResource
from .resource_py3 import Resource
from .sku_py3 import Sku
from .namespace_create_or_update_parameters_py3 import NamespaceCreateOrUpdateParameters
from .namespace_resource_py3 import NamespaceResource
from .shared_access_authorization_rule_create_or_update_parameters_py3 import SharedAccessAuthorizationRuleCreateOrUpdateParameters
from .shared_access_authorization_rule_resource_py3 import SharedAccessAuthorizationRuleResource
from .resource_list_keys_py3 import ResourceListKeys
from .regenerate_keys_parameters_py3 import RegenerateKeysParameters
from .event_hub_create_or_update_parameters_py3 import EventHubCreateOrUpdateParameters
from .event_hub_resource_py3 import EventHubResource
from .consumer_group_create_or_update_parameters_py3 import ConsumerGroupCreateOrUpdateParameters
from .consumer_group_resource_py3 import ConsumerGroupResource
from .check_name_availability_parameter_py3 import CheckNameAvailabilityParameter
from .check_name_availability_result_py3 import CheckNameAvailabilityResult
from .namespace_update_parameter_py3 import NamespaceUpdateParameter
except (SyntaxError, ImportError):
from .operation_display import OperationDisplay
from .operation import Operation
from .tracked_resource import TrackedResource
from .resource import Resource
from .sku import Sku
from .namespace_create_or_update_parameters import NamespaceCreateOrUpdateParameters
from .namespace_resource import NamespaceResource
from .shared_access_authorization_rule_create_or_update_parameters import SharedAccessAuthorizationRuleCreateOrUpdateParameters
from .shared_access_authorization_rule_resource import SharedAccessAuthorizationRuleResource
from .resource_list_keys import ResourceListKeys
from .regenerate_keys_parameters import RegenerateKeysParameters
from .event_hub_create_or_update_parameters import EventHubCreateOrUpdateParameters
from .event_hub_resource import EventHubResource
from .consumer_group_create_or_update_parameters import ConsumerGroupCreateOrUpdateParameters
from .consumer_group_resource import ConsumerGroupResource
from .check_name_availability_parameter import CheckNameAvailabilityParameter
from .check_name_availability_result import CheckNameAvailabilityResult
from .namespace_update_parameter import NamespaceUpdateParameter
from .operation_paged import OperationPaged
from .namespace_resource_paged import NamespaceResourcePaged
from .shared_access_authorization_rule_resource_paged import SharedAccessAuthorizationRuleResourcePaged
from .event_hub_resource_paged import EventHubResourcePaged
from .consumer_group_resource_paged import ConsumerGroupResourcePaged
from .event_hub_management_client_enums import (
SkuName,
SkuTier,
NamespaceState,
AccessRights,
Policykey,
EntityStatus,
UnavailableReason,
)

__all__ = [
'OperationDisplay',
'Operation',
'TrackedResource',
'Resource',
'Sku',
'NamespaceCreateOrUpdateParameters',
'NamespaceResource',
'SharedAccessAuthorizationRuleCreateOrUpdateParameters',
'SharedAccessAuthorizationRuleResource',
'ResourceListKeys',
'RegenerateKeysParameters',
'EventHubCreateOrUpdateParameters',
'EventHubResource',
'ConsumerGroupCreateOrUpdateParameters',
'ConsumerGroupResource',
'CheckNameAvailabilityParameter',
'CheckNameAvailabilityResult',
'NamespaceUpdateParameter',
'OperationPaged',
'NamespaceResourcePaged',
'SharedAccessAuthorizationRuleResourcePaged',
'EventHubResourcePaged',
'ConsumerGroupResourcePaged',
'SkuName',
'SkuTier',
'NamespaceState',
'AccessRights',
'Policykey',
'EntityStatus',
'UnavailableReason',
]
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 CheckNameAvailabilityParameter(Model):
"""Parameter supplied to check Namespace name availability operation .

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

:param name: Required. Name to check the namespace name availability
:type name: str
"""

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

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CheckNameAvailabilityParameter, self).__init__(**kwargs)
self.name = kwargs.get('name', 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 CheckNameAvailabilityParameter(Model):
"""Parameter supplied to check Namespace name availability operation .

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

:param name: Required. Name to check the namespace name availability
:type name: str
"""

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

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, *, name: str, **kwargs) -> None:
super(CheckNameAvailabilityParameter, self).__init__(**kwargs)
self.name = name
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 CheckNameAvailabilityResult(Model):
"""The Result of the CheckNameAvailability operation.

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

:param name_available: Value indicating Namespace is availability, true if
the Namespace is available; otherwise, false.
:type name_available: bool
:param reason: The reason for unavailability of a Namespace. Possible
values include: 'None', 'InvalidName', 'SubscriptionIsDisabled',
'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'
:type reason: str or
~azure.mgmt.eventhub.v2015_08_01.models.UnavailableReason
:ivar message: The detailed info regarding the reason associated with the
Namespace.
:vartype message: str
"""

_validation = {
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'UnavailableReason'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.name_available = kwargs.get('name_available', None)
self.reason = kwargs.get('reason', None)
self.message = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 CheckNameAvailabilityResult(Model):
"""The Result of the CheckNameAvailability operation.

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

:param name_available: Value indicating Namespace is availability, true if
the Namespace is available; otherwise, false.
:type name_available: bool
:param reason: The reason for unavailability of a Namespace. Possible
values include: 'None', 'InvalidName', 'SubscriptionIsDisabled',
'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'
:type reason: str or
~azure.mgmt.eventhub.v2015_08_01.models.UnavailableReason
:ivar message: The detailed info regarding the reason associated with the
Namespace.
:vartype message: str
"""

_validation = {
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'UnavailableReason'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, name_available: bool=None, reason=None, **kwargs) -> None:
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.name_available = name_available
self.reason = reason
self.message = None
Loading