Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
# pylint: skip-file
# flake8: noqa

from ._clients import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# --------------------------------------------------------------------------------------------
# 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_client("AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClient_playwright_cli_extension")
class AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClient(AAZBaseClient):
_CLOUD_HOST_TEMPLATES = {
CloudNameEnum.AzureCloud: "https://{endpoint}",
}

_AAD_CREDENTIAL_SCOPES = [
"https://playwright.microsoft.com/.default",
]

@classmethod
def _build_base_url(cls, ctx, **kwargs):
endpoint = None
if not endpoint:
endpoint = cls._CLOUD_HOST_TEMPLATES.get(ctx.cli_ctx.cloud.name, None)
return endpoint

@classmethod
def _build_configuration(cls, ctx, credential, **kwargs):
return AAZClientConfiguration(
credential=credential,
credential_scopes=cls._AAD_CREDENTIAL_SCOPES,
**kwargs
)


class _AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClientHelper:
"""Helper class for AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClient"""


__all__ = [
"AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClient",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# 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_group(
"playwright-testing auth-manager",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Auth Manager
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# 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 .__cmd_group import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# 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_group(
"playwright-testing auth-manager account",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Account
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# --------------------------------------------------------------------------------------------
# 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 .__cmd_group import *
from ._show import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# --------------------------------------------------------------------------------------------
# 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(
"playwright-testing auth-manager account show",
)
class Show(AAZCommand):
"""Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.
"""

_aaz_info = {
"version": "2024-12-01",
"resources": [
["data-plane:microsoft.playwrighttesting.authmanager", "/accounts/{}", "2024-12-01"],
]
}

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return self._output()

_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 "Client"

_args_schema = cls._args_schema
_args_schema.endpoint = AAZStrArg(
options=["--endpoint"],
arg_group="Client",
help="Supported Azure Playwright Service API Endpoints.",
required=True,
)

# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.account_id = AAZStrArg(
options=["--account-id"],
help="The account id.",
required=True,
fmt=AAZStrArgFormat(
pattern="[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+",
max_length=64,
),
)
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
self.AccountsGet(ctx=self.ctx)()
self.post_operations()

@register_callback
def pre_operations(self):
pass

@register_callback
def post_operations(self):
pass

def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result

class AccountsGet(AAZHttpOperation):
CLIENT_TYPE = "AAZMicrosoftPlaywrighttestingAuthmanagerDataPlaneClient_playwright_cli_extension"

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 [200]:
return self.on_200(session)

return self.on_error(session.http_response)

@property
def url(self):
return self.client.format_url(
"/accounts/{accountId}",
**self.url_parameters
)

@property
def method(self):
return "GET"

@property
def error_format(self):
return "ODataV4Format"

@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"endpoint", self.ctx.args.endpoint,
skip_quote=True,
required=True,
),
**self.serialize_url_param(
"accountId", self.ctx.args.account_id,
required=True,
),
}
return parameters

@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-12-01",
required=True,
),
}
return parameters

@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters

def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)

_schema_on_200 = None

@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200

cls._schema_on_200 = AAZObjectType()

_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.local_auth = AAZStrType(
serialized_name="localAuth",
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.regional_affinity = AAZStrType(
serialized_name="regionalAffinity",
flags={"read_only": True},
)
_schema_on_200.reporting = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.resource_id = AAZStrType(
serialized_name="resourceId",
flags={"read_only": True},
)
_schema_on_200.scalable_execution = AAZStrType(
serialized_name="scalableExecution",
flags={"read_only": True},
)
_schema_on_200.state = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.subscription_id = AAZStrType(
serialized_name="subscriptionId",
flags={"read_only": True},
)
_schema_on_200.subscription_state = AAZStrType(
serialized_name="subscriptionState",
flags={"read_only": True},
)
_schema_on_200.tenant_id = AAZStrType(
serialized_name="tenantId",
flags={"read_only": True},
)

return cls._schema_on_200


class _ShowHelper:
"""Helper class for Show"""


__all__ = ["Show"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# 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_group(
"playwright-testing auth-manager account access-token",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Access Token
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# --------------------------------------------------------------------------------------------
# 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 .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
Loading
Loading