Skip to content

Commit

Permalink
replace with auto-generated parameter: --enable-ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiquanJiang-ms committed Jul 9, 2024
1 parent b1d1f78 commit 9681edf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
7 changes: 4 additions & 3 deletions src/acat/azext_acat/aaz/latest/acat/report/webhook/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="content type",
enum={"application/json": "application/json"},
)
_args_schema.enable_ssl_verification = AAZStrArg(
options=["--enable-ssl-verification-hidden"],
_args_schema.enable_ssl = AAZStrArg(
options=["--enable-ssl"],
arg_group="Properties",
help="whether to enable ssl verification",
default="true",
enum={"false": "false", "true": "true"},
)
_args_schema.events = AAZListArg(
Expand Down Expand Up @@ -210,7 +211,7 @@ def content(self):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("contentType", AAZStrType, ".content_type")
properties.set_prop("enableSslVerification", AAZStrType, ".enable_ssl_verification")
properties.set_prop("enableSslVerification", AAZStrType, ".enable_ssl")
properties.set_prop("events", AAZListType, ".events")
properties.set_prop("payloadUrl", AAZStrType, ".payload_url")
properties.set_prop("sendAllEvents", AAZStrType, ".send_all_events")
Expand Down
6 changes: 3 additions & 3 deletions src/acat/azext_acat/aaz/latest/acat/report/webhook/_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="content type",
enum={"application/json": "application/json"},
)
_args_schema.enable_ssl_verification = AAZStrArg(
options=["--enable-ssl-verification"],
_args_schema.enable_ssl = AAZStrArg(
options=["--enable-ssl"],
arg_group="Properties",
help="whether to enable ssl verification",
enum={"false": "false", "true": "true"},
Expand Down Expand Up @@ -210,7 +210,7 @@ def content(self):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("contentType", AAZStrType, ".content_type")
properties.set_prop("enableSslVerification", AAZStrType, ".enable_ssl_verification")
properties.set_prop("enableSslVerification", AAZStrType, ".enable_ssl")
properties.set_prop("events", AAZListType, ".events")
properties.set_prop("payloadUrl", AAZStrType, ".payload_url")
properties.set_prop("sendAllEvents", AAZStrType, ".send_all_events")
Expand Down
19 changes: 0 additions & 19 deletions src/acat/azext_acat/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ def _build_arguments_schema(cls, *args, **kwargs):

args_schema.content_type._required = False
args_schema.content_type._registered = False
args_schema.enable_ssl_verification._required = False
args_schema.enable_ssl_verification._registered = False
args_schema.events._required = False
args_schema.events._registered = False
args_schema.payload_url._required = False
Expand All @@ -378,13 +376,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
enum={"application/json": "application/json"},
default="application/json",
)
args_schema.enable_ssl_verification_with_default = AAZStrArg(
options=["--enable-ssl"],
arg_group="Properties",
help="whether to enable ssl verification",
enum={"false": "false", "true": "true"},
default="true",
)
args_schema.events_with_default = AAZListArg(
options=["--events"],
arg_group="Properties",
Expand Down Expand Up @@ -435,7 +426,6 @@ def pre_operations(self):

args = self.ctx.args
args.content_type = args.content_type_with_default
args.enable_ssl_verification = args.enable_ssl_verification_with_default
args.events = assign_aaz_list_arg(args.events, args.events_with_default)
args.payload_url = args.payload_url_required
args.webhook_key = args.webhook_key_with_default
Expand Down Expand Up @@ -467,8 +457,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
args_schema.send_all_events._registered = False
args_schema.webhook_key._required = False
args_schema.webhook_key._registered = False
args_schema.enable_ssl_verification._required = False
args_schema.enable_ssl_verification._registered = False
args_schema.events._required = False
args_schema.events._registered = False
args_schema.payload_url._required = False
Expand All @@ -484,12 +472,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="whether to send notification under any event.",
enum={"all": "true", "customize": "false"},
)
args_schema.enable_ssl_verification_with_default = AAZStrArg(
options=["--enable-ssl"],
arg_group="Properties",
help="whether to enable ssl verification",
enum={"false": "false", "true": "true"},
)
args_schema.events_with_default = AAZListArg(
options=["--events"],
arg_group="Properties",
Expand Down Expand Up @@ -537,7 +519,6 @@ def pre_operations(self):
from azure.cli.core.aaz.utils import assign_aaz_list_arg

args = self.ctx.args
args.enable_ssl_verification = args.enable_ssl_verification_with_default
args.events = assign_aaz_list_arg(args.events, args.events_with_default)
args.payload_url = args.payload_url_nullable
args.webhook_key = args.webhook_key_with_default
Expand Down

0 comments on commit 9681edf

Please sign in to comment.