Skip to content

Commit

Permalink
feat: Use 03-01 spec from azure-rest-api-specs repo to regenerate CLI (
Browse files Browse the repository at this point in the history
  • Loading branch information
blackchoey authored Apr 22, 2024
1 parent 6664704 commit 52f66c9
Show file tree
Hide file tree
Showing 39 changed files with 169 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The id of the API.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -61,6 +62,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the API Center service.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -71,6 +73,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down Expand Up @@ -106,8 +109,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.type = AAZStrArg(
options=["--type"],
arg_group="Properties",
required=True,
help="Type of API.",
required=True,
enum={"graphql": "graphql", "grpc": "grpc", "rest": "rest", "soap": "soap", "webhook": "webhook", "websocket": "websocket"},
)
_args_schema.license = AAZObjectArg(
Expand Down Expand Up @@ -309,7 +312,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})

properties = _builder.get(".properties")
if properties is not None:
Expand Down Expand Up @@ -379,7 +382,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
flags={"required": True, "client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -64,6 +65,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -75,6 +77,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="child_name_1",
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the API Center service.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -63,6 +64,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down Expand Up @@ -184,7 +186,7 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"read_only": True},
flags={"required": True, "read_only": True},
)

value = cls._schema_on_200.value
Expand All @@ -198,7 +200,7 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
flags={"required": True, "client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -63,6 +64,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -74,6 +76,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="child_name_1",
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down Expand Up @@ -193,7 +196,7 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
flags={"required": True, "client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -65,6 +66,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -75,6 +77,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down Expand Up @@ -465,7 +468,7 @@ def _update_instance(self, instance):
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})

properties = _builder.get(".properties")
if properties is not None:
Expand Down Expand Up @@ -544,7 +547,7 @@ def _build_schema_api_read(cls, _schema):
flags={"read_only": True},
)
api_read.properties = AAZObjectType(
flags={"client_flatten": True},
flags={"required": True, "client_flatten": True},
)
api_read.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The id of the API.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -58,6 +59,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The id of the API definition.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -70,6 +72,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the API Center service.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -79,6 +82,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The id of the API version.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -89,6 +93,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down Expand Up @@ -220,7 +225,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})

properties = _builder.get(".properties")
if properties is not None:
Expand Down Expand Up @@ -254,7 +259,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
flags={"required": True, "client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -61,6 +62,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_4",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -74,6 +76,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -84,6 +87,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_3",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -95,6 +99,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="child_name_1",
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -61,6 +62,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_4",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -74,6 +76,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -84,6 +87,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_3",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -95,6 +99,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="child_name_1",
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_2",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -64,6 +65,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_4",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -77,6 +79,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -87,6 +90,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_3",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand All @@ -98,6 +102,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="child_name_1",
default="default",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,90}$",
max_length=90,
min_length=1,
),
Expand Down
Loading

0 comments on commit 52f66c9

Please sign in to comment.