from ..... pyaz_utils import _call_az

def list(name, namespace_name, resource_group, topic_name):
    '''
    List the keys and connection strings of Authorization Rule for Service Bus Topic.

    Required Parameters:
    - name -- name of Topic Authorization Rule
    - namespace_name -- Name of Namespace
    - resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
    - topic_name -- Name of Topic
    '''
    return _call_az("az servicebus topic authorization-rule keys list", locals())


def renew(name, namespace_name, resource_group, topic_name, key=None, key_value=None):
    '''
    Regenerate keys of Authorization Rule for Service Bus Topic.

    Required Parameters:
    - name -- Name of Topic Authorization Rule
    - namespace_name -- Name of Namespace
    - resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
    - topic_name -- name of Topic

    Optional Parameters:
    - key -- specifies Primary or Secondary key needs to be reset
    - key_value -- Optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType.
    '''
    return _call_az("az servicebus topic authorization-rule keys renew", locals())

