Skip to content
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 @@ -23,14 +23,14 @@ class WorkItemCreateConfiguration(Model):
:param validate_only: Boolean indicating validate only
:type validate_only: bool
:param work_item_properties: Custom work item properties
:type work_item_properties: str
:type work_item_properties: dict[str, str]
"""

_attribute_map = {
'connector_id': {'key': 'ConnectorId', 'type': 'str'},
'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'},
'validate_only': {'key': 'ValidateOnly', 'type': 'bool'},
'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'},
'work_item_properties': {'key': 'WorkItemProperties', 'type': '{str}'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ class WorkItemCreateConfiguration(Model):
:param validate_only: Boolean indicating validate only
:type validate_only: bool
:param work_item_properties: Custom work item properties
:type work_item_properties: str
:type work_item_properties: dict[str, str]
"""

_attribute_map = {
'connector_id': {'key': 'ConnectorId', 'type': 'str'},
'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'},
'validate_only': {'key': 'ValidateOnly', 'type': 'bool'},
'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'},
'work_item_properties': {'key': 'WorkItemProperties', 'type': '{str}'},
}

def __init__(self, *, connector_id: str=None, connector_data_configuration: str=None, validate_only: bool=None, work_item_properties: str=None, **kwargs) -> None:
def __init__(self, *, connector_id: str=None, connector_data_configuration: str=None, validate_only: bool=None, work_item_properties=None, **kwargs) -> None:
super(WorkItemCreateConfiguration, self).__init__(**kwargs)
self.connector_id = connector_id
self.connector_data_configuration = connector_data_configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,151 @@ def delete(

return deserialized
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'}

def get_item(
self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config):
"""Gets specified work item configuration for an Application Insights
component.

:param resource_group_name: The name of the resource group. The name
is case insensitive.
:type resource_group_name: str
:param resource_name: The name of the Application Insights component
resource.
:type resource_name: str
:param work_item_config_id: The unique work item configuration Id.
This can be either friendly name of connector as defined in connector
configuration
:type work_item_config_id: 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: WorkItemConfiguration or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.applicationinsights.models.WorkItemConfiguration
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_item.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1),
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, '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', min_length=1)

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
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 and send request
request = self._client.get(url, query_parameters, header_parameters)
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('WorkItemConfiguration', response)

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

return deserialized
get_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'}

def update_item(
self, resource_group_name, resource_name, work_item_config_id, work_item_configuration_properties, custom_headers=None, raw=False, **operation_config):
"""Update a work item configuration for an Application Insights component.

:param resource_group_name: The name of the resource group. The name
is case insensitive.
:type resource_group_name: str
:param resource_name: The name of the Application Insights component
resource.
:type resource_name: str
:param work_item_config_id: The unique work item configuration Id.
This can be either friendly name of connector as defined in connector
configuration
:type work_item_config_id: str
:param work_item_configuration_properties: Properties that need to be
specified to update a work item configuration for this Application
Insights component.
:type work_item_configuration_properties:
~azure.mgmt.applicationinsights.models.WorkItemCreateConfiguration
: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: WorkItemConfiguration or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.applicationinsights.models.WorkItemConfiguration
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.update_item.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1),
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, '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', min_length=1)

# 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(work_item_configuration_properties, 'WorkItemCreateConfiguration')

# Construct and send request
request = self._client.patch(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('WorkItemConfiguration', response)

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

return deserialized
update_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.2.0"
VERSION = "0.1.0"