Skip to content

Commit

Permalink
CodeGen from PR 13672 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 028aa0cc27bca7d12e3c11cbd4b5cc6cd3034edc into 6ae3b7b
  • Loading branch information
SDKAuto committed Mar 30, 2021
1 parent 9acd878 commit 1eff6f7
Show file tree
Hide file tree
Showing 32 changed files with 837 additions and 2,025 deletions.
4 changes: 2 additions & 2 deletions src/communication/azext_communication/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.11.0"
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.15.0"
}
62 changes: 32 additions & 30 deletions src/communication/azext_communication/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,116 +12,118 @@
from knack.help_files import helps


helps['communication'] = """
helps['communication service'] = """
type: group
short-summary: Manage service with communication
"""

helps['communication list'] = """
helps['communication service list'] = """
type: command
short-summary: "Handles requests to list all resources in a resource group. And Handles requests to list all \
resources in a subscription."
examples:
- name: List by resource group
text: |-
az communication list --resource-group "MyResourceGroup"
az communication service list --resource-group "MyResourceGroup"
- name: List by subscription
text: |-
az communication list
az communication service list
"""

helps['communication show'] = """
helps['communication service show'] = """
type: command
short-summary: "Get the CommunicationService and its properties."
examples:
- name: Get resource
text: |-
az communication show --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service show --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication create'] = """
helps['communication service create'] = """
type: command
short-summary: "Create a new CommunicationService or update an existing CommunicationService."
examples:
- name: Create or update resource
text: |-
az communication create --name "MyCommunicationResource" --location "Global" --data-location "United \
States" --resource-group "MyResourceGroup"
az communication service create --name "MyCommunicationResource" --location "Global" --data-location \
"United States" --resource-group "MyResourceGroup"
"""

helps['communication update'] = """
helps['communication service update'] = """
type: command
short-summary: "Operation to update an existing CommunicationService."
examples:
- name: Update resource
text: |-
az communication update --name "MyCommunicationResource" --tags newTag="newVal" --resource-group \
"MyResourceGroup"
az communication service update --name "MyCommunicationResource" --tags newTag="newVal" \
--resource-group "MyResourceGroup"
"""

helps['communication delete'] = """
helps['communication service delete'] = """
type: command
short-summary: "Operation to delete a CommunicationService."
examples:
- name: Delete resource
text: |-
az communication delete --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service delete --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication link-notification-hub'] = """
helps['communication service link-notification-hub'] = """
type: command
short-summary: "Links an Azure Notification Hub to this communication service."
examples:
- name: Link notification hub
text: |-
az communication link-notification-hub --name "MyCommunicationResource" --connection-string \
az communication service link-notification-hub --name "MyCommunicationResource" --connection-string \
"Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234" --resource-id \
"/subscriptions/12345/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/n\
otificationHubs/MyHub" --resource-group "MyResourceGroup"
"""

helps['communication list-key'] = """
helps['communication service list-key'] = """
type: command
short-summary: "Get the access keys of the CommunicationService resource."
examples:
- name: List keys
text: |-
az communication list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication regenerate-key'] = """
helps['communication service regenerate-key'] = """
type: command
short-summary: "Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at \
the same time."
examples:
- name: Regenerate key
text: |-
az communication regenerate-key --name "MyCommunicationResource" --key-type "Primary" --resource-group \
"MyResourceGroup"
az communication service regenerate-key --name "MyCommunicationResource" --key-type "Primary" \
--resource-group "MyResourceGroup"
"""

helps['communication wait'] = """
helps['communication service wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the communication is met.
short-summary: Place the CLI in a waiting state until a condition of the communication service is met.
examples:
- name: Pause executing next line of CLI script until the communication is successfully created.
- name: Pause executing next line of CLI script until the communication service is successfully created.
text: |-
az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --created
- name: Pause executing next line of CLI script until the communication is successfully deleted.
az communication service wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \
--created
- name: Pause executing next line of CLI script until the communication service is successfully deleted.
text: |-
az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --deleted
az communication service wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \
--deleted
"""

