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
10
11from azure.core.exceptions import HttpResponseError
12import msrest.serialization
13
14
15class Resource(msrest.serialization.Model):
16    """Azure resource. This resource is tracked in Azure Resource Manager.
17
18    Variables are only populated by the server, and will be ignored when sending a request.
19
20    All required parameters must be populated in order to send to Azure.
21
22    :ivar id: Resource Id.
23    :vartype id: str
24    :ivar name: Resource Name.
25    :vartype name: str
26    :param kind: Kind of resource.
27    :type kind: str
28    :param location: Required. Resource Location.
29    :type location: str
30    :ivar type: Resource type.
31    :vartype type: str
32    :param tags: A set of tags. Resource tags.
33    :type tags: dict[str, str]
34    """
35
36    _validation = {
37        'id': {'readonly': True},
38        'name': {'readonly': True},
39        'location': {'required': True},
40        'type': {'readonly': True},
41    }
42
43    _attribute_map = {
44        'id': {'key': 'id', 'type': 'str'},
45        'name': {'key': 'name', 'type': 'str'},
46        'kind': {'key': 'kind', 'type': 'str'},
47        'location': {'key': 'location', 'type': 'str'},
48        'type': {'key': 'type', 'type': 'str'},
49        'tags': {'key': 'tags', 'type': '{str}'},
50    }
51
52    def __init__(
53        self,
54        *,
55        location: str,
56        kind: Optional[str] = None,
57        tags: Optional[Dict[str, str]] = None,
58        **kwargs
59    ):
60        super(Resource, self).__init__(**kwargs)
61        self.id = None
62        self.name = None
63        self.kind = kind
64        self.location = location
65        self.type = None
66        self.tags = tags
67
68
69class Certificate(Resource):
70    """SSL certificate for an app.
71
72    Variables are only populated by the server, and will be ignored when sending a request.
73
74    All required parameters must be populated in order to send to Azure.
75
76    :ivar id: Resource Id.
77    :vartype id: str
78    :ivar name: Resource Name.
79    :vartype name: str
80    :param kind: Kind of resource.
81    :type kind: str
82    :param location: Required. Resource Location.
83    :type location: str
84    :ivar type: Resource type.
85    :vartype type: str
86    :param tags: A set of tags. Resource tags.
87    :type tags: dict[str, str]
88    :ivar friendly_name: Friendly name of the certificate.
89    :vartype friendly_name: str
90    :ivar subject_name: Subject name of the certificate.
91    :vartype subject_name: str
92    :param host_names: Host names the certificate applies to.
93    :type host_names: list[str]
94    :param pfx_blob: Pfx blob.
95    :type pfx_blob: bytearray
96    :ivar site_name: App name.
97    :vartype site_name: str
98    :ivar self_link: Self link.
99    :vartype self_link: str
100    :ivar issuer: Certificate issuer.
101    :vartype issuer: str
102    :ivar issue_date: Certificate issue Date.
103    :vartype issue_date: ~datetime.datetime
104    :ivar expiration_date: Certificate expiration date.
105    :vartype expiration_date: ~datetime.datetime
106    :param password: Certificate password.
107    :type password: str
108    :ivar thumbprint: Certificate thumbprint.
109    :vartype thumbprint: str
110    :ivar valid: Is the certificate valid?.
111    :vartype valid: bool
112    :ivar cer_blob: Raw bytes of .cer file.
113    :vartype cer_blob: bytearray
114    :ivar public_key_hash: Public key hash.
115    :vartype public_key_hash: str
116    :ivar hosting_environment_profile: Specification for the App Service Environment to use for the
117     certificate.
118    :vartype hosting_environment_profile:
119     ~azure.mgmt.web.v2018_11_01.models.HostingEnvironmentProfile
120    :param key_vault_id: Key Vault Csm resource Id.
121    :type key_vault_id: str
122    :param key_vault_secret_name: Key Vault secret name.
123    :type key_vault_secret_name: str
124    :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include:
125     "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed",
126     "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault",
127     "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey",
128     "Unknown".
129    :vartype key_vault_secret_status: str or
130     ~azure.mgmt.web.v2018_11_01.models.KeyVaultSecretStatus
131    :param server_farm_id: Resource ID of the associated App Service plan, formatted as:
132     "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
133    :type server_farm_id: str
134    """
135
136    _validation = {
137        'id': {'readonly': True},
138        'name': {'readonly': True},
139        'location': {'required': True},
140        'type': {'readonly': True},
141        'friendly_name': {'readonly': True},
142        'subject_name': {'readonly': True},
143        'site_name': {'readonly': True},
144        'self_link': {'readonly': True},
145        'issuer': {'readonly': True},
146        'issue_date': {'readonly': True},
147        'expiration_date': {'readonly': True},
148        'thumbprint': {'readonly': True},
149        'valid': {'readonly': True},
150        'cer_blob': {'readonly': True},
151        'public_key_hash': {'readonly': True},
152        'hosting_environment_profile': {'readonly': True},
153        'key_vault_secret_status': {'readonly': True},
154    }
155
156    _attribute_map = {
157        'id': {'key': 'id', 'type': 'str'},
158        'name': {'key': 'name', 'type': 'str'},
159        'kind': {'key': 'kind', 'type': 'str'},
160        'location': {'key': 'location', 'type': 'str'},
161        'type': {'key': 'type', 'type': 'str'},
162        'tags': {'key': 'tags', 'type': '{str}'},
163        'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'},
164        'subject_name': {'key': 'properties.subjectName', 'type': 'str'},
165        'host_names': {'key': 'properties.hostNames', 'type': '[str]'},
166        'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'},
167        'site_name': {'key': 'properties.siteName', 'type': 'str'},
168        'self_link': {'key': 'properties.selfLink', 'type': 'str'},
169        'issuer': {'key': 'properties.issuer', 'type': 'str'},
170        'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'},
171        'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'},
172        'password': {'key': 'properties.password', 'type': 'str'},
173        'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
174        'valid': {'key': 'properties.valid', 'type': 'bool'},
175        'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'},
176        'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'},
177        'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'},
178        'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'},
179        'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'},
180        'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'},
181        'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'},
182    }
183
184    def __init__(
185        self,
186        *,
187        location: str,
188        kind: Optional[str] = None,
189        tags: Optional[Dict[str, str]] = None,
190        host_names: Optional[List[str]] = None,
191        pfx_blob: Optional[bytearray] = None,
192        password: Optional[str] = None,
193        key_vault_id: Optional[str] = None,
194        key_vault_secret_name: Optional[str] = None,
195        server_farm_id: Optional[str] = None,
196        **kwargs
197    ):
198        super(Certificate, self).__init__(kind=kind, location=location, tags=tags, **kwargs)
199        self.friendly_name = None
200        self.subject_name = None
201        self.host_names = host_names
202        self.pfx_blob = pfx_blob
203        self.site_name = None
204        self.self_link = None
205        self.issuer = None
206        self.issue_date = None
207        self.expiration_date = None
208        self.password = password
209        self.thumbprint = None
210        self.valid = None
211        self.cer_blob = None
212        self.public_key_hash = None
213        self.hosting_environment_profile = None
214        self.key_vault_id = key_vault_id
215        self.key_vault_secret_name = key_vault_secret_name
216        self.key_vault_secret_status = None
217        self.server_farm_id = server_farm_id
218
219
220class CertificateCollection(msrest.serialization.Model):
221    """Collection of certificates.
222
223    Variables are only populated by the server, and will be ignored when sending a request.
224
225    All required parameters must be populated in order to send to Azure.
226
227    :param value: Required. Collection of resources.
228    :type value: list[~azure.mgmt.web.v2018_11_01.models.Certificate]
229    :ivar next_link: Link to next page of resources.
230    :vartype next_link: str
231    """
232
233    _validation = {
234        'value': {'required': True},
235        'next_link': {'readonly': True},
236    }
237
238    _attribute_map = {
239        'value': {'key': 'value', 'type': '[Certificate]'},
240        'next_link': {'key': 'nextLink', 'type': 'str'},
241    }
242
243    def __init__(
244        self,
245        *,
246        value: List["Certificate"],
247        **kwargs
248    ):
249        super(CertificateCollection, self).__init__(**kwargs)
250        self.value = value
251        self.next_link = None
252
253
254class ProxyOnlyResource(msrest.serialization.Model):
255    """Azure proxy only resource. This resource is not tracked by Azure Resource Manager.
256
257    Variables are only populated by the server, and will be ignored when sending a request.
258
259    :ivar id: Resource Id.
260    :vartype id: str
261    :ivar name: Resource Name.
262    :vartype name: str
263    :param kind: Kind of resource.
264    :type kind: str
265    :ivar type: Resource type.
266    :vartype type: str
267    """
268
269    _validation = {
270        'id': {'readonly': True},
271        'name': {'readonly': True},
272        'type': {'readonly': True},
273    }
274
275    _attribute_map = {
276        'id': {'key': 'id', 'type': 'str'},
277        'name': {'key': 'name', 'type': 'str'},
278        'kind': {'key': 'kind', 'type': 'str'},
279        'type': {'key': 'type', 'type': 'str'},
280    }
281
282    def __init__(
283        self,
284        *,
285        kind: Optional[str] = None,
286        **kwargs
287    ):
288        super(ProxyOnlyResource, self).__init__(**kwargs)
289        self.id = None
290        self.name = None
291        self.kind = kind
292        self.type = None
293
294
295class CertificatePatchResource(ProxyOnlyResource):
296    """ARM resource for a certificate.
297
298    Variables are only populated by the server, and will be ignored when sending a request.
299
300    :ivar id: Resource Id.
301    :vartype id: str
302    :ivar name: Resource Name.
303    :vartype name: str
304    :param kind: Kind of resource.
305    :type kind: str
306    :ivar type: Resource type.
307    :vartype type: str
308    :ivar friendly_name: Friendly name of the certificate.
309    :vartype friendly_name: str
310    :ivar subject_name: Subject name of the certificate.
311    :vartype subject_name: str
312    :param host_names: Host names the certificate applies to.
313    :type host_names: list[str]
314    :param pfx_blob: Pfx blob.
315    :type pfx_blob: bytearray
316    :ivar site_name: App name.
317    :vartype site_name: str
318    :ivar self_link: Self link.
319    :vartype self_link: str
320    :ivar issuer: Certificate issuer.
321    :vartype issuer: str
322    :ivar issue_date: Certificate issue Date.
323    :vartype issue_date: ~datetime.datetime
324    :ivar expiration_date: Certificate expiration date.
325    :vartype expiration_date: ~datetime.datetime
326    :param password: Certificate password.
327    :type password: str
328    :ivar thumbprint: Certificate thumbprint.
329    :vartype thumbprint: str
330    :ivar valid: Is the certificate valid?.
331    :vartype valid: bool
332    :ivar cer_blob: Raw bytes of .cer file.
333    :vartype cer_blob: bytearray
334    :ivar public_key_hash: Public key hash.
335    :vartype public_key_hash: str
336    :ivar hosting_environment_profile: Specification for the App Service Environment to use for the
337     certificate.
338    :vartype hosting_environment_profile:
339     ~azure.mgmt.web.v2018_11_01.models.HostingEnvironmentProfile
340    :param key_vault_id: Key Vault Csm resource Id.
341    :type key_vault_id: str
342    :param key_vault_secret_name: Key Vault secret name.
343    :type key_vault_secret_name: str
344    :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include:
345     "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed",
346     "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault",
347     "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey",
348     "Unknown".
349    :vartype key_vault_secret_status: str or
350     ~azure.mgmt.web.v2018_11_01.models.KeyVaultSecretStatus
351    :param server_farm_id: Resource ID of the associated App Service plan, formatted as:
352     "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
353    :type server_farm_id: str
354    """
355
356    _validation = {
357        'id': {'readonly': True},
358        'name': {'readonly': True},
359        'type': {'readonly': True},
360        'friendly_name': {'readonly': True},
361        'subject_name': {'readonly': True},
362        'site_name': {'readonly': True},
363        'self_link': {'readonly': True},
364        'issuer': {'readonly': True},
365        'issue_date': {'readonly': True},
366        'expiration_date': {'readonly': True},
367        'thumbprint': {'readonly': True},
368        'valid': {'readonly': True},
369        'cer_blob': {'readonly': True},
370        'public_key_hash': {'readonly': True},
371        'hosting_environment_profile': {'readonly': True},
372        'key_vault_secret_status': {'readonly': True},
373    }
374
375    _attribute_map = {
376        'id': {'key': 'id', 'type': 'str'},
377        'name': {'key': 'name', 'type': 'str'},
378        'kind': {'key': 'kind', 'type': 'str'},
379        'type': {'key': 'type', 'type': 'str'},
380        'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'},
381        'subject_name': {'key': 'properties.subjectName', 'type': 'str'},
382        'host_names': {'key': 'properties.hostNames', 'type': '[str]'},
383        'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'},
384        'site_name': {'key': 'properties.siteName', 'type': 'str'},
385        'self_link': {'key': 'properties.selfLink', 'type': 'str'},
386        'issuer': {'key': 'properties.issuer', 'type': 'str'},
387        'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'},
388        'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'},
389        'password': {'key': 'properties.password', 'type': 'str'},
390        'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
391        'valid': {'key': 'properties.valid', 'type': 'bool'},
392        'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'},
393        'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'},
394        'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'},
395        'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'},
396        'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'},
397        'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'},
398        'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'},
399    }
400
401    def __init__(
402        self,
403        *,
404        kind: Optional[str] = None,
405        host_names: Optional[List[str]] = None,
406        pfx_blob: Optional[bytearray] = None,
407        password: Optional[str] = None,
408        key_vault_id: Optional[str] = None,
409        key_vault_secret_name: Optional[str] = None,
410        server_farm_id: Optional[str] = None,
411        **kwargs
412    ):
413        super(CertificatePatchResource, self).__init__(kind=kind, **kwargs)
414        self.friendly_name = None
415        self.subject_name = None
416        self.host_names = host_names
417        self.pfx_blob = pfx_blob
418        self.site_name = None
419        self.self_link = None
420        self.issuer = None
421        self.issue_date = None
422        self.expiration_date = None
423        self.password = password
424        self.thumbprint = None
425        self.valid = None
426        self.cer_blob = None
427        self.public_key_hash = None
428        self.hosting_environment_profile = None
429        self.key_vault_id = key_vault_id
430        self.key_vault_secret_name = key_vault_secret_name
431        self.key_vault_secret_status = None
432        self.server_farm_id = server_farm_id
433
434
435class DefaultErrorResponse(msrest.serialization.Model):
436    """App Service error response.
437
438    Variables are only populated by the server, and will be ignored when sending a request.
439
440    :ivar error: Error model.
441    :vartype error: ~azure.mgmt.web.v2018_11_01.models.DefaultErrorResponseError
442    """
443
444    _validation = {
445        'error': {'readonly': True},
446    }
447
448    _attribute_map = {
449        'error': {'key': 'error', 'type': 'DefaultErrorResponseError'},
450    }
451
452    def __init__(
453        self,
454        **kwargs
455    ):
456        super(DefaultErrorResponse, self).__init__(**kwargs)
457        self.error = None
458
459
460class DefaultErrorResponseError(msrest.serialization.Model):
461    """Error model.
462
463    Variables are only populated by the server, and will be ignored when sending a request.
464
465    :ivar code: Standardized string to programmatically identify the error.
466    :vartype code: str
467    :ivar message: Detailed error description and debugging information.
468    :vartype message: str
469    :ivar target: Detailed error description and debugging information.
470    :vartype target: str
471    :param details:
472    :type details: list[~azure.mgmt.web.v2018_11_01.models.DefaultErrorResponseErrorDetailsItem]
473    :ivar innererror: More information to debug error.
474    :vartype innererror: str
475    """
476
477    _validation = {
478        'code': {'readonly': True},
479        'message': {'readonly': True},
480        'target': {'readonly': True},
481        'innererror': {'readonly': True},
482    }
483
484    _attribute_map = {
485        'code': {'key': 'code', 'type': 'str'},
486        'message': {'key': 'message', 'type': 'str'},
487        'target': {'key': 'target', 'type': 'str'},
488        'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'},
489        'innererror': {'key': 'innererror', 'type': 'str'},
490    }
491
492    def __init__(
493        self,
494        *,
495        details: Optional[List["DefaultErrorResponseErrorDetailsItem"]] = None,
496        **kwargs
497    ):
498        super(DefaultErrorResponseError, self).__init__(**kwargs)
499        self.code = None
500        self.message = None
501        self.target = None
502        self.details = details
503        self.innererror = None
504
505
506class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model):
507    """Detailed errors.
508
509    Variables are only populated by the server, and will be ignored when sending a request.
510
511    :ivar code: Standardized string to programmatically identify the error.
512    :vartype code: str
513    :ivar message: Detailed error description and debugging information.
514    :vartype message: str
515    :ivar target: Detailed error description and debugging information.
516    :vartype target: str
517    """
518
519    _validation = {
520        'code': {'readonly': True},
521        'message': {'readonly': True},
522        'target': {'readonly': True},
523    }
524
525    _attribute_map = {
526        'code': {'key': 'code', 'type': 'str'},
527        'message': {'key': 'message', 'type': 'str'},
528        'target': {'key': 'target', 'type': 'str'},
529    }
530
531    def __init__(
532        self,
533        **kwargs
534    ):
535        super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs)
536        self.code = None
537        self.message = None
538        self.target = None
539
540
541class HostingEnvironmentProfile(msrest.serialization.Model):
542    """Specification for an App Service Environment to use for this resource.
543
544    Variables are only populated by the server, and will be ignored when sending a request.
545
546    :param id: Resource ID of the App Service Environment.
547    :type id: str
548    :ivar name: Name of the App Service Environment.
549    :vartype name: str
550    :ivar type: Resource type of the App Service Environment.
551    :vartype type: str
552    """
553
554    _validation = {
555        'name': {'readonly': True},
556        'type': {'readonly': True},
557    }
558
559    _attribute_map = {
560        'id': {'key': 'id', 'type': 'str'},
561        'name': {'key': 'name', 'type': 'str'},
562        'type': {'key': 'type', 'type': 'str'},
563    }
564
565    def __init__(
566        self,
567        *,
568        id: Optional[str] = None,
569        **kwargs
570    ):
571        super(HostingEnvironmentProfile, self).__init__(**kwargs)
572        self.id = id
573        self.name = None
574        self.type = None
575