From af0b5704f150fdc10081c07f1353b395257dcea3 Mon Sep 17 00:00:00 2001 From: Derek Bekoe Date: Thu, 16 Jul 2020 08:07:04 -0700 Subject: [PATCH] [Codespaces] Update to new Microsoft.Codespaces RP (#2011) * [Codespaces] Update to new Microsoft.Codespaces RP * fix one place where old property was being used --- src/codespaces/HISTORY.rst | 4 + src/codespaces/README.rst | 2 +- .../azext_codespaces/_client_factory.py | 4 +- src/codespaces/azext_codespaces/_help.py | 12 +- src/codespaces/azext_codespaces/commands.py | 2 +- src/codespaces/azext_codespaces/custom.py | 67 ++-- .../latest/recordings/test_codespaces.yaml | 47 --- .../recordings/test_codespaces_location.yaml | 93 ++++++ .../recordings/test_codespaces_plan.yaml | 292 ++++++++++++++++++ .../tests/latest/test_codespaces_scenario.py | 52 +++- .../{vsonline => codespaces}/__init__.py | 4 +- .../codespaces_client.py} | 24 +- .../codespaces/models/__init__.py | 72 +++++ .../models/codespaces_client_enums.py} | 0 ...ces_delegate_access_token_request_body.py} | 28 +- ...delegate_access_token_request_body_py3.py} | 28 +- .../models/codespaces_delegate_identity.py} | 4 +- .../codespaces_delegate_identity_py3.py} | 4 +- .../codespaces_operations_error_response.py} | 12 +- ...despaces_operations_error_response_py3.py} | 12 +- .../models/codespaces_plan.py} | 34 +- .../models/codespaces_plan_access_token.py} | 8 +- .../codespaces_plan_access_token_py3.py} | 8 +- .../models/codespaces_plan_error_response.py} | 12 +- .../codespaces_plan_error_response_py3.py} | 12 +- .../models/codespaces_plan_paged.py} | 8 +- .../models/codespaces_plan_properties.py | 41 +++ .../models/codespaces_plan_properties_py3.py | 41 +++ .../models/codespaces_plan_py3.py} | 36 +-- .../codespaces_plan_update_parameters.py} | 16 +- ...aces_plan_update_parameters_properties.py} | 24 +- ..._plan_update_parameters_properties_py3.py} | 26 +- .../codespaces_plan_update_parameters_py3.py} | 16 +- .../models/error_definition.py | 4 +- .../models/error_definition_py3.py | 4 +- .../models/identity.py} | 20 +- .../models/identity_py3.py} | 22 +- .../models/resource.py | 2 +- .../resource_provider_operation_definition.py | 3 +- ...rce_provider_operation_definition_paged.py | 2 +- ...ource_provider_operation_definition_py3.py | 3 +- .../resource_provider_operation_display.py | 0 ...resource_provider_operation_display_py3.py | 0 .../models/resource_py3.py | 2 +- .../{vsonline => codespaces}/models/sku.py | 8 +- .../models/sku_py3.py | 8 +- .../models/vnet_properties.py | 11 +- .../models/vnet_properties_py3.py | 11 +- .../operations/__init__.py | 0 .../operations/operations.py | 12 +- .../operations/plan_operations.py | 250 +++++++-------- .../{vsonline => codespaces}/version.py | 2 +- .../vendored_sdks/vsonline/models/__init__.py | 75 ----- .../models/vs_online_plan_properties.py | 56 ---- .../models/vs_online_plan_properties_py3.py | 56 ---- .../models/vso_account_update_parameters.py | 32 -- .../vso_account_update_parameters_py3.py | 32 -- src/codespaces/azext_codespaces/version.py | 2 +- 58 files changed, 968 insertions(+), 694 deletions(-) delete mode 100644 src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces.yaml create mode 100644 src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_location.yaml create mode 100644 src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_plan.yaml rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/__init__.py (86%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/vs_online_client.py => codespaces/codespaces_client.py} (79%) create mode 100644 src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/__init__.py rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_client_enums.py => codespaces/models/codespaces_client_enums.py} (100%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_delegate_access_token_request_body.py => codespaces/models/codespaces_delegate_access_token_request_body.py} (59%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_delegate_access_token_request_body_py3.py => codespaces/models/codespaces_delegate_access_token_request_body_py3.py} (59%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_delegate_identity.py => codespaces/models/codespaces_delegate_identity.py} (93%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_delegate_identity_py3.py => codespaces/models/codespaces_delegate_identity_py3.py} (93%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_account_error_response.py => codespaces/models/codespaces_operations_error_response.py} (68%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_error_response_py3.py => codespaces/models/codespaces_operations_error_response_py3.py} (68%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan.py => codespaces/models/codespaces_plan.py} (62%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_access_token.py => codespaces/models/codespaces_plan_access_token.py} (79%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_access_token_py3.py => codespaces/models/codespaces_plan_access_token_py3.py} (79%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_error_response.py => codespaces/models/codespaces_plan_error_response.py} (70%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_account_error_response_py3.py => codespaces/models/codespaces_plan_error_response_py3.py} (70%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_paged.py => codespaces/models/codespaces_plan_paged.py} (68%) create mode 100644 src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties.py create mode 100644 src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties_py3.py rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_py3.py => codespaces/models/codespaces_plan_py3.py} (59%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_update_parameters.py => codespaces/models/codespaces_plan_update_parameters.py} (64%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_update_parameters_properties.py => codespaces/models/codespaces_plan_update_parameters_properties.py} (61%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_update_parameters_properties_py3.py => codespaces/models/codespaces_plan_update_parameters_properties_py3.py} (59%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vso_plan_update_parameters_py3.py => codespaces/models/codespaces_plan_update_parameters_py3.py} (64%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/error_definition.py (94%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/error_definition_py3.py (94%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_info.py => codespaces/models/identity.py} (58%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline/models/vs_online_plan_info_py3.py => codespaces/models/identity_py3.py} (54%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource.py (97%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_provider_operation_definition.py (92%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_provider_operation_definition_paged.py (89%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_provider_operation_definition_py3.py (92%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_provider_operation_display.py (100%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_provider_operation_display_py3.py (100%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/resource_py3.py (97%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/sku.py (81%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/sku_py3.py (81%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/vnet_properties.py (80%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/models/vnet_properties_py3.py (80%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/operations/__init__.py (100%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/operations/operations.py (86%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/operations/plan_operations.py (73%) rename src/codespaces/azext_codespaces/vendored_sdks/{vsonline => codespaces}/version.py (93%) delete mode 100644 src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/__init__.py delete mode 100644 src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties.py delete mode 100644 src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties_py3.py delete mode 100644 src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters.py delete mode 100644 src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters_py3.py diff --git a/src/codespaces/HISTORY.rst b/src/codespaces/HISTORY.rst index 57839604942..2cf797cc351 100644 --- a/src/codespaces/HISTORY.rst +++ b/src/codespaces/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.0 +++++++ +* Switch to new Resource Provider - Microsoft.Codespaces + 0.2.1 ++++++ * Added 60 minute auto-suspend timeout option diff --git a/src/codespaces/README.rst b/src/codespaces/README.rst index 2e81c8ed2a5..2d9893a9c27 100644 --- a/src/codespaces/README.rst +++ b/src/codespaces/README.rst @@ -9,7 +9,7 @@ Updating the vendored SDK ------------------------- ``` -cd /specification/vsonline/resource-manager +cd specification/codespaces/resource-manager autorest --python readme.md ``` diff --git a/src/codespaces/azext_codespaces/_client_factory.py b/src/codespaces/azext_codespaces/_client_factory.py index e6fc64259f8..cb0342aa77a 100644 --- a/src/codespaces/azext_codespaces/_client_factory.py +++ b/src/codespaces/azext_codespaces/_client_factory.py @@ -8,9 +8,9 @@ def cf_codespaces(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from .vendored_sdks.vsonline.vs_online_client import VSOnlineClient + from .vendored_sdks.codespaces.codespaces_client import CodespacesClient custom_api_version = get_rp_api_version(cli_ctx) - return get_mgmt_service_client(cli_ctx, VSOnlineClient, api_version=custom_api_version) + return get_mgmt_service_client(cli_ctx, CodespacesClient, api_version=custom_api_version) def cf_codespaces_plan(cli_ctx, *_): diff --git a/src/codespaces/azext_codespaces/_help.py b/src/codespaces/azext_codespaces/_help.py index 889e71dcc64..f8aad1bf80d 100644 --- a/src/codespaces/azext_codespaces/_help.py +++ b/src/codespaces/azext_codespaces/_help.py @@ -107,7 +107,7 @@ - name: List Codespaces text: az codespace list -g my-rg --plan my-plan - name: List Codespaces given plan id - text: az codespace list --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan + text: az codespace list --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan """ helps['codespace delete'] = """ @@ -119,7 +119,7 @@ - name: Delete a Codespace given id text: az codespace delete -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000 - name: Delete a Codespace given plan id and Codespace name - text: az codespace delete --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan --name my-codespace + text: az codespace delete --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace """ helps['codespace update'] = """ @@ -141,7 +141,7 @@ - name: Show details of a Codespace given id text: az codespace show -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000 - name: Show details of a Codespace given plan id and Codespace name - text: az codespace show --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan --name my-codespace + text: az codespace show --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace """ helps['codespace resume'] = """ @@ -153,7 +153,7 @@ - name: Resume a Codespace given id text: az codespace resume -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000 - name: Resume a Codespace given plan id and Codespace name - text: az codespace resume --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan --name my-codespace + text: az codespace resume --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace """ helps['codespace suspend'] = """ @@ -165,7 +165,7 @@ - name: Suspend a Codespace given id text: az codespace suspend -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000 - name: Suspend a Codespace given plan id and Codespace name - text: az codespace suspend --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan --name my-codespace + text: az codespace suspend --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace """ helps['codespace open'] = """ @@ -179,7 +179,7 @@ - name: Open a Codespace given id text: az codespace open -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000 - name: Open a Codespace given plan id and Codespace name - text: az codespace open --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.VSOnline/plans/my-plan --name my-codespace + text: az codespace open --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace """ helps['codespace secret create'] = """ diff --git a/src/codespaces/azext_codespaces/commands.py b/src/codespaces/azext_codespaces/commands.py index 5323e094092..daaa55dd558 100644 --- a/src/codespaces/azext_codespaces/commands.py +++ b/src/codespaces/azext_codespaces/commands.py @@ -21,7 +21,7 @@ def advanced_usage_message(_): def load_command_table(self, _): plan_operations = CliCommandType( - operations_tmpl='azext_codespaces.vendored_sdks.vsonline.operations.plan_operations#PlanOperations.{}', + operations_tmpl='azext_codespaces.vendored_sdks.codespaces.operations.plan_operations#PlanOperations.{}', client_factory=cf_codespaces) with self.command_group('codespace plan', plan_operations, client_factory=cf_codespaces_plan) as g: diff --git a/src/codespaces/azext_codespaces/custom.py b/src/codespaces/azext_codespaces/custom.py index 31d4d4d6e18..e385d486b85 100644 --- a/src/codespaces/azext_codespaces/custom.py +++ b/src/codespaces/azext_codespaces/custom.py @@ -8,11 +8,11 @@ from knack.prompting import prompt_y_n from . import _non_arm_apis as cs_api from . import _config as cs_config -from .vendored_sdks.vsonline.models import ( - VSOnlinePlan, - VSOnlinePlanProperties, +from .vendored_sdks.codespaces.models import ( + CodespacesPlan, + CodespacesPlanProperties, VnetProperties, - VSOPlanUpdateParametersProperties) + CodespacesPlanUpdateParametersProperties) logger = get_logger(__name__) @@ -44,30 +44,13 @@ def create_plan(cmd, subnet_id=None, default_sku_name=None, default_autoshutdown_delay=None): - import jwt # pylint: disable=import-error - from azure.cli.core._profile import Profile - profile = Profile(cli_ctx=cmd.cli_ctx) - creds, _, __ = profile.get_raw_token() - tokenType = creds[0] - accessToken = creds[1] - if tokenType != "Bearer": - logger.debug("Got unexpected token type: %s", tokenType) - raise CLIError("Unable to create plan. Use --debug for details.") - decoded_token = jwt.decode(accessToken, verify=False, algorithms=['RS256']) - tid = decoded_token.get('tid') - oid = decoded_token.get('oid') - if not tid or not oid: - logger.debug("Unable to determine 'tid' and 'oid' from token claims: %s", decoded_token) - raise CLIError("Unable to create plan. Use --debug for details.") - user_id = f"{tid}_{oid}" vnet_props = VnetProperties(subnet_id=subnet_id) if subnet_id else None - plan_props = VSOnlinePlanProperties( - user_id=user_id, + plan_props = CodespacesPlanProperties( default_auto_suspend_delay_minutes=default_autoshutdown_delay, - default_environment_sku=default_sku_name, + default_codespace_sku=default_sku_name, vnet_properties=vnet_props) - vsonline_plan = VSOnlinePlan(location=location, properties=plan_props, tags=tags) - return client.create(resource_group_name, plan_name, vsonline_plan) + codespaces_plan = CodespacesPlan(location=location, properties=plan_props, tags=tags) + return client.create(resource_group_name, plan_name, codespaces_plan) def update_plan(cmd, @@ -76,12 +59,12 @@ def update_plan(cmd, resource_group_name=None, default_sku_name=None, default_autoshutdown_delay=None): - vsonline_plan_update_parameters = VSOPlanUpdateParametersProperties( + codespaces_plan_update_parameters = CodespacesPlanUpdateParametersProperties( default_auto_suspend_delay_minutes=default_autoshutdown_delay, - default_environment_sku=default_sku_name) + default_codespace_sku=default_sku_name) return client.update(resource_group_name, plan_name, - vsonline_plan_update_parameters) + codespaces_plan_update_parameters) def list_available_locations(cmd): @@ -95,9 +78,9 @@ def get_location_details(cmd, location_name): def list_codespaces(cmd, client, plan_name, resource_group_name=None, list_all=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) if list_all: - token = client.read_all_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.read_all_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) else: - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) return cs_api.list_codespaces(token.access_token, plan.id, cli_ctx=cmd.cli_ctx) @@ -115,10 +98,10 @@ def create_codespace(cmd, dotfiles_path=None, dotfiles_command=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) # Use plan defaults if needed and available missing_args = [] - sku_name = sku_name or plan.properties.default_environment_sku + sku_name = sku_name or plan.properties.default_codespace_sku if not sku_name: logger.warning("No default instance type specified for plan and no instance type specified in command.") missing_args.append("--instance-type") @@ -155,7 +138,7 @@ def create_codespace(cmd, def get_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id=None, codespace_name=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -163,7 +146,7 @@ def get_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id def delete_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id=None, codespace_name=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -171,7 +154,7 @@ def delete_codespace(cmd, client, plan_name, resource_group_name=None, codespace def resume_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id=None, codespace_name=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -179,7 +162,7 @@ def resume_codespace(cmd, client, plan_name, resource_group_name=None, codespace def suspend_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id=None, codespace_name=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -194,7 +177,7 @@ def update_codespace(cmd, codespace_name=None, sku_name=None, autoshutdown_delay=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -212,7 +195,7 @@ def update_codespace(cmd, def open_codespace(cmd, client, plan_name, resource_group_name=None, codespace_id=None, codespace_name=None, do_not_prompt=None): - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) if codespace_name: codespace_id = _determine_codespace_id( client, resource_group_name, plan_name, token, codespace_name, cli_ctx=cmd.cli_ctx) @@ -244,7 +227,7 @@ def show_config(cmd): def list_plan_secrets(cmd, client, plan_name, resource_group_name=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) return cs_api.list_secrets(token.access_token, plan.id, cli_ctx=cmd.cli_ctx) @@ -252,7 +235,7 @@ def update_plan_secrets(cmd, client, plan_name, secret_id, secret_name=None, secret_value=None, secret_note=None, secret_filters=None, resource_group_name=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) data = {} data['secretName'] = secret_name data['value'] = secret_value @@ -266,7 +249,7 @@ def create_plan_secret(cmd, client, plan_name, secret_name, secret_value, secret_note=None, secret_filters=None, resource_group_name=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) data = {} data['secretName'] = secret_name data['value'] = secret_value @@ -279,5 +262,5 @@ def create_plan_secret(cmd, client, plan_name, def delete_plan_secret(cmd, client, plan_name, secret_id, resource_group_name=None): plan = client.get(resource_group_name=resource_group_name, plan_name=plan_name) - token = client.write_environments_action(resource_group_name=resource_group_name, plan_name=plan_name) + token = client.write_codespaces_action(resource_group_name=resource_group_name, plan_name=plan_name) cs_api.delete_secret(token.access_token, plan.id, secret_id, cs_api.SecretScope.USER.value, cli_ctx=cmd.cli_ctx) diff --git a/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces.yaml b/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces.yaml deleted file mode 100644 index 3be21270e70..00000000000 --- a/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces.yaml +++ /dev/null @@ -1,47 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - codespace plan list - Connection: - - keep-alive - ParameterSetName: - - -g - User-Agent: - - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 - vsonline/05/26/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_codespaces000001/providers/Microsoft.VSOnline/plans?api-version=2020-05-26-preview - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Jun 2020 00:09:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_location.yaml b/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_location.yaml new file mode 100644 index 00000000000..40059cb1e48 --- /dev/null +++ b/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_location.yaml @@ -0,0 +1,93 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386) azure-cli/2.5.1 codespaces-extension/0.3.0 + method: GET + uri: https://online.visualstudio.com/api/v1/locations + response: + body: + string: '{"current":"WestUs2","available":["EastUs","SouthEastAsia","WestEurope","WestUs2"],"hostnames":{"EastUs":"eastus.online.visualstudio.com","SouthEastAsia":"southeastasia.online.visualstudio.com","WestEurope":"westeurope.online.visualstudio.com","WestUs2":"westus2.online.visualstudio.com"}}' + headers: + connection: + - keep-alive + content-length: + - '289' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:20 GMT + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + vssaas-request-id: + - 5548602b-8c38-4e9a-8f01-d51b733443d4 + x-content-type-options: + - nosniff + x-served-by: + - vsclk-online-prod-rel-usw2-cluster + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386) azure-cli/2.5.1 codespaces-extension/0.3.0 + method: GET + uri: https://online.visualstudio.com/api/v1/locations/westus2 + response: + body: + string: '{"skus":[{"name":"standardLinux","displayName":"Standard (Linux): 4 + cores, 8 GB RAM","os":"Linux"},{"name":"basicLinux","displayName":"Basic (Linux): + 2 cores, 4 GB RAM","os":"Linux"},{"name":"premiumLinux","displayName":"Premium + (Linux): 8 cores, 16 GB RAM","os":"Linux"}],"defaultAutoSuspendDelayMinutes":[5,30,60,120]}' + headers: + connection: + - keep-alive + content-length: + - '320' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:20 GMT + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + vssaas-request-id: + - 34df3d06-4b69-4899-a59b-f62b7cb4b50c + x-content-type-options: + - nosniff + x-served-by: + - vsclk-online-prod-rel-usw2-cluster + status: + code: 200 + message: OK +version: 1 diff --git a/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_plan.yaml b/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_plan.yaml new file mode 100644 index 00000000000..a2a1b541ec1 --- /dev/null +++ b/src/codespaces/azext_codespaces/tests/latest/recordings/test_codespaces_plan.yaml @@ -0,0 +1,292 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azclitest_000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001","name":"azclitest_000001","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"product":"azurecli","cause":"automation","date":"2020-07-13T23:12:19Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus2", "properties": {}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan create + Connection: + - keep-alive + Content-Length: + - '41' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + codespaces/06/16/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan?api-version=2020-06-16 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan","name":"azclitest-codespace-plan","type":"Microsoft.Codespaces/plans","location":"westus2","properties":{}}' + headers: + cache-control: + - no-cache + content-length: + - '320' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + codespaces/06/16/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans?api-version=2020-06-16 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan","name":"azclitest-codespace-plan","type":"Microsoft.Codespaces/plans","location":"westus2","properties":{}}]}' + headers: + cache-control: + - no-cache + content-length: + - '332' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + codespaces/06/16/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan?api-version=2020-06-16 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan","name":"azclitest-codespace-plan","type":"Microsoft.Codespaces/plans","location":"westus2","properties":{}}' + headers: + cache-control: + - no-cache + content-length: + - '320' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --yes + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + codespaces/06/16/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans/azclitest-codespace-plan?api-version=2020-06-16 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 13 Jul 2020 23:12:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codespace plan list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.7.4 (Darwin-19.5.0-x86_64-i386-64bit) msrest/0.6.13 msrest_azure/0.6.3 + codespaces/06/16/2020 00:00:00 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azclitest_000001/providers/Microsoft.Codespaces/plans?api-version=2020-06-16 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 13 Jul 2020 23:12:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/codespaces/azext_codespaces/tests/latest/test_codespaces_scenario.py b/src/codespaces/azext_codespaces/tests/latest/test_codespaces_scenario.py index bb13da50d3f..2acba1eac77 100644 --- a/src/codespaces/azext_codespaces/tests/latest/test_codespaces_scenario.py +++ b/src/codespaces/azext_codespaces/tests/latest/test_codespaces_scenario.py @@ -7,21 +7,59 @@ import unittest from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, live_only) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) class CodespacesScenarioTest(ScenarioTest): + plan_resource_type = 'Microsoft.Codespaces/plans' + default_location = 'westus2' + rg_name_prefix = 'azclitest_' - @ResourceGroupPreparer(name_prefix='cli_test_codespaces') - def test_codespaces(self, resource_group): - + @ResourceGroupPreparer(name_prefix=rg_name_prefix, location=default_location) + def test_codespaces_plan(self, resource_group): self.kwargs.update({ - 'name': 'test1' + 'name': 'azclitest-codespace-plan' }) - - # TODO: Add full scenario tests when we have support for 'codespace plan create' without needing userId. + self.cmd('codespace plan create -g {rg} -n {name}') + count = len(self.cmd('codespace plan list -g {rg}').get_output_in_json()) + self.assertEqual(count, 1) + self.cmd('codespace plan show -g {rg} -n {name}', checks=[ + self.check('type', self.plan_resource_type), + self.check('name', '{name}'), + self.check('location', self.default_location) + ]) + self.cmd('codespace plan delete -g {rg} -n {name} --yes') count = len(self.cmd('codespace plan list -g {rg}').get_output_in_json()) self.assertEqual(count, 0) + + def test_codespaces_location(self): + self.cmd('codespace location list').get_output_in_json() + self.cmd('codespace location show -n westus2') + + @live_only() # do not save recordings for this test. + @ResourceGroupPreparer(name_prefix=rg_name_prefix, location=default_location) + def test_codespaces_codespace(self, resource_group): + self.kwargs.update({ + 'name': 'azclitest-codespace-plan', + 'codespace_name': 'codespace1', + 'instance_type': 'standardLinux', + 'suspend_after': '120' + }) + plan_info = self.cmd('codespace plan create -g {rg} -n {name}').get_output_in_json() + self.kwargs.update({ + 'plan_id': plan_info['id'] + }) + self.cmd('codespace create --plan {plan_id} --name {name} --instance-type {instance_type} --suspend-after {suspend_after}') + count = len(self.cmd('codespace list --plan {plan_id}').get_output_in_json()) + self.assertEqual(count, 1) + self.cmd('codespace show --plan {plan_id} --name {name}', checks=[ + self.check('friendlyName', '{name}'), + self.check('skuName', '{instance_type}'), + self.check('autoShutdownDelayMinutes', '{suspend_after}') + ]) + self.cmd('codespace delete --plan {plan_id} -n {name} --yes') + count = len(self.cmd('codespace list --plan {plan_id}').get_output_in_json()) + self.assertEqual(count, 0) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/__init__.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/__init__.py similarity index 86% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/__init__.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/__init__.py index 130dfb857e5..83d4e89b5be 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/__init__.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .vs_online_client import VSOnlineClient +from .codespaces_client import CodespacesClient from .version import VERSION -__all__ = ['VSOnlineClient'] +__all__ = ['CodespacesClient'] __version__ = VERSION diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/vs_online_client.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/codespaces_client.py similarity index 79% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/vs_online_client.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/codespaces_client.py index 559d58b0d49..7c25367b6ee 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/vs_online_client.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/codespaces_client.py @@ -18,8 +18,8 @@ from . import models -class VSOnlineClientConfiguration(AzureConfiguration): - """Configuration for VSOnlineClient +class CodespacesClientConfiguration(AzureConfiguration): + """Configuration for CodespacesClient Note that all parameters used to create this instance are saved as instance attributes. @@ -42,9 +42,9 @@ def __init__( if not base_url: base_url = 'https://management.azure.com' - super(VSOnlineClientConfiguration, self).__init__(base_url) + super(CodespacesClientConfiguration, self).__init__(base_url) - self.add_user_agent('vsonline/{}'.format(VERSION)) + self.add_user_agent('codespaces/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -52,16 +52,16 @@ def __init__( self.api_version = api_version -class VSOnlineClient(SDKClient): - """Microsoft VS Online REST API version 2020-05-26-preview. +class CodespacesClient(SDKClient): + """Microsoft Codespaces REST API version 2020-06-16 :ivar config: Configuration for client. - :vartype config: VSOnlineClientConfiguration + :vartype config: CodespacesClientConfiguration :ivar operations: Operations operations - :vartype operations: microsoft.vsonline.operations.Operations + :vartype operations: microsoft.codespaces.operations.Operations :ivar plan: Plan operations - :vartype plan: microsoft.vsonline.operations.PlanOperations + :vartype plan: microsoft.codespaces.operations.PlanOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -75,11 +75,11 @@ class VSOnlineClient(SDKClient): def __init__( self, credentials, subscription_id, base_url=None, api_version=None): - self.config = VSOnlineClientConfiguration(credentials, subscription_id, base_url, api_version) - super(VSOnlineClient, self).__init__(self.config.credentials, self.config) + self.config = CodespacesClientConfiguration(credentials, subscription_id, base_url, api_version) + super(CodespacesClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-05-26-preview' + self.api_version = '2020-06-16' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/__init__.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/__init__.py new file mode 100644 index 00000000000..14836da424f --- /dev/null +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/__init__.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .error_definition_py3 import ErrorDefinition + from .codespaces_operations_error_response_py3 import CodespacesOperationsErrorResponse, CodespacesOperationsErrorResponseException + from .codespaces_plan_error_response_py3 import CodespacesPlanErrorResponse, CodespacesPlanErrorResponseException + from .resource_py3 import Resource + from .sku_py3 import Sku + from .identity_py3 import Identity + from .vnet_properties_py3 import VnetProperties + from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay + from .resource_provider_operation_definition_py3 import ResourceProviderOperationDefinition + from .codespaces_plan_update_parameters_properties_py3 import CodespacesPlanUpdateParametersProperties + from .codespaces_plan_update_parameters_py3 import CodespacesPlanUpdateParameters + from .codespaces_plan_properties_py3 import CodespacesPlanProperties + from .codespaces_plan_py3 import CodespacesPlan + from .codespaces_plan_access_token_py3 import CodespacesPlanAccessToken + from .codespaces_delegate_identity_py3 import CodespacesDelegateIdentity + from .codespaces_delegate_access_token_request_body_py3 import CodespacesDelegateAccessTokenRequestBody +except (SyntaxError, ImportError): + from .error_definition import ErrorDefinition + from .codespaces_operations_error_response import CodespacesOperationsErrorResponse, CodespacesOperationsErrorResponseException + from .codespaces_plan_error_response import CodespacesPlanErrorResponse, CodespacesPlanErrorResponseException + from .resource import Resource + from .sku import Sku + from .identity import Identity + from .vnet_properties import VnetProperties + from .resource_provider_operation_display import ResourceProviderOperationDisplay + from .resource_provider_operation_definition import ResourceProviderOperationDefinition + from .codespaces_plan_update_parameters_properties import CodespacesPlanUpdateParametersProperties + from .codespaces_plan_update_parameters import CodespacesPlanUpdateParameters + from .codespaces_plan_properties import CodespacesPlanProperties + from .codespaces_plan import CodespacesPlan + from .codespaces_plan_access_token import CodespacesPlanAccessToken + from .codespaces_delegate_identity import CodespacesDelegateIdentity + from .codespaces_delegate_access_token_request_body import CodespacesDelegateAccessTokenRequestBody +from .resource_provider_operation_definition_paged import ResourceProviderOperationDefinitionPaged +from .codespaces_plan_paged import CodespacesPlanPaged +from .codespaces_client_enums import ( + SkuTier, +) + +__all__ = [ + 'ErrorDefinition', + 'CodespacesOperationsErrorResponse', 'CodespacesOperationsErrorResponseException', + 'CodespacesPlanErrorResponse', 'CodespacesPlanErrorResponseException', + 'Resource', + 'Sku', + 'Identity', + 'VnetProperties', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationDefinition', + 'CodespacesPlanUpdateParametersProperties', + 'CodespacesPlanUpdateParameters', + 'CodespacesPlanProperties', + 'CodespacesPlan', + 'CodespacesPlanAccessToken', + 'CodespacesDelegateIdentity', + 'CodespacesDelegateAccessTokenRequestBody', + 'ResourceProviderOperationDefinitionPaged', + 'CodespacesPlanPaged', + 'SkuTier', +] diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_client_enums.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_client_enums.py similarity index 100% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_client_enums.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_client_enums.py diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body.py similarity index 59% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body.py index 4939c8f0bd5..83e9e96aeb6 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body.py @@ -12,24 +12,24 @@ from msrest.serialization import Model -class VSOnlineDelegateAccessTokenRequestBody(Model): - """Object that includes a VS Online Plans delegate access token request +class CodespacesDelegateAccessTokenRequestBody(Model): + """Object that includes a Codespaces Plans delegate access token request parameters. All required parameters must be populated in order to send to Azure. - :param scope: Required. The requested scopes for the VS Online Plan access - token. + :param scope: Required. The requested scopes for the Codespaces Plan + access token. :type scope: str - :param expiration: The requested expiration UNIX timestamp (seconds since - epoch) for the VS Online Plan access token. - :type expiration: int - :param identity: Required. The identity of the user of the VS Online Plan + :param expiration: The requested expiration timestamp for the Codespaces + Plan access token. + :type expiration: long + :param identity: Required. The identity of the user of the Codespaces Plan access token. - :type identity: ~microsoft.vsonline.models.VSOnlineDelegateIdentity - :param environment_ids: A subset of environments within the VS Online Plan + :type identity: ~microsoft.codespaces.models.CodespacesDelegateIdentity + :param environment_ids: A subset of codespaces within the Codespaces Plan which the returned token will grant access to. If not provided the token - will be applicable for all environments. + will be applicable for all codespaces. :type environment_ids: list[str] """ @@ -40,13 +40,13 @@ class VSOnlineDelegateAccessTokenRequestBody(Model): _attribute_map = { 'scope': {'key': 'scope', 'type': 'str'}, - 'expiration': {'key': 'expiration', 'type': 'int'}, - 'identity': {'key': 'identity', 'type': 'VSOnlineDelegateIdentity'}, + 'expiration': {'key': 'expiration', 'type': 'long'}, + 'identity': {'key': 'identity', 'type': 'CodespacesDelegateIdentity'}, 'environment_ids': {'key': 'environmentIds', 'type': '[str]'}, } def __init__(self, **kwargs): - super(VSOnlineDelegateAccessTokenRequestBody, self).__init__(**kwargs) + super(CodespacesDelegateAccessTokenRequestBody, self).__init__(**kwargs) self.scope = kwargs.get('scope', None) self.expiration = kwargs.get('expiration', None) self.identity = kwargs.get('identity', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body_py3.py similarity index 59% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body_py3.py index 2fe53b34609..9c2c1dceda2 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_access_token_request_body_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_access_token_request_body_py3.py @@ -12,24 +12,24 @@ from msrest.serialization import Model -class VSOnlineDelegateAccessTokenRequestBody(Model): - """Object that includes a VS Online Plans delegate access token request +class CodespacesDelegateAccessTokenRequestBody(Model): + """Object that includes a Codespaces Plans delegate access token request parameters. All required parameters must be populated in order to send to Azure. - :param scope: Required. The requested scopes for the VS Online Plan access - token. + :param scope: Required. The requested scopes for the Codespaces Plan + access token. :type scope: str - :param expiration: The requested expiration UNIX timestamp (seconds since - epoch) for the VS Online Plan access token. - :type expiration: int - :param identity: Required. The identity of the user of the VS Online Plan + :param expiration: The requested expiration timestamp for the Codespaces + Plan access token. + :type expiration: long + :param identity: Required. The identity of the user of the Codespaces Plan access token. - :type identity: ~microsoft.vsonline.models.VSOnlineDelegateIdentity - :param environment_ids: A subset of environments within the VS Online Plan + :type identity: ~microsoft.codespaces.models.CodespacesDelegateIdentity + :param environment_ids: A subset of codespaces within the Codespaces Plan which the returned token will grant access to. If not provided the token - will be applicable for all environments. + will be applicable for all codespaces. :type environment_ids: list[str] """ @@ -40,13 +40,13 @@ class VSOnlineDelegateAccessTokenRequestBody(Model): _attribute_map = { 'scope': {'key': 'scope', 'type': 'str'}, - 'expiration': {'key': 'expiration', 'type': 'int'}, - 'identity': {'key': 'identity', 'type': 'VSOnlineDelegateIdentity'}, + 'expiration': {'key': 'expiration', 'type': 'long'}, + 'identity': {'key': 'identity', 'type': 'CodespacesDelegateIdentity'}, 'environment_ids': {'key': 'environmentIds', 'type': '[str]'}, } def __init__(self, *, scope: str, identity, expiration: int=None, environment_ids=None, **kwargs) -> None: - super(VSOnlineDelegateAccessTokenRequestBody, self).__init__(**kwargs) + super(CodespacesDelegateAccessTokenRequestBody, self).__init__(**kwargs) self.scope = scope self.expiration = expiration self.identity = identity diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity.py similarity index 93% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity.py index 9bbed69ede6..d8579485546 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class VSOnlineDelegateIdentity(Model): +class CodespacesDelegateIdentity(Model): """Object that includes the identity of the user of a delegated access token. All required parameters must be populated in order to send to Azure. @@ -39,7 +39,7 @@ class VSOnlineDelegateIdentity(Model): } def __init__(self, **kwargs): - super(VSOnlineDelegateIdentity, self).__init__(**kwargs) + super(CodespacesDelegateIdentity, self).__init__(**kwargs) self.username = kwargs.get('username', None) self.display_name = kwargs.get('display_name', None) self.id = kwargs.get('id', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity_py3.py similarity index 93% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity_py3.py index 2c51e29fb7b..1ec012c33aa 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_delegate_identity_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_delegate_identity_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class VSOnlineDelegateIdentity(Model): +class CodespacesDelegateIdentity(Model): """Object that includes the identity of the user of a delegated access token. All required parameters must be populated in order to send to Azure. @@ -39,7 +39,7 @@ class VSOnlineDelegateIdentity(Model): } def __init__(self, *, username: str, display_name: str, id: str, **kwargs) -> None: - super(VSOnlineDelegateIdentity, self).__init__(**kwargs) + super(CodespacesDelegateIdentity, self).__init__(**kwargs) self.username = username self.display_name = display_name self.id = id diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response.py similarity index 68% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response.py index 0b2300cfeea..8ce7635f847 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response.py @@ -13,12 +13,12 @@ from msrest.exceptions import HttpOperationError -class VSOAccountErrorResponse(Model): +class CodespacesOperationsErrorResponse(Model): """Error response indicates that the service is not able to process the incoming request. :param error: The error details. - :type error: ~microsoft.vsonline.models.ErrorDefinition + :type error: ~microsoft.codespaces.models.ErrorDefinition """ _attribute_map = { @@ -26,12 +26,12 @@ class VSOAccountErrorResponse(Model): } def __init__(self, **kwargs): - super(VSOAccountErrorResponse, self).__init__(**kwargs) + super(CodespacesOperationsErrorResponse, self).__init__(**kwargs) self.error = kwargs.get('error', None) -class VSOAccountErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'VSOAccountErrorResponse'. +class CodespacesOperationsErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'CodespacesOperationsErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -39,4 +39,4 @@ class VSOAccountErrorResponseException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(VSOAccountErrorResponseException, self).__init__(deserialize, response, 'VSOAccountErrorResponse', *args) + super(CodespacesOperationsErrorResponseException, self).__init__(deserialize, response, 'CodespacesOperationsErrorResponse', *args) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response_py3.py similarity index 68% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response_py3.py index e1726eb7678..cd3c267a01f 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_operations_error_response_py3.py @@ -13,12 +13,12 @@ from msrest.exceptions import HttpOperationError -class VSOPlanErrorResponse(Model): +class CodespacesOperationsErrorResponse(Model): """Error response indicates that the service is not able to process the incoming request. :param error: The error details. - :type error: ~microsoft.vsonline.models.ErrorDefinition + :type error: ~microsoft.codespaces.models.ErrorDefinition """ _attribute_map = { @@ -26,12 +26,12 @@ class VSOPlanErrorResponse(Model): } def __init__(self, *, error=None, **kwargs) -> None: - super(VSOPlanErrorResponse, self).__init__(**kwargs) + super(CodespacesOperationsErrorResponse, self).__init__(**kwargs) self.error = error -class VSOPlanErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'VSOPlanErrorResponse'. +class CodespacesOperationsErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'CodespacesOperationsErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -39,4 +39,4 @@ class VSOPlanErrorResponseException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(VSOPlanErrorResponseException, self).__init__(deserialize, response, 'VSOPlanErrorResponse', *args) + super(CodespacesOperationsErrorResponseException, self).__init__(deserialize, response, 'CodespacesOperationsErrorResponse', *args) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan.py similarity index 62% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan.py index 00699e5896b..c9ba0dc0e26 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan.py @@ -9,40 +9,39 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .resource import Resource -class VSOnlinePlan(Model): - """VS Online Plan. Represents the high level Plan needed to provision VS - Online resources. +class CodespacesPlan(Resource): + """Codespaces Plan. Represents the high level Plan needed to provision + Codespaces resources. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param tags: Tags for the VS Online Account + :param tags: Tags for the Codespaces Plan :type tags: dict[str, str] - :param location: Required. Region where the Azure resource is located. + :param location: Region where the Azure resource is located. :type location: str :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - :param properties: VS Online Additional properties. Additional VS Online + :type sku: ~microsoft.codespaces.models.Sku + :param identity: The type of identity used for the resource. + :type identity: ~microsoft.codespaces.models.Identity + :param properties: Codespaces Additional properties. Additional Codespaces Plan properties. - :type properties: ~microsoft.vsonline.models.VSOnlinePlanProperties + :type properties: ~microsoft.codespaces.models.CodespacesPlanProperties """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -52,15 +51,12 @@ class VSOnlinePlan(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'VSOnlinePlanProperties'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'CodespacesPlanProperties'}, } def __init__(self, **kwargs): - super(VSOnlinePlan, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) + super(CodespacesPlan, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) self.properties = kwargs.get('properties', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token.py similarity index 79% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token.py index 59ba3c19682..b4fbff1c4da 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token.py @@ -12,13 +12,13 @@ from msrest.serialization import Model -class VSOnlinePlanAccessToken(Model): - """Object that includes a VS Online Plans access token. +class CodespacesPlanAccessToken(Model): + """Object that includes a Codespaces Plans access token. Variables are only populated by the server, and will be ignored when sending a request. - :ivar access_token: The VS Online Plan access token. + :ivar access_token: The Codespaces Plan access token. :vartype access_token: str """ @@ -31,5 +31,5 @@ class VSOnlinePlanAccessToken(Model): } def __init__(self, **kwargs): - super(VSOnlinePlanAccessToken, self).__init__(**kwargs) + super(CodespacesPlanAccessToken, self).__init__(**kwargs) self.access_token = None diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token_py3.py similarity index 79% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token_py3.py index e0819670318..ac7e64dfdfd 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_access_token_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_access_token_py3.py @@ -12,13 +12,13 @@ from msrest.serialization import Model -class VSOnlinePlanAccessToken(Model): - """Object that includes a VS Online Plans access token. +class CodespacesPlanAccessToken(Model): + """Object that includes a Codespaces Plans access token. Variables are only populated by the server, and will be ignored when sending a request. - :ivar access_token: The VS Online Plan access token. + :ivar access_token: The Codespaces Plan access token. :vartype access_token: str """ @@ -31,5 +31,5 @@ class VSOnlinePlanAccessToken(Model): } def __init__(self, **kwargs) -> None: - super(VSOnlinePlanAccessToken, self).__init__(**kwargs) + super(CodespacesPlanAccessToken, self).__init__(**kwargs) self.access_token = None diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response.py similarity index 70% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response.py index a43edce2b53..216fc5a7470 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_error_response.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response.py @@ -13,12 +13,12 @@ from msrest.exceptions import HttpOperationError -class VSOPlanErrorResponse(Model): +class CodespacesPlanErrorResponse(Model): """Error response indicates that the service is not able to process the incoming request. :param error: The error details. - :type error: ~microsoft.vsonline.models.ErrorDefinition + :type error: ~microsoft.codespaces.models.ErrorDefinition """ _attribute_map = { @@ -26,12 +26,12 @@ class VSOPlanErrorResponse(Model): } def __init__(self, **kwargs): - super(VSOPlanErrorResponse, self).__init__(**kwargs) + super(CodespacesPlanErrorResponse, self).__init__(**kwargs) self.error = kwargs.get('error', None) -class VSOPlanErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'VSOPlanErrorResponse'. +class CodespacesPlanErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'CodespacesPlanErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -39,4 +39,4 @@ class VSOPlanErrorResponseException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(VSOPlanErrorResponseException, self).__init__(deserialize, response, 'VSOPlanErrorResponse', *args) + super(CodespacesPlanErrorResponseException, self).__init__(deserialize, response, 'CodespacesPlanErrorResponse', *args) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response_py3.py similarity index 70% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response_py3.py index c04f5716df6..ac22bfd3d61 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_error_response_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_error_response_py3.py @@ -13,12 +13,12 @@ from msrest.exceptions import HttpOperationError -class VSOAccountErrorResponse(Model): +class CodespacesPlanErrorResponse(Model): """Error response indicates that the service is not able to process the incoming request. :param error: The error details. - :type error: ~microsoft.vsonline.models.ErrorDefinition + :type error: ~microsoft.codespaces.models.ErrorDefinition """ _attribute_map = { @@ -26,12 +26,12 @@ class VSOAccountErrorResponse(Model): } def __init__(self, *, error=None, **kwargs) -> None: - super(VSOAccountErrorResponse, self).__init__(**kwargs) + super(CodespacesPlanErrorResponse, self).__init__(**kwargs) self.error = error -class VSOAccountErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'VSOAccountErrorResponse'. +class CodespacesPlanErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'CodespacesPlanErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -39,4 +39,4 @@ class VSOAccountErrorResponseException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(VSOAccountErrorResponseException, self).__init__(deserialize, response, 'VSOAccountErrorResponse', *args) + super(CodespacesPlanErrorResponseException, self).__init__(deserialize, response, 'CodespacesPlanErrorResponse', *args) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_paged.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_paged.py similarity index 68% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_paged.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_paged.py index 78a1806b0fb..265f3329ce7 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_paged.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class VSOnlinePlanPaged(Paged): +class CodespacesPlanPaged(Paged): """ - A paging container for iterating over a list of :class:`VSOnlinePlan ` object + A paging container for iterating over a list of :class:`CodespacesPlan ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VSOnlinePlan]'} + 'current_page': {'key': 'value', 'type': '[CodespacesPlan]'} } def __init__(self, *args, **kwargs): - super(VSOnlinePlanPaged, self).__init__(*args, **kwargs) + super(CodespacesPlanPaged, self).__init__(*args, **kwargs) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties.py new file mode 100644 index 00000000000..dfa69a0d4b5 --- /dev/null +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CodespacesPlanProperties(Model): + """Codespaces Additional properties. + + Additional Codespaces Plan properties. + + :param default_auto_suspend_delay_minutes: Specifies auto suspend interval + for codespaces in this plan. + :type default_auto_suspend_delay_minutes: long + :param default_codespace_sku: Specifies the default codespace sku name for + this plan. + :type default_codespace_sku: str + :param vnet_properties: Specifies the vnet injection properties for this + plan. + :type vnet_properties: ~microsoft.codespaces.models.VnetProperties + """ + + _attribute_map = { + 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'long'}, + 'default_codespace_sku': {'key': 'defaultCodespaceSku', 'type': 'str'}, + 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, + } + + def __init__(self, **kwargs): + super(CodespacesPlanProperties, self).__init__(**kwargs) + self.default_auto_suspend_delay_minutes = kwargs.get('default_auto_suspend_delay_minutes', None) + self.default_codespace_sku = kwargs.get('default_codespace_sku', None) + self.vnet_properties = kwargs.get('vnet_properties', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties_py3.py new file mode 100644 index 00000000000..40535e81e29 --- /dev/null +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_properties_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CodespacesPlanProperties(Model): + """Codespaces Additional properties. + + Additional Codespaces Plan properties. + + :param default_auto_suspend_delay_minutes: Specifies auto suspend interval + for codespaces in this plan. + :type default_auto_suspend_delay_minutes: long + :param default_codespace_sku: Specifies the default codespace sku name for + this plan. + :type default_codespace_sku: str + :param vnet_properties: Specifies the vnet injection properties for this + plan. + :type vnet_properties: ~microsoft.codespaces.models.VnetProperties + """ + + _attribute_map = { + 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'long'}, + 'default_codespace_sku': {'key': 'defaultCodespaceSku', 'type': 'str'}, + 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, + } + + def __init__(self, *, default_auto_suspend_delay_minutes: int=None, default_codespace_sku: str=None, vnet_properties=None, **kwargs) -> None: + super(CodespacesPlanProperties, self).__init__(**kwargs) + self.default_auto_suspend_delay_minutes = default_auto_suspend_delay_minutes + self.default_codespace_sku = default_codespace_sku + self.vnet_properties = vnet_properties diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_py3.py similarity index 59% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_py3.py index 8c6c779d73f..1e0ac4d6bc3 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_py3.py @@ -9,40 +9,39 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .resource_py3 import Resource -class VSOnlinePlan(Model): - """VS Online Plan. Represents the high level Plan needed to provision VS - Online resources. +class CodespacesPlan(Resource): + """Codespaces Plan. Represents the high level Plan needed to provision + Codespaces resources. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param tags: Tags for the VS Online Account + :param tags: Tags for the Codespaces Plan :type tags: dict[str, str] - :param location: Required. Region where the Azure resource is located. + :param location: Region where the Azure resource is located. :type location: str :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - :param properties: VS Online Additional properties. Additional VS Online + :type sku: ~microsoft.codespaces.models.Sku + :param identity: The type of identity used for the resource. + :type identity: ~microsoft.codespaces.models.Identity + :param properties: Codespaces Additional properties. Additional Codespaces Plan properties. - :type properties: ~microsoft.vsonline.models.VSOnlinePlanProperties + :type properties: ~microsoft.codespaces.models.CodespacesPlanProperties """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -52,15 +51,12 @@ class VSOnlinePlan(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'VSOnlinePlanProperties'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'CodespacesPlanProperties'}, } - def __init__(self, *, location: str, tags=None, sku=None, properties=None, **kwargs) -> None: - super(VSOnlinePlan, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = tags - self.location = location + def __init__(self, *, tags=None, location: str=None, sku=None, identity=None, properties=None, **kwargs) -> None: + super(CodespacesPlan, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku + self.identity = identity self.properties = properties diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters.py similarity index 64% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters.py index a916e41bafa..502191bcf36 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters.py @@ -12,26 +12,26 @@ from msrest.serialization import Model -class VSOPlanUpdateParameters(Model): - """Parameters for updating a VS Online Plan. +class CodespacesPlanUpdateParameters(Model): + """Parameters for updating a Codespaces Plan. - :param tags: Tags for the VS Online Plan. + :param tags: Tags for the Codespaces Plan. :type tags: dict[str, str] :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - :param properties: Additional VS Online Plan properties. + :type sku: ~microsoft.codespaces.models.Sku + :param properties: Additional Codespaces Plan properties. :type properties: - ~microsoft.vsonline.models.VSOPlanUpdateParametersProperties + ~microsoft.codespaces.models.CodespacesPlanUpdateParametersProperties """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'VSOPlanUpdateParametersProperties'}, + 'properties': {'key': 'properties', 'type': 'CodespacesPlanUpdateParametersProperties'}, } def __init__(self, **kwargs): - super(VSOPlanUpdateParameters, self).__init__(**kwargs) + super(CodespacesPlanUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.sku = kwargs.get('sku', None) self.properties = kwargs.get('properties', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties.py similarity index 61% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties.py index af2c7b98da9..1b4a45904c1 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties.py @@ -12,28 +12,28 @@ from msrest.serialization import Model -class VSOPlanUpdateParametersProperties(Model): - """Additional VS Online Plan properties. +class CodespacesPlanUpdateParametersProperties(Model): + """Additional Codespaces Plan properties. :param default_auto_suspend_delay_minutes: Specifies auto suspend interval - for environments in this plan. - :type default_auto_suspend_delay_minutes: int - :param default_environment_sku: Specifies the default environment sku name - for this plan. - :type default_environment_sku: str + for codespaces in this plan. + :type default_auto_suspend_delay_minutes: long + :param default_codespace_sku: Specifies the default codespace sku name for + this plan. + :type default_codespace_sku: str :param vnet_properties: Specifies the vnet injection properties for this plan. - :type vnet_properties: ~microsoft.vsonline.models.VnetProperties + :type vnet_properties: ~microsoft.codespaces.models.VnetProperties """ _attribute_map = { - 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'int'}, - 'default_environment_sku': {'key': 'defaultEnvironmentSku', 'type': 'str'}, + 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'long'}, + 'default_codespace_sku': {'key': 'defaultCodespaceSku', 'type': 'str'}, 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, } def __init__(self, **kwargs): - super(VSOPlanUpdateParametersProperties, self).__init__(**kwargs) + super(CodespacesPlanUpdateParametersProperties, self).__init__(**kwargs) self.default_auto_suspend_delay_minutes = kwargs.get('default_auto_suspend_delay_minutes', None) - self.default_environment_sku = kwargs.get('default_environment_sku', None) + self.default_codespace_sku = kwargs.get('default_codespace_sku', None) self.vnet_properties = kwargs.get('vnet_properties', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties_py3.py similarity index 59% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties_py3.py index 1f04671ebf5..34891abac36 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_properties_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_properties_py3.py @@ -12,28 +12,28 @@ from msrest.serialization import Model -class VSOPlanUpdateParametersProperties(Model): - """Additional VS Online Plan properties. +class CodespacesPlanUpdateParametersProperties(Model): + """Additional Codespaces Plan properties. :param default_auto_suspend_delay_minutes: Specifies auto suspend interval - for environments in this plan. - :type default_auto_suspend_delay_minutes: int - :param default_environment_sku: Specifies the default environment sku name - for this plan. - :type default_environment_sku: str + for codespaces in this plan. + :type default_auto_suspend_delay_minutes: long + :param default_codespace_sku: Specifies the default codespace sku name for + this plan. + :type default_codespace_sku: str :param vnet_properties: Specifies the vnet injection properties for this plan. - :type vnet_properties: ~microsoft.vsonline.models.VnetProperties + :type vnet_properties: ~microsoft.codespaces.models.VnetProperties """ _attribute_map = { - 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'int'}, - 'default_environment_sku': {'key': 'defaultEnvironmentSku', 'type': 'str'}, + 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'long'}, + 'default_codespace_sku': {'key': 'defaultCodespaceSku', 'type': 'str'}, 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, } - def __init__(self, *, default_auto_suspend_delay_minutes: int=None, default_environment_sku: str=None, vnet_properties=None, **kwargs) -> None: - super(VSOPlanUpdateParametersProperties, self).__init__(**kwargs) + def __init__(self, *, default_auto_suspend_delay_minutes: int=None, default_codespace_sku: str=None, vnet_properties=None, **kwargs) -> None: + super(CodespacesPlanUpdateParametersProperties, self).__init__(**kwargs) self.default_auto_suspend_delay_minutes = default_auto_suspend_delay_minutes - self.default_environment_sku = default_environment_sku + self.default_codespace_sku = default_codespace_sku self.vnet_properties = vnet_properties diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_py3.py similarity index 64% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_py3.py index 9e04f3a3769..9d06723d695 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_plan_update_parameters_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/codespaces_plan_update_parameters_py3.py @@ -12,26 +12,26 @@ from msrest.serialization import Model -class VSOPlanUpdateParameters(Model): - """Parameters for updating a VS Online Plan. +class CodespacesPlanUpdateParameters(Model): + """Parameters for updating a Codespaces Plan. - :param tags: Tags for the VS Online Plan. + :param tags: Tags for the Codespaces Plan. :type tags: dict[str, str] :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - :param properties: Additional VS Online Plan properties. + :type sku: ~microsoft.codespaces.models.Sku + :param properties: Additional Codespaces Plan properties. :type properties: - ~microsoft.vsonline.models.VSOPlanUpdateParametersProperties + ~microsoft.codespaces.models.CodespacesPlanUpdateParametersProperties """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'VSOPlanUpdateParametersProperties'}, + 'properties': {'key': 'properties', 'type': 'CodespacesPlanUpdateParametersProperties'}, } def __init__(self, *, tags=None, sku=None, properties=None, **kwargs) -> None: - super(VSOPlanUpdateParameters, self).__init__(**kwargs) + super(CodespacesPlanUpdateParameters, self).__init__(**kwargs) self.tags = tags self.sku = sku self.properties = properties diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition.py similarity index 94% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition.py index 618a35beeb7..4bc75106de6 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition.py @@ -18,13 +18,13 @@ class ErrorDefinition(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Service specific error code which serves as the substatus for + :ivar code: Service specific error code which serves as the sub status for the HTTP error code. :vartype code: str :ivar message: Description of the error. :vartype message: str :ivar details: Internal error details. - :vartype details: list[~microsoft.vsonline.models.ErrorDefinition] + :vartype details: list[~microsoft.codespaces.models.ErrorDefinition] """ _validation = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition_py3.py similarity index 94% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition_py3.py index e5e07dff856..2c247d34ac7 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/error_definition_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/error_definition_py3.py @@ -18,13 +18,13 @@ class ErrorDefinition(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Service specific error code which serves as the substatus for + :ivar code: Service specific error code which serves as the sub status for the HTTP error code. :vartype code: str :ivar message: Description of the error. :vartype message: str :ivar details: Internal error details. - :vartype details: list[~microsoft.vsonline.models.ErrorDefinition] + :vartype details: list[~microsoft.codespaces.models.ErrorDefinition] """ _validation = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity.py similarity index 58% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity.py index 23dc1c4dbe6..f490e245487 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity.py @@ -12,17 +12,23 @@ from msrest.serialization import Model -class VSOnlinePlanInfo(Model): - """VS Online Plan properties. Holds properties that describe the plan. +class Identity(Model): + """Model representing Identity for Codespaces Plan. - :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of identity + :type type: str """ + _validation = { + 'type': {'required': True}, + } + _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): - super(VSOnlinePlanInfo, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + super(Identity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity_py3.py similarity index 54% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity_py3.py index 7e245a81206..2efb7fc1b6e 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_info_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/identity_py3.py @@ -12,17 +12,23 @@ from msrest.serialization import Model -class VSOnlinePlanInfo(Model): - """VS Online Plan properties. Holds properties that describe the plan. +class Identity(Model): + """Model representing Identity for Codespaces Plan. - :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of identity + :type type: str """ + _validation = { + 'type': {'required': True}, + } + _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, sku=None, **kwargs) -> None: - super(VSOnlinePlanInfo, self).__init__(**kwargs) - self.sku = sku + def __init__(self, *, type: str, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.type = type diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource.py similarity index 97% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource.py index f7fb7e941bb..cbf15df4ff5 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource.py @@ -24,7 +24,7 @@ class Resource(Model): :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param tags: Tags for the VS Online Account + :param tags: Tags for the Codespaces Plan :type tags: dict[str, str] :param location: Region where the Azure resource is located. :type location: str diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition.py similarity index 92% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition.py index 79146cfb5ca..13a3b48e349 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition.py @@ -18,7 +18,8 @@ class ResourceProviderOperationDefinition(Model): :param name: Resource provider operation name. :type name: str :param display: Resource provider display properties. - :type display: ~microsoft.vsonline.models.ResourceProviderOperationDisplay + :type display: + ~microsoft.codespaces.models.ResourceProviderOperationDisplay """ _attribute_map = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_paged.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_paged.py similarity index 89% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_paged.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_paged.py index 9ab23040ab8..2fd1ff78104 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_paged.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_paged.py @@ -14,7 +14,7 @@ class ResourceProviderOperationDefinitionPaged(Paged): """ - A paging container for iterating over a list of :class:`ResourceProviderOperationDefinition ` object + A paging container for iterating over a list of :class:`ResourceProviderOperationDefinition ` object """ _attribute_map = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_py3.py similarity index 92% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_py3.py index e4d0f398f71..f5b76632d59 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_definition_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_definition_py3.py @@ -18,7 +18,8 @@ class ResourceProviderOperationDefinition(Model): :param name: Resource provider operation name. :type name: str :param display: Resource provider display properties. - :type display: ~microsoft.vsonline.models.ResourceProviderOperationDisplay + :type display: + ~microsoft.codespaces.models.ResourceProviderOperationDisplay """ _attribute_map = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_display.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_display.py similarity index 100% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_display.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_display.py diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_display_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_display_py3.py similarity index 100% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_provider_operation_display_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_provider_operation_display_py3.py diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_py3.py similarity index 97% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_py3.py index 53d55ccd496..e198f9c97f6 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/resource_py3.py @@ -24,7 +24,7 @@ class Resource(Model): :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param tags: Tags for the VS Online Account + :param tags: Tags for the Codespaces Plan :type tags: dict[str, str] :param location: Region where the Azure resource is located. :type location: str diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku.py similarity index 81% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku.py index ab45275fc23..66bdfd7db2d 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku.py @@ -13,19 +13,19 @@ class Sku(Model): - """Model representing SKU for VS Online Account. + """Model representing SKU for Codespaces Plan. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar name: Required. The name of the SKU for VS Online Account. Default + :ivar name: Required. The name of the SKU for Codespaces Plan. Default value: "Free" . :vartype name: str - :param tier: The tier of the SKU for VS Online Account. Possible values + :param tier: The tier of the SKU for Codespaces Plan. Possible values include: 'Standard' - :type tier: str or ~microsoft.vsonline.models.SkuTier + :type tier: str or ~microsoft.codespaces.models.SkuTier """ _validation = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku_py3.py similarity index 81% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku_py3.py index a1c52897f9d..cfbfcbb0e32 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/sku_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/sku_py3.py @@ -13,19 +13,19 @@ class Sku(Model): - """Model representing SKU for VS Online Account. + """Model representing SKU for Codespaces Plan. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar name: Required. The name of the SKU for VS Online Account. Default + :ivar name: Required. The name of the SKU for Codespaces Plan. Default value: "Free" . :vartype name: str - :param tier: The tier of the SKU for VS Online Account. Possible values + :param tier: The tier of the SKU for Codespaces Plan. Possible values include: 'Standard' - :type tier: str or ~microsoft.vsonline.models.SkuTier + :type tier: str or ~microsoft.codespaces.models.SkuTier """ _validation = { diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties.py similarity index 80% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties.py index 14b133d0e4a..1ee38d17daf 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties.py @@ -13,18 +13,19 @@ class VnetProperties(Model): - """Model representing Vnet Injection properties for VS Online Account. + """Model representing Vnet Injection properties for Codespaces Plan. :param subnet_id: The ARM resource identifier of the virtual network - subnet which the codespaces of the VSO Plan will join. This is of the form + subnet which the codespaces of the Codespaces Plan will join. This is of + the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.The - virtual network must be in the same region and subscription as the VSO - Plan. + virtual network must be in the same region and subscription as the + Codespaces Plan. :type subnet_id: str """ _attribute_map = { - 'subnet_id': {'key': 'SubnetId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, } def __init__(self, **kwargs): diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties_py3.py similarity index 80% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties_py3.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties_py3.py index e332114de13..d52bd7ccd9c 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vnet_properties_py3.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/models/vnet_properties_py3.py @@ -13,18 +13,19 @@ class VnetProperties(Model): - """Model representing Vnet Injection properties for VS Online Account. + """Model representing Vnet Injection properties for Codespaces Plan. :param subnet_id: The ARM resource identifier of the virtual network - subnet which the codespaces of the VSO Plan will join. This is of the form + subnet which the codespaces of the Codespaces Plan will join. This is of + the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.The - virtual network must be in the same region and subscription as the VSO - Plan. + virtual network must be in the same region and subscription as the + Codespaces Plan. :type subnet_id: str """ _attribute_map = { - 'subnet_id': {'key': 'SubnetId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, } def __init__(self, *, subnet_id: str=None, **kwargs) -> None: diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/__init__.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/__init__.py similarity index 100% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/__init__.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/__init__.py diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/operations.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/operations.py similarity index 86% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/operations.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/operations.py index 94ba2f58296..9e43b3cac7e 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/operations.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-05-26-preview". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-06-16". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = config.api_version or "2020-05-26-preview" + self.api_version = config.api_version or "2020-06-16" self.config = config @@ -51,9 +51,9 @@ def list( :return: An iterator like instance of ResourceProviderOperationDefinition :rtype: - ~microsoft.vsonline.models.ResourceProviderOperationDefinitionPaged[~microsoft.vsonline.models.ResourceProviderOperationDefinition] + ~microsoft.codespaces.models.ResourceProviderOperationDefinitionPaged[~microsoft.codespaces.models.ResourceProviderOperationDefinition] :raises: - :class:`VSOAccountErrorResponseException` + :class:`CodespacesOperationsErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -84,7 +84,7 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOAccountErrorResponseException(self._deserialize, response) + raise models.CodespacesOperationsErrorResponseException(self._deserialize, response) return response @@ -97,4 +97,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.VSOnline/operations'} + list.metadata = {'url': '/providers/Microsoft.Codespaces/operations'} diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/plan_operations.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/plan_operations.py similarity index 73% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/plan_operations.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/plan_operations.py index 78694996225..7a7233753b4 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/operations/plan_operations.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/operations/plan_operations.py @@ -22,7 +22,7 @@ class PlanOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-05-26-preview". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-06-16". """ models = models @@ -32,30 +32,30 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = config.api_version or "2020-05-26-preview" + self.api_version = config.api_version or "2020-06-16" self.config = config def get( self, resource_group_name, plan_name, custom_headers=None, raw=False, **operation_config): - """Retrieves information about a VS Online Plan resource. + """Retrieves information about a Codespaces Plan resource. - Retrieves the properties of a VS Online Plan. + Retrieves the properties of a Codespaces Plan. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlan or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlan or + :return: CodespacesPlan or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlan or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -85,29 +85,29 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlan', response) + deserialized = self._deserialize('CodespacesPlan', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}'} def delete( self, resource_group_name, plan_name, custom_headers=None, raw=False, **operation_config): - """Deletes a VS Online Plan resource. + """Deletes a Codespaces Plan resource. - Deletes an existing VS Online Plan. + Deletes an existing Codespaces Plan. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -117,7 +117,7 @@ def delete( :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -146,35 +146,35 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}'} def create( - self, resource_group_name, plan_name, vsonline_plan, custom_headers=None, raw=False, **operation_config): - """Creates a VS Online Plan. + self, resource_group_name, plan_name, codespaces_plan, custom_headers=None, raw=False, **operation_config): + """Creates a Codespaces Plan. - Creates a VS Online Plan with the specified create parameters. + Creates a Codespaces Plan with the specified create parameters. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param vsonline_plan: VS Online Plan create parameters. - :type vsonline_plan: ~microsoft.vsonline.models.VSOnlinePlan + :param codespaces_plan: Codespaces Plan create parameters. + :type codespaces_plan: ~microsoft.codespaces.models.CodespacesPlan :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlan or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlan or + :return: CodespacesPlan or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlan or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -201,52 +201,52 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(vsonline_plan, 'VSOnlinePlan') + body_content = self._serialize.body(codespaces_plan, 'CodespacesPlan') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlan', response) + deserialized = self._deserialize('CodespacesPlan', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}'} def update( - self, resource_group_name, plan_name, vsonline_plan_update_parameters, custom_headers=None, raw=False, **operation_config): - """Updates a VS Online Plan. + self, resource_group_name, plan_name, codespaces_plan_update_parameters, custom_headers=None, raw=False, **operation_config): + """Updates a Codespaces Plan. - Updates the properties of an existing VS Online Plan with the specified - update parameters. + Updates the properties of an existing Codespaces Plan with the + specified update parameters. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param vsonline_plan_update_parameters: Parameters for updating the VS - Online Plan. - :type vsonline_plan_update_parameters: - ~microsoft.vsonline.models.VSOPlanUpdateParameters + :param codespaces_plan_update_parameters: Parameters for updating the + Codespaces Plan. + :type codespaces_plan_update_parameters: + ~microsoft.codespaces.models.CodespacesPlanUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlan or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlan or + :return: CodespacesPlan or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlan or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL url = self.update.metadata['url'] @@ -273,54 +273,54 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(vsonline_plan_update_parameters, 'VSOPlanUpdateParameters') + body_content = self._serialize.body(codespaces_plan_update_parameters, 'CodespacesPlanUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlan', response) + deserialized = self._deserialize('CodespacesPlan', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}'} - def read_all_environments_action( + def read_all_codespaces_action( self, resource_group_name, plan_name, expiration=None, custom_headers=None, raw=False, **operation_config): - """Get VS Online Plan read environments access token. + """Get Codespaces Plan read codespaces access token. - Get VS Online Plan access token which allows listing all environments - in the Plan. + Get Codespaces Plan access token which allows listing all codespaces in + the Plan. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param expiration: The requested expiration UNIX timestamp (seconds - since epoch) of a VS Online Plan access token. - :type expiration: int + :param expiration: The requested expiration of a Codespaces Plan + access token. + :type expiration: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlanAccessToken or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlanAccessToken or + :return: CodespacesPlanAccessToken or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlanAccessToken or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL - url = self.read_all_environments_action.metadata['url'] + url = self.read_all_codespaces_action.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -332,7 +332,7 @@ def read_all_environments_action( query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if expiration is not None: - query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'int') + query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'long') # Construct headers header_parameters = {} @@ -349,47 +349,47 @@ def read_all_environments_action( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlanAccessToken', response) + deserialized = self._deserialize('CodespacesPlanAccessToken', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - read_all_environments_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}/readAllEnvironments'} + read_all_codespaces_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}/readAllCodespaces'} - def write_environments_action( + def write_codespaces_action( self, resource_group_name, plan_name, expiration=None, custom_headers=None, raw=False, **operation_config): - """Get VS Online Plan write environments access token. + """Get Codespaces Plan write codespaces access token. - Get VS Online Plan access token which allows creating, updating, - deleting and connecting to environments owned by the user. + Get Codespaces Plan access token which allows creating, updating, + deleting and connecting to codespaces owned by the user. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param expiration: The requested expiration UNIX timestamp (seconds - since epoch) of a VS Online Plan access token. - :type expiration: int + :param expiration: The requested expiration of a Codespaces Plan + access token. + :type expiration: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlanAccessToken or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlanAccessToken or + :return: CodespacesPlanAccessToken or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlanAccessToken or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL - url = self.write_environments_action.metadata['url'] + url = self.write_codespaces_action.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -401,7 +401,7 @@ def write_environments_action( query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if expiration is not None: - query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'int') + query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'long') # Construct headers header_parameters = {} @@ -418,47 +418,47 @@ def write_environments_action( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlanAccessToken', response) + deserialized = self._deserialize('CodespacesPlanAccessToken', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - write_environments_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}/writeEnvironments'} + write_codespaces_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}/writeCodespaces'} - def delete_all_environments_action( + def delete_all_codespaces_action( self, resource_group_name, plan_name, expiration=None, custom_headers=None, raw=False, **operation_config): - """Get VS Online Plan read and delete environments access token. + """Get Codespaces Plan read and delete codespaces access token. - Get VS Online Plan access token which allows reading and deleting all - environments in the Plan. + Get Codespaces Plan access token which allows reading and deleting all + codespaces in the Plan. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param expiration: The requested expiration UNIX timestamp (seconds - since epoch) of a VS Online Plan access token. - :type expiration: int + :param expiration: The requested expiration of a Codespaces Plan + access token. + :type expiration: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlanAccessToken or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlanAccessToken or + :return: CodespacesPlanAccessToken or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlanAccessToken or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL - url = self.delete_all_environments_action.metadata['url'] + url = self.delete_all_codespaces_action.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -470,7 +470,7 @@ def delete_all_environments_action( query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if expiration is not None: - query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'int') + query_parameters['expiration'] = self._serialize.query("expiration", expiration, 'long') # Construct headers header_parameters = {} @@ -487,45 +487,45 @@ def delete_all_environments_action( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlanAccessToken', response) + deserialized = self._deserialize('CodespacesPlanAccessToken', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - delete_all_environments_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}/deleteAllEnvironments'} + delete_all_codespaces_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}/deleteAllCodespaces'} def write_delegates_action( self, resource_group_name, plan_name, delegate_request, custom_headers=None, raw=False, **operation_config): - """Get VS Online Plan delegated write environments access token. + """Get Codespaces Plan delegated write codespaces access token. - Get VS Online Plan delegated access token which allows creating, - updating, deleting and connecting to environments owned by the user. + Get Codespaces Plan delegated access token which allows creating, + updating, deleting and connecting to codespaces owned by the user. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param plan_name: Name of the VS Online Plan + :param plan_name: Name of the Codespaces Plan :type plan_name: str - :param delegate_request: VS Online Plan delegate access token + :param delegate_request: Codespaces Plan delegate access token parameters. :type delegate_request: - ~microsoft.vsonline.models.VSOnlineDelegateAccessTokenRequestBody + ~microsoft.codespaces.models.CodespacesDelegateAccessTokenRequestBody :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: VSOnlinePlanAccessToken or ClientRawResponse if raw=true - :rtype: ~microsoft.vsonline.models.VSOnlinePlanAccessToken or + :return: CodespacesPlanAccessToken or ClientRawResponse if raw=true + :rtype: ~microsoft.codespaces.models.CodespacesPlanAccessToken or ~msrest.pipeline.ClientRawResponse :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ # Construct URL url = self.write_delegates_action.metadata['url'] @@ -552,33 +552,33 @@ def write_delegates_action( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(delegate_request, 'VSOnlineDelegateAccessTokenRequestBody') + body_content = self._serialize.body(delegate_request, 'CodespacesDelegateAccessTokenRequestBody') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VSOnlinePlanAccessToken', response) + deserialized = self._deserialize('CodespacesPlanAccessToken', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - write_delegates_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans/{planName}/writeDelegates'} + write_delegates_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans/{planName}/writeDelegates'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Retrieves information about all VS Online Plan resources under the + """Retrieves information about all Codespaces Plan resources under the given subscription and resource group. - Retrieves the properties of all VS Online Plans. + Retrieves the properties of all Codespaces Plans. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -587,11 +587,11 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of VSOnlinePlan + :return: An iterator like instance of CodespacesPlan :rtype: - ~microsoft.vsonline.models.VSOnlinePlanPaged[~microsoft.vsonline.models.VSOnlinePlan] + ~microsoft.codespaces.models.CodespacesPlanPaged[~microsoft.codespaces.models.CodespacesPlan] :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -627,38 +627,38 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) return response # Deserialize response - deserialized = models.VSOnlinePlanPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.CodespacesPlanPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.VSOnlinePlanPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.CodespacesPlanPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VSOnline/plans'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Codespaces/plans'} def list_by_subscription( self, custom_headers=None, raw=False, **operation_config): - """Retrieves information about all VS Online Plan resources under the + """Retrieves information about all Codespaces Plan resources under the given subscription. - Retrieves the properties of all VS Online Plans. + Retrieves the properties of all Codespaces Plans. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of VSOnlinePlan + :return: An iterator like instance of CodespacesPlan :rtype: - ~microsoft.vsonline.models.VSOnlinePlanPaged[~microsoft.vsonline.models.VSOnlinePlan] + ~microsoft.codespaces.models.CodespacesPlanPaged[~microsoft.codespaces.models.CodespacesPlan] :raises: - :class:`VSOPlanErrorResponseException` + :class:`CodespacesPlanErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -693,17 +693,17 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.VSOPlanErrorResponseException(self._deserialize, response) + raise models.CodespacesPlanErrorResponseException(self._deserialize, response) return response # Deserialize response - deserialized = models.VSOnlinePlanPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.CodespacesPlanPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.VSOnlinePlanPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.CodespacesPlanPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VSOnline/plans'} + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Codespaces/plans'} diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/version.py b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/version.py similarity index 93% rename from src/codespaces/azext_codespaces/vendored_sdks/vsonline/version.py rename to src/codespaces/azext_codespaces/vendored_sdks/codespaces/version.py index df4483d4df9..d9eb9ffc08b 100644 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/version.py +++ b/src/codespaces/azext_codespaces/vendored_sdks/codespaces/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "05/26/2020 00:00:00" +VERSION = "06/16/2020 00:00:00" diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/__init__.py b/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/__init__.py deleted file mode 100644 index 2473d5593fe..00000000000 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -try: - from .sku_py3 import Sku - from .vso_account_update_parameters_py3 import VSOAccountUpdateParameters - from .error_definition_py3 import ErrorDefinition - from .vso_account_error_response_py3 import VSOAccountErrorResponse, VSOAccountErrorResponseException - from .resource_py3 import Resource - from .vnet_properties_py3 import VnetProperties - from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay - from .resource_provider_operation_definition_py3 import ResourceProviderOperationDefinition - from .vso_plan_update_parameters_properties_py3 import VSOPlanUpdateParametersProperties - from .vso_plan_update_parameters_py3 import VSOPlanUpdateParameters - from .vso_plan_error_response_py3 import VSOPlanErrorResponse, VSOPlanErrorResponseException - from .vs_online_plan_properties_py3 import VSOnlinePlanProperties - from .vs_online_plan_py3 import VSOnlinePlan - from .vs_online_plan_info_py3 import VSOnlinePlanInfo - from .vs_online_plan_access_token_py3 import VSOnlinePlanAccessToken - from .vs_online_delegate_identity_py3 import VSOnlineDelegateIdentity - from .vs_online_delegate_access_token_request_body_py3 import VSOnlineDelegateAccessTokenRequestBody -except (SyntaxError, ImportError): - from .sku import Sku - from .vso_account_update_parameters import VSOAccountUpdateParameters - from .error_definition import ErrorDefinition - from .vso_account_error_response import VSOAccountErrorResponse, VSOAccountErrorResponseException - from .resource import Resource - from .vnet_properties import VnetProperties - from .resource_provider_operation_display import ResourceProviderOperationDisplay - from .resource_provider_operation_definition import ResourceProviderOperationDefinition - from .vso_plan_update_parameters_properties import VSOPlanUpdateParametersProperties - from .vso_plan_update_parameters import VSOPlanUpdateParameters - from .vso_plan_error_response import VSOPlanErrorResponse, VSOPlanErrorResponseException - from .vs_online_plan_properties import VSOnlinePlanProperties - from .vs_online_plan import VSOnlinePlan - from .vs_online_plan_info import VSOnlinePlanInfo - from .vs_online_plan_access_token import VSOnlinePlanAccessToken - from .vs_online_delegate_identity import VSOnlineDelegateIdentity - from .vs_online_delegate_access_token_request_body import VSOnlineDelegateAccessTokenRequestBody -from .resource_provider_operation_definition_paged import ResourceProviderOperationDefinitionPaged -from .vs_online_plan_paged import VSOnlinePlanPaged -from .vs_online_client_enums import ( - SkuTier, -) - -__all__ = [ - 'Sku', - 'VSOAccountUpdateParameters', - 'ErrorDefinition', - 'VSOAccountErrorResponse', 'VSOAccountErrorResponseException', - 'Resource', - 'VnetProperties', - 'ResourceProviderOperationDisplay', - 'ResourceProviderOperationDefinition', - 'VSOPlanUpdateParametersProperties', - 'VSOPlanUpdateParameters', - 'VSOPlanErrorResponse', 'VSOPlanErrorResponseException', - 'VSOnlinePlanProperties', - 'VSOnlinePlan', - 'VSOnlinePlanInfo', - 'VSOnlinePlanAccessToken', - 'VSOnlineDelegateIdentity', - 'VSOnlineDelegateAccessTokenRequestBody', - 'ResourceProviderOperationDefinitionPaged', - 'VSOnlinePlanPaged', - 'SkuTier', -] diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties.py b/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties.py deleted file mode 100644 index e37c13c75c8..00000000000 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VSOnlinePlanProperties(Model): - """VS Online Additional properties. - - Additional VS Online Plan properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param user_id: unique user assigned id. - :type user_id: str - :ivar service_uri: Service endpoint. - :vartype service_uri: str - :param default_auto_suspend_delay_minutes: Specifies auto suspend interval - for environments in this plan. - :type default_auto_suspend_delay_minutes: int - :param default_environment_sku: Specifies the default environment sku name - for this plan. - :type default_environment_sku: str - :param vnet_properties: Specifies the vnet injection properties for this - plan. - :type vnet_properties: ~microsoft.vsonline.models.VnetProperties - """ - - _validation = { - 'service_uri': {'readonly': True}, - } - - _attribute_map = { - 'user_id': {'key': 'userId', 'type': 'str'}, - 'service_uri': {'key': 'serviceUri', 'type': 'str'}, - 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'int'}, - 'default_environment_sku': {'key': 'defaultEnvironmentSku', 'type': 'str'}, - 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, - } - - def __init__(self, **kwargs): - super(VSOnlinePlanProperties, self).__init__(**kwargs) - self.user_id = kwargs.get('user_id', None) - self.service_uri = None - self.default_auto_suspend_delay_minutes = kwargs.get('default_auto_suspend_delay_minutes', None) - self.default_environment_sku = kwargs.get('default_environment_sku', None) - self.vnet_properties = kwargs.get('vnet_properties', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties_py3.py deleted file mode 100644 index 3b4b6fa1436..00000000000 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vs_online_plan_properties_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VSOnlinePlanProperties(Model): - """VS Online Additional properties. - - Additional VS Online Plan properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param user_id: unique user assigned id. - :type user_id: str - :ivar service_uri: Service endpoint. - :vartype service_uri: str - :param default_auto_suspend_delay_minutes: Specifies auto suspend interval - for environments in this plan. - :type default_auto_suspend_delay_minutes: int - :param default_environment_sku: Specifies the default environment sku name - for this plan. - :type default_environment_sku: str - :param vnet_properties: Specifies the vnet injection properties for this - plan. - :type vnet_properties: ~microsoft.vsonline.models.VnetProperties - """ - - _validation = { - 'service_uri': {'readonly': True}, - } - - _attribute_map = { - 'user_id': {'key': 'userId', 'type': 'str'}, - 'service_uri': {'key': 'serviceUri', 'type': 'str'}, - 'default_auto_suspend_delay_minutes': {'key': 'defaultAutoSuspendDelayMinutes', 'type': 'int'}, - 'default_environment_sku': {'key': 'defaultEnvironmentSku', 'type': 'str'}, - 'vnet_properties': {'key': 'vnetProperties', 'type': 'VnetProperties'}, - } - - def __init__(self, *, user_id: str=None, default_auto_suspend_delay_minutes: int=None, default_environment_sku: str=None, vnet_properties=None, **kwargs) -> None: - super(VSOnlinePlanProperties, self).__init__(**kwargs) - self.user_id = user_id - self.service_uri = None - self.default_auto_suspend_delay_minutes = default_auto_suspend_delay_minutes - self.default_environment_sku = default_environment_sku - self.vnet_properties = vnet_properties diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters.py b/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters.py deleted file mode 100644 index 8902ed05cc2..00000000000 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VSOAccountUpdateParameters(Model): - """Parameters for updating a VS Online Account. - - :param tags: Tags for the VS Online Account. - :type tags: dict[str, str] - :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, **kwargs): - super(VSOAccountUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) diff --git a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters_py3.py b/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters_py3.py deleted file mode 100644 index 46d12c462b5..00000000000 --- a/src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/vso_account_update_parameters_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VSOAccountUpdateParameters(Model): - """Parameters for updating a VS Online Account. - - :param tags: Tags for the VS Online Account. - :type tags: dict[str, str] - :param sku: SKU of the service. - :type sku: ~microsoft.vsonline.models.Sku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, tags=None, sku=None, **kwargs) -> None: - super(VSOAccountUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.sku = sku diff --git a/src/codespaces/azext_codespaces/version.py b/src/codespaces/azext_codespaces/version.py index a6d11f9fd55..e281432f088 100644 --- a/src/codespaces/azext_codespaces/version.py +++ b/src/codespaces/azext_codespaces/version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -VERSION = '0.2.1' +VERSION = '0.3.0'