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] engagementfabric/resource-manager #5677

Closed
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 .engagement_fabric import EngagementFabric
from .version import VERSION

__all__ = ['EngagementFabric']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# 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 msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .operations.accounts_operations import AccountsOperations
from .operations.channels_operations import ChannelsOperations
from .operations.operations import Operations
from .operations.sk_us_operations import SKUsOperations
from . import models


class EngagementFabricConfiguration(AzureConfiguration):
"""Configuration for EngagementFabric
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 ID
: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(EngagementFabricConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id


class EngagementFabric(SDKClient):
"""Microsoft Customer Engagement Fabric

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

:ivar accounts: Accounts operations
:vartype accounts: azure.mgmt.engagementfabric.operations.AccountsOperations
:ivar channels: Channels operations
:vartype channels: azure.mgmt.engagementfabric.operations.ChannelsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.engagementfabric.operations.Operations
:ivar sk_us: SKUs operations
:vartype sk_us: azure.mgmt.engagementfabric.operations.SKUsOperations

: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 ID
:type subscription_id: str
:param str base_url: Service URL
"""

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

self.config = EngagementFabricConfiguration(credentials, subscription_id, base_url)
super(EngagementFabric, 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 = '2018-09-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.accounts = AccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.channels = ChannelsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.sk_us = SKUsOperations(
self._client, self.config, self._serialize, self._deserialize)

def check_name_availability(
self, resource_group_name, name, type, custom_headers=None, raw=False, **operation_config):
"""Check availability of EngagementFabric resource.

:param resource_group_name: Resource Group Name
:type resource_group_name: str
:param name: The name to be checked
:type name: str
:param type: The fully qualified resource type for the name to be
checked
:type type: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: CheckNameAvailabilityResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.engagementfabric.models.CheckNameAvailabilityResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
parameters = models.CheckNameAvailabilityParameter(name=name, type=type)

# Construct URL
url = self.check_name_availability.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter')

# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('CheckNameAvailabilityResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/checkNameAvailability'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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 .sku_py3 import SKU
from .resource_py3 import Resource
from .tracked_resource_py3 import TrackedResource
from .account_py3 import Account
from .account_patch_py3 import AccountPatch
from .key_description_py3 import KeyDescription
from .regenerate_key_parameter_py3 import RegenerateKeyParameter
from .channel_type_description_py3 import ChannelTypeDescription
from .channel_type_description_list_py3 import ChannelTypeDescriptionList
from .proxy_only_resource_py3 import ProxyOnlyResource
from .channel_py3 import Channel
from .check_name_availability_parameter_py3 import CheckNameAvailabilityParameter
from .check_name_availability_result_py3 import CheckNameAvailabilityResult
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .sku_location_info_item_py3 import SkuLocationInfoItem
from .sku_description_py3 import SkuDescription
except (SyntaxError, ImportError):
from .sku import SKU
from .resource import Resource
from .tracked_resource import TrackedResource
from .account import Account
from .account_patch import AccountPatch
from .key_description import KeyDescription
from .regenerate_key_parameter import RegenerateKeyParameter
from .channel_type_description import ChannelTypeDescription
from .channel_type_description_list import ChannelTypeDescriptionList
from .proxy_only_resource import ProxyOnlyResource
from .channel import Channel
from .check_name_availability_parameter import CheckNameAvailabilityParameter
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .operation import Operation
from .sku_location_info_item import SkuLocationInfoItem
from .sku_description import SkuDescription
from .account_paged import AccountPaged
from .key_description_paged import KeyDescriptionPaged
from .channel_paged import ChannelPaged
from .operation_paged import OperationPaged
from .sku_description_paged import SkuDescriptionPaged
from .engagement_fabric_enums import (
KeyRank,
CheckNameUnavailableReason,
)

__all__ = [
'SKU',
'Resource',
'TrackedResource',
'Account',
'AccountPatch',
'KeyDescription',
'RegenerateKeyParameter',
'ChannelTypeDescription',
'ChannelTypeDescriptionList',
'ProxyOnlyResource',
'Channel',
'CheckNameAvailabilityParameter',
'CheckNameAvailabilityResult',
'OperationDisplay',
'Operation',
'SkuLocationInfoItem',
'SkuDescription',
'AccountPaged',
'KeyDescriptionPaged',
'ChannelPaged',
'OperationPaged',
'SkuDescriptionPaged',
'KeyRank',
'CheckNameUnavailableReason',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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 .tracked_resource import TrackedResource


class Account(TrackedResource):
"""The EngagementFabric account.

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

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

:ivar id: The ID of the resource
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The fully qualified type of the resource
:vartype type: str
:param location: Required. The location of the resource
:type location: str
:param tags: The tags of the resource
:type tags: dict[str, str]
:param sku: Required. The SKU of the resource
:type sku: ~azure.mgmt.engagementfabric.models.SKU
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'sku': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'SKU'},
}

def __init__(self, **kwargs):
super(Account, self).__init__(**kwargs)
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 AccountPaged(Paged):
"""
A paging container for iterating over a list of :class:`Account <azure.mgmt.engagementfabric.models.Account>` object
"""

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

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

super(AccountPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 AccountPatch(Model):
"""The patch of EngagementFabric account.

:param tags: The tags of the resource
:type tags: dict[str, str]
"""

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

def __init__(self, **kwargs):
super(AccountPatch, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
Loading