1# coding=utf-8 2# -------------------------------------------------------------------------- 3# Copyright (c) Microsoft Corporation. All rights reserved. 4# Licensed under the MIT License. See License.txt in the project root for license information. 5# Code generated by Microsoft (R) AutoRest Code Generator. 6# Changes may cause incorrect behavior and will be lost if the code is regenerated. 7# -------------------------------------------------------------------------- 8 9from typing import Dict, List, Optional, Union 10 11from azure.core.exceptions import HttpResponseError 12import msrest.serialization 13 14from ._application_insights_management_client_enums import * 15 16 17class ErrorFieldContract(msrest.serialization.Model): 18 """Error Field contract. 19 20 :param code: Property level error code. 21 :type code: str 22 :param message: Human-readable representation of property-level error. 23 :type message: str 24 :param target: Property name. 25 :type target: str 26 """ 27 28 _attribute_map = { 29 'code': {'key': 'code', 'type': 'str'}, 30 'message': {'key': 'message', 'type': 'str'}, 31 'target': {'key': 'target', 'type': 'str'}, 32 } 33 34 def __init__( 35 self, 36 *, 37 code: Optional[str] = None, 38 message: Optional[str] = None, 39 target: Optional[str] = None, 40 **kwargs 41 ): 42 super(ErrorFieldContract, self).__init__(**kwargs) 43 self.code = code 44 self.message = message 45 self.target = target 46 47 48class Resource(msrest.serialization.Model): 49 """An azure resource object. 50 51 Variables are only populated by the server, and will be ignored when sending a request. 52 53 All required parameters must be populated in order to send to Azure. 54 55 :ivar id: Azure resource Id. 56 :vartype id: str 57 :ivar name: Azure resource name. This is GUID value. The display name should be assigned within 58 properties field. 59 :vartype name: str 60 :ivar type: Azure resource type. 61 :vartype type: str 62 :param kind: The kind of workbook. Choices are user and shared. Possible values include: 63 "user", "shared". 64 :type kind: str or ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind 65 :param location: Required. Resource location. 66 :type location: str 67 :param tags: A set of tags. Resource tags. 68 :type tags: dict[str, str] 69 """ 70 71 _validation = { 72 'id': {'readonly': True}, 73 'name': {'readonly': True}, 74 'type': {'readonly': True}, 75 'location': {'required': True}, 76 } 77 78 _attribute_map = { 79 'id': {'key': 'id', 'type': 'str'}, 80 'name': {'key': 'name', 'type': 'str'}, 81 'type': {'key': 'type', 'type': 'str'}, 82 'kind': {'key': 'kind', 'type': 'str'}, 83 'location': {'key': 'location', 'type': 'str'}, 84 'tags': {'key': 'tags', 'type': '{str}'}, 85 } 86 87 def __init__( 88 self, 89 *, 90 location: str, 91 kind: Optional[Union[str, "SharedTypeKind"]] = None, 92 tags: Optional[Dict[str, str]] = None, 93 **kwargs 94 ): 95 super(Resource, self).__init__(**kwargs) 96 self.id = None 97 self.name = None 98 self.type = None 99 self.kind = kind 100 self.location = location 101 self.tags = tags 102 103 104class Workbook(Resource): 105 """An Application Insights workbook definition. 106 107 Variables are only populated by the server, and will be ignored when sending a request. 108 109 All required parameters must be populated in order to send to Azure. 110 111 :ivar id: Azure resource Id. 112 :vartype id: str 113 :ivar name: Azure resource name. This is GUID value. The display name should be assigned within 114 properties field. 115 :vartype name: str 116 :ivar type: Azure resource type. 117 :vartype type: str 118 :param kind: The kind of workbook. Choices are user and shared. Possible values include: 119 "user", "shared". 120 :type kind: str or ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind 121 :param location: Required. Resource location. 122 :type location: str 123 :param tags: A set of tags. Resource tags. 124 :type tags: dict[str, str] 125 :param display_name: The user-defined name (display name) of the workbook. 126 :type display_name: str 127 :param serialized_data: Configuration of this particular workbook. Configuration data is a 128 string containing valid JSON. 129 :type serialized_data: str 130 :ivar time_modified: Date and time in UTC of the last modification that was made to this 131 workbook definition. 132 :vartype time_modified: str 133 :param category: Workbook category, as defined by the user at creation time. 134 :type category: str 135 :param version: Workbook version. 136 :type version: str 137 :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook 138 definition. 139 :type tags_properties_tags: list[str] 140 :ivar user_id: Unique user id of the specific user that owns this workbook. 141 :vartype user_id: str 142 :param source_id: ResourceId for a source resource. 143 :type source_id: str 144 """ 145 146 _validation = { 147 'id': {'readonly': True}, 148 'name': {'readonly': True}, 149 'type': {'readonly': True}, 150 'location': {'required': True}, 151 'time_modified': {'readonly': True}, 152 'user_id': {'readonly': True}, 153 } 154 155 _attribute_map = { 156 'id': {'key': 'id', 'type': 'str'}, 157 'name': {'key': 'name', 'type': 'str'}, 158 'type': {'key': 'type', 'type': 'str'}, 159 'kind': {'key': 'kind', 'type': 'str'}, 160 'location': {'key': 'location', 'type': 'str'}, 161 'tags': {'key': 'tags', 'type': '{str}'}, 162 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 163 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, 164 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, 165 'category': {'key': 'properties.category', 'type': 'str'}, 166 'version': {'key': 'properties.version', 'type': 'str'}, 167 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, 168 'user_id': {'key': 'properties.userId', 'type': 'str'}, 169 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, 170 } 171 172 def __init__( 173 self, 174 *, 175 location: str, 176 kind: Optional[Union[str, "SharedTypeKind"]] = None, 177 tags: Optional[Dict[str, str]] = None, 178 display_name: Optional[str] = None, 179 serialized_data: Optional[str] = None, 180 category: Optional[str] = None, 181 version: Optional[str] = None, 182 tags_properties_tags: Optional[List[str]] = None, 183 source_id: Optional[str] = None, 184 **kwargs 185 ): 186 super(Workbook, self).__init__(kind=kind, location=location, tags=tags, **kwargs) 187 self.display_name = display_name 188 self.serialized_data = serialized_data 189 self.time_modified = None 190 self.category = category 191 self.version = version 192 self.tags_properties_tags = tags_properties_tags 193 self.user_id = None 194 self.source_id = source_id 195 196 197class WorkbookError(msrest.serialization.Model): 198 """Error message body that will indicate why the operation failed. 199 200 :param code: Service-defined error code. This code serves as a sub-status for the HTTP error 201 code specified in the response. 202 :type code: str 203 :param message: Human-readable representation of the error. 204 :type message: str 205 :param details: The list of invalid fields send in request, in case of validation error. 206 :type details: 207 list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.ErrorFieldContract] 208 """ 209 210 _attribute_map = { 211 'code': {'key': 'code', 'type': 'str'}, 212 'message': {'key': 'message', 'type': 'str'}, 213 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, 214 } 215 216 def __init__( 217 self, 218 *, 219 code: Optional[str] = None, 220 message: Optional[str] = None, 221 details: Optional[List["ErrorFieldContract"]] = None, 222 **kwargs 223 ): 224 super(WorkbookError, self).__init__(**kwargs) 225 self.code = code 226 self.message = message 227 self.details = details 228 229 230class WorkbooksListResult(msrest.serialization.Model): 231 """Workbook list result. 232 233 :param value: An array of workbooks. 234 :type value: list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook] 235 """ 236 237 _attribute_map = { 238 'value': {'key': 'value', 'type': '[Workbook]'}, 239 } 240 241 def __init__( 242 self, 243 *, 244 value: Optional[List["Workbook"]] = None, 245 **kwargs 246 ): 247 super(WorkbooksListResult, self).__init__(**kwargs) 248 self.value = value 249 250 251class WorkbookUpdateParameters(msrest.serialization.Model): 252 """The parameters that can be provided when updating workbook properties properties. 253 254 :param kind: The kind of workbook. Choices are user and shared. Possible values include: 255 "user", "shared". 256 :type kind: str or ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind 257 :param tags: A set of tags. Resource tags. 258 :type tags: dict[str, str] 259 :param display_name: The user-defined name (display name) of the workbook. 260 :type display_name: str 261 :param serialized_data: Configuration of this particular workbook. Configuration data is a 262 string containing valid JSON. 263 :type serialized_data: str 264 :param category: Workbook category, as defined by the user at creation time. 265 :type category: str 266 :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook 267 definition. 268 :type tags_properties_tags: list[str] 269 """ 270 271 _attribute_map = { 272 'kind': {'key': 'kind', 'type': 'str'}, 273 'tags': {'key': 'tags', 'type': '{str}'}, 274 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 275 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, 276 'category': {'key': 'properties.category', 'type': 'str'}, 277 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, 278 } 279 280 def __init__( 281 self, 282 *, 283 kind: Optional[Union[str, "SharedTypeKind"]] = None, 284 tags: Optional[Dict[str, str]] = None, 285 display_name: Optional[str] = None, 286 serialized_data: Optional[str] = None, 287 category: Optional[str] = None, 288 tags_properties_tags: Optional[List[str]] = None, 289 **kwargs 290 ): 291 super(WorkbookUpdateParameters, self).__init__(**kwargs) 292 self.kind = kind 293 self.tags = tags 294 self.display_name = display_name 295 self.serialized_data = serialized_data 296 self.category = category 297 self.tags_properties_tags = tags_properties_tags 298