-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Email services domain initiate and cancel verification changes (#7404)
* EmailServiceDomain Initiate and cancel verification * Email service domain initiate cancel verification changes version update * EmailServiceDomain Initiate and cancel verification - resolving version conflicts * EmailService Domain - Initiate and Cancel verification * Email Service -Domain - Sender username- Added examples * Email Service - updated list example command
- Loading branch information
1 parent
f4a404b
commit df3c3c3
Showing
91 changed files
with
10,971 additions
and
2,219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
200 changes: 200 additions & 0 deletions
200
...ication/azext_communication/aaz/latest/communication/email/domain/_cancel_verification.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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 aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
||
from azure.cli.core.aaz import * | ||
|
||
|
||
@register_command( | ||
"communication email domain cancel-verification", | ||
) | ||
class CancelVerification(AAZCommand): | ||
"""Cancel verification of DNS record. | ||
:example: Cancel Domain Verification | ||
az communication email domain cancel-verification --domain-name DomainName --email-service-name ResourceName -g ResourceGroup --verification-type Domain/SPF/DKIM/DKIM2 | ||
""" | ||
|
||
_aaz_info = { | ||
"version": "2023-04-01", | ||
"resources": [ | ||
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.communication/emailservices/{}/domains/{}/cancelverification", "2023-04-01"], | ||
] | ||
} | ||
|
||
AZ_SUPPORT_NO_WAIT = True | ||
|
||
def _handler(self, command_args): | ||
super()._handler(command_args) | ||
return self.build_lro_poller(self._execute_operations, None) | ||
|
||
_args_schema = None | ||
|
||
@classmethod | ||
def _build_arguments_schema(cls, *args, **kwargs): | ||
if cls._args_schema is not None: | ||
return cls._args_schema | ||
cls._args_schema = super()._build_arguments_schema(*args, **kwargs) | ||
|
||
# define Arg Group "" | ||
|
||
_args_schema = cls._args_schema | ||
_args_schema.domain_name = AAZStrArg( | ||
options=["--domain-name"], | ||
help="The name of the Domains resource.", | ||
required=True, | ||
id_part="child_name_1", | ||
fmt=AAZStrArgFormat( | ||
max_length=253, | ||
min_length=1, | ||
), | ||
) | ||
_args_schema.email_service_name = AAZStrArg( | ||
options=["--email-service-name"], | ||
help="The name of the EmailService resource.", | ||
required=True, | ||
id_part="name", | ||
fmt=AAZStrArgFormat( | ||
pattern="^[a-zA-Z0-9-]+$", | ||
max_length=63, | ||
min_length=1, | ||
), | ||
) | ||
_args_schema.resource_group = AAZResourceGroupNameArg( | ||
required=True, | ||
) | ||
|
||
# define Arg Group "Parameters" | ||
|
||
_args_schema = cls._args_schema | ||
_args_schema.verification_type = AAZStrArg( | ||
options=["--verification-type"], | ||
arg_group="Parameters", | ||
help="Type of verification.", | ||
required=True, | ||
enum={"DKIM": "DKIM", "DKIM2": "DKIM2", "DMARC": "DMARC", "Domain": "Domain", "SPF": "SPF"}, | ||
) | ||
return cls._args_schema | ||
|
||
def _execute_operations(self): | ||
self.pre_operations() | ||
yield self.DomainsCancelVerification(ctx=self.ctx)() | ||
self.post_operations() | ||
|
||
@register_callback | ||
def pre_operations(self): | ||
pass | ||
|
||
@register_callback | ||
def post_operations(self): | ||
pass | ||
|
||
class DomainsCancelVerification(AAZHttpOperation): | ||
CLIENT_TYPE = "MgmtClient" | ||
|
||
def __call__(self, *args, **kwargs): | ||
request = self.make_request() | ||
session = self.client.send_request(request=request, stream=False, **kwargs) | ||
if session.http_response.status_code in [202]: | ||
return self.client.build_lro_polling( | ||
self.ctx.args.no_wait, | ||
session, | ||
self.on_200_201, | ||
self.on_error, | ||
lro_options={"final-state-via": "location"}, | ||
path_format_arguments=self.url_parameters, | ||
) | ||
if session.http_response.status_code in [200, 201]: | ||
return self.client.build_lro_polling( | ||
self.ctx.args.no_wait, | ||
session, | ||
self.on_200_201, | ||
self.on_error, | ||
lro_options={"final-state-via": "location"}, | ||
path_format_arguments=self.url_parameters, | ||
) | ||
|
||
return self.on_error(session.http_response) | ||
|
||
@property | ||
def url(self): | ||
return self.client.format_url( | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/emailServices/{emailServiceName}/domains/{domainName}/cancelVerification", | ||
**self.url_parameters | ||
) | ||
|
||
@property | ||
def method(self): | ||
return "POST" | ||
|
||
@property | ||
def error_format(self): | ||
return "MgmtErrorFormat" | ||
|
||
@property | ||
def url_parameters(self): | ||
parameters = { | ||
**self.serialize_url_param( | ||
"domainName", self.ctx.args.domain_name, | ||
required=True, | ||
), | ||
**self.serialize_url_param( | ||
"emailServiceName", self.ctx.args.email_service_name, | ||
required=True, | ||
), | ||
**self.serialize_url_param( | ||
"resourceGroupName", self.ctx.args.resource_group, | ||
required=True, | ||
), | ||
**self.serialize_url_param( | ||
"subscriptionId", self.ctx.subscription_id, | ||
required=True, | ||
), | ||
} | ||
return parameters | ||
|
||
@property | ||
def query_parameters(self): | ||
parameters = { | ||
**self.serialize_query_param( | ||
"api-version", "2023-04-01", | ||
required=True, | ||
), | ||
} | ||
return parameters | ||
|
||
@property | ||
def header_parameters(self): | ||
parameters = { | ||
**self.serialize_header_param( | ||
"Content-Type", "application/json", | ||
), | ||
} | ||
return parameters | ||
|
||
@property | ||
def content(self): | ||
_content_value, _builder = self.new_content_builder( | ||
self.ctx.args, | ||
typ=AAZObjectType, | ||
typ_kwargs={"flags": {"required": True, "client_flatten": True}} | ||
) | ||
_builder.set_prop("verificationType", AAZStrType, ".verification_type", typ_kwargs={"flags": {"required": True}}) | ||
|
||
return self.serialize_content(_content_value) | ||
|
||
def on_200_201(self, session): | ||
pass | ||
|
||
|
||
class _CancelVerificationHelper: | ||
"""Helper class for CancelVerification""" | ||
|
||
|
||
__all__ = ["CancelVerification"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.