Skip to content

Commit

Permalink
Merge pull request #25 from tbyfield/amlim/fixStyle
Browse files Browse the repository at this point in the history
Fix style and lint errors
  • Loading branch information
am-lim authored Jan 5, 2023
2 parents c9d8399 + 6a3e85f commit 3106642
Show file tree
Hide file tree
Showing 8 changed files with 616 additions and 428 deletions.
14 changes: 9 additions & 5 deletions src/devcenter/azext_devcenter/manual/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .helper import get_project_data
from .helper import get_project_data

def cf_devcenter_dataplane(cli_ctx, dev_center, project_name=None, *_):

def cf_devcenter_dataplane(cli_ctx, dev_center, *_, project_name=None):

from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_devcenter.vendored_sdks.devcenter_dataplane import (
DevCenterDataplaneClient,
)

project = get_project_data(cli_ctx, dev_center, project_name)
endpoint = project.endpoint

# We need to set the project name even if we don't need this information
# since initializing DevCenterDataplaneClient requires this param
if project_name is None:
project_name = project.name
project_name = project["name"]
endpoint = project["devCenterUri"]

cli_ctx.cloud.endpoints.active_directory_resource_id = "https://devcenter.azure.com"

Expand All @@ -31,9 +33,10 @@ def cf_devcenter_dataplane(cli_ctx, dev_center, project_name=None, *_):
subscription_bound=False,
base_url_bound=False,
endpoint=endpoint,
project_name=project_name
project_name=project_name,
)


def cf_project_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).project

Expand Down Expand Up @@ -69,5 +72,6 @@ def cf_catalog_item_version_dp(cli_ctx, dev_center, *_):
def cf_environment_type_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).environment_type


def cf_notification_setting_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).notification_setting
76 changes: 57 additions & 19 deletions src/devcenter/azext_devcenter/manual/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@
--project-name "{projectName}"
"""

helps['devcenter dev notification-setting show'] = """
helps[
"devcenter dev notification-setting show"
] = """
type: command
short-summary: "Gets notification settings for user in the project."
examples:
Expand All @@ -479,7 +481,9 @@
az devcenter dev notification-setting show --user-id "me"
"""

helps['devcenter dev notification-setting create'] = """
helps[
"devcenter dev notification-setting create"
] = """
type: command
short-summary: "Creates or updates notification settings."
parameters:
Expand All @@ -506,7 +510,9 @@
--webhook-notification enabled=false url="https://fake.domain/url/hook" --user-id "me"
"""

helps['devcenter dev notification-setting list-allowed-culture'] = """
helps[
"devcenter dev notification-setting list-allowed-culture"
] = """
type: command
short-summary: "Lists allowed culture codes for notification settings."
examples:
Expand Down Expand Up @@ -861,7 +867,9 @@
short-summary: Manage environment types for a given project
"""

helps['devcenter admin project-environment-type list'] = """
helps[
"devcenter admin project-environment-type list"
] = """
type: command
short-summary: "Lists environment types for a project."
examples:
Expand All @@ -870,7 +878,9 @@
az devcenter admin project-environment-type list --project-name "ContosoProj" --resource-group "rg1"
"""

helps['devcenter admin project-environment-type show'] = """
helps[
"devcenter admin project-environment-type show"
] = """
type: command
short-summary: "Gets a project environment type."
examples:
Expand All @@ -880,7 +890,9 @@
--project-name "ContosoProj" --resource-group "rg1"
"""

helps['devcenter admin project-environment-type create'] = """
helps[
"devcenter admin project-environment-type create"
] = """
type: command
short-summary: "Create a project environment type."
examples:
Expand All @@ -895,7 +907,9 @@
--resource-group "rg1"
"""

helps['devcenter admin project-environment-type update'] = """
helps[
"devcenter admin project-environment-type update"
] = """
type: command
short-summary: "Partially updates a project environment type."
examples:
Expand All @@ -910,7 +924,9 @@
"""


helps['devcenter admin project-environment-type delete'] = """
helps[
"devcenter admin project-environment-type delete"
] = """
type: command
short-summary: "Deletes a project environment type."
examples:
Expand Down Expand Up @@ -1101,7 +1117,9 @@
short-summary: Manage dev box definition with devcenter
"""

helps['devcenter admin devbox-definition list'] = """
helps[
"devcenter admin devbox-definition list"
] = """
type: command
short-summary: "List dev box definitions for a dev center or for a project."
examples:
Expand All @@ -1113,7 +1131,9 @@
az devcenter admin devbox-definition list --project-name "ContosoProject" --resource-group "rg1"
"""

helps['devcenter admin devbox-definition show'] = """
helps[
"devcenter admin devbox-definition show"
] = """
type: command
short-summary: "Gets a dev box definition for a dev center or for a project."
examples:
Expand All @@ -1127,7 +1147,9 @@
--resource-group "rg1"
"""

helps['devcenter admin devbox-definition create'] = """
helps[
"devcenter admin devbox-definition create"
] = """
type: command
short-summary: "Create a dev box definition."
parameters:
Expand Down Expand Up @@ -1163,7 +1185,9 @@
--sku name="Preview" --name "WebDevBox" --dev-center-name "Contoso" --resource-group "rg1"
"""

helps['devcenter admin devbox-definition update'] = """
helps[
"devcenter admin devbox-definition update"
] = """
type: command
short-summary: "Partially updates a dev box definition."
parameters:
Expand Down Expand Up @@ -1248,12 +1272,16 @@
az devcenter admin usage list --location "westus"
"""

helps['devcenter admin check-name-availability'] = """
helps[
"devcenter admin check-name-availability"
] = """
type: group
short-summary: Manage check name availability with devcenter.
"""

helps['devcenter admin check-name-availability execute'] = """
helps[
"devcenter admin check-name-availability execute"
] = """
type: command
short-summary: "Check the availability of name for resource."
examples:
Expand All @@ -1262,12 +1290,16 @@
az devcenter check-name-availability execute --name "name1" --type "Microsoft.DevCenter/devcenters"
"""

helps['devcenter admin operation-statuses'] = """
helps[
"devcenter admin operation-statuses"
] = """
type: group
short-summary: Manage operation statuses with devcenter
"""

helps['devcenter admin operation-statuses show'] = """
helps[
"devcenter admin operation-statuses show"
] = """
type: command
short-summary: "Gets the current status of an async operation."
examples:
Expand All @@ -1276,12 +1308,16 @@
az devcenter admin operation-statuses show --operation-id "{operationId}" --location "{location}"
"""

helps['devcenter admin sku'] = """
helps[
"devcenter admin sku"
] = """
type: group
short-summary: Manage sku with devcenter
"""

helps['devcenter admin sku list'] = """
helps[
"devcenter admin sku list"
] = """
type: command
short-summary: "Lists the Microsoft.DevCenter SKUs available in a subscription."
examples:
Expand Down Expand Up @@ -1527,7 +1563,9 @@
az devcenter admin network-connection delete --name "{networkConnectionName}" --resource-group "rg1"
"""

helps['devcenter admin network-connection list-health-detail'] = """
helps[
"devcenter admin network-connection list-health-detail"
] = """
type: command
short-summary: "Lists health check status details."
examples:
Expand Down
Loading

0 comments on commit 3106642

Please sign in to comment.