helps['communication'] = """
helps['communication status'] = """
type: group
short-summary: Manage status with communication
"""

helps['communication show-status'] = """
helps['communication status show'] = """
type: command
short-summary: "Gets the current status of an async operation."
examples:
- name: Get OperationStatus
text: |-
az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2"
az communication status show --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2"
"""
24 changes: 14 additions & 10 deletions src/communication/azext_communication/generated/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

def load_arguments(self, _):

with self.argument_context('communication list') as c:
with self.argument_context('communication service list') as c:
c.argument('resource_group_name', resource_group_name_type)

with self.argument_context('communication show') as c:
with self.argument_context('communication service show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication create') as c:
with self.argument_context('communication service create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.')
Expand All @@ -39,41 +39,45 @@ def load_arguments(self, _):
c.argument('data_location', type=str, help='The location where the communication service stores its data at '
'rest.')

with self.argument_context('communication update') as c:
with self.argument_context('communication service update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
validator=get_default_location_from_resource_group)
c.argument('tags', tags_type)
c.argument('data_location', type=str, help='The location where the communication service stores its data at '
'rest.')

with self.argument_context('communication delete') as c:
with self.argument_context('communication service delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication link-notification-hub') as c:
with self.argument_context('communication service link-notification-hub') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('resource_id', type=str, help='The resource ID of the notification hub')
c.argument('connection_string', type=str, help='Connection string for the notification hub')

with self.argument_context('communication list-key') as c:
with self.argument_context('communication service list-key') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.')

with self.argument_context('communication regenerate-key') as c:
with self.argument_context('communication service regenerate-key') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('key_type', arg_type=get_enum_type(['Primary', 'Secondary']), help='The keyType to regenerate. Must '
'be either \'primary\' or \'secondary\'(case-insensitive).')

with self.argument_context('communication wait') as c:
with self.argument_context('communication service wait') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication show-status') as c:
with self.argument_context('communication status show') as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('operation_id', type=str, help='The ID of an ongoing async operation')
31 changes: 17 additions & 14 deletions src/communication/azext_communication/generated/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ def load_command_table(self, _):
operations_tmpl='azext_communication.vendored_sdks.communication.operations._communication_service_operations#C'
'ommunicationServiceOperations.{}',
client_factory=cf_communication_service)
with self.command_group('communication', communication_communication_service,
client_factory=cf_communication_service, is_preview=True) as g:
g.custom_command('list', 'communication_list')
g.custom_show_command('show', 'communication_show')
g.custom_command('create', 'communication_create', supports_no_wait=True)
g.custom_command('update', 'communication_update')
g.custom_command('delete', 'communication_delete', supports_no_wait=True, confirmation=True)
g.custom_command('link-notification-hub', 'communication_link_notification_hub')
g.custom_command('list-key', 'communication_list_key')
g.custom_command('regenerate-key', 'communication_regenerate_key')
g.custom_wait_command('wait', 'communication_show')
with self.command_group('communication service', communication_communication_service,
client_factory=cf_communication_service) as g:
g.custom_command('list', 'communication_service_list')
g.custom_show_command('show', 'communication_service_show')
g.custom_command('create', 'communication_service_create', supports_no_wait=True)
g.custom_command('update', 'communication_service_update')
g.custom_command('delete', 'communication_service_delete', supports_no_wait=True, confirmation=True)
g.custom_command('link-notification-hub', 'communication_service_link_notification_hub')
g.custom_command('list-key', 'communication_service_list_key')
g.custom_command('regenerate-key', 'communication_service_regenerate_key')
g.custom_wait_command('wait', 'communication_service_show')

from azext_communication.generated._client_factory import cf_operation_statuses
communication_operation_statuses = CliCommandType(
operations_tmpl='azext_communication.vendored_sdks.communication.operations._operation_statuses_operations#Oper'
'ationStatusesOperations.{}',
client_factory=cf_operation_statuses)
with self.command_group('communication', communication_operation_statuses, client_factory=cf_operation_statuses,
is_preview=True) as g:
g.custom_command('show-status', 'communication_show_status')
with self.command_group('communication status', communication_operation_statuses,
client_factory=cf_operation_statuses) as g:
g.custom_show_command('show', 'communication_status_show')

with self.command_group('communication', is_preview=True):
pass
Loading

0 comments on commit 1eff6f7

Please sign in to comment.