def Func(arg_0, arg_1, arg_2=False):
        '''
        Retrieves system properties for the specified hosted service. These
        properties include the service name and service type; the name of the
        affinity group to which the service belongs, or its location if it is
        not part of an affinity group; and optionally, information on the
        service's deployments.

        service_name:
            Name of the hosted service.
        embed_detail:
            When True, the management service returns properties for all
            deployments of the service, as well as for the service itself.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('embed_detail', arg_2)
        return arg_0._perform_get(
            arg_0._get_hosted_service_path(arg_1) +
            '?embed-detail=' +
            _str(arg_2).lower(),
            HostedService)


def Func(arg_0, arg_1, arg_2, arg_3=None,
                              arg_4=None, arg_5=None,
                              arg_6=None):
        '''
        Creates a new hosted service in Windows Azure.

        service_name:
            A name for the hosted service that is unique within Windows Azure.
            This name is the DNS prefix name and can be used to access the
            hosted service.
        label:
            A name for the hosted service. The name can be up to 100 characters
            in length. The name can be used to identify the storage account for
            your tracking purposes.
        description:
            A description for the hosted service. The description can be up to
            1024 characters in length.
        location:
            The location where the hosted service will be created. You can
            specify either a location or affinity_group, but not both.
        affinity_group:
            The name of an existing affinity group associated with this
            subscription. This name is a GUID and can be retrieved by examining
            the name element of the response body returned by
            list_affinity_groups. You can specify either a location or
            affinity_group, but not both.
        extended_properties:
            Dictionary containing name/value pairs of storage account
            properties. You can have a maximum of 50 extended property
            name/value pairs. The maximum length of the Name element is 64
            characters, only alphanumeric characters and underscores are valid
            in the Name, and the name must start with a letter. The value has
            a maximum length of 255 characters.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('label', arg_2)
        if arg_5 is None and arg_4 is None:
            raise ValueError(
                'location or affinity_group must be specified')
        if arg_5 is not None and arg_4 is not None:
            raise ValueError(
                'Only one of location or affinity_group needs to be specified')
        return arg_0._perform_post(arg_0._get_hosted_service_path(),
                                  _XmlSerializer.Func_to_xml(
                                      arg_1,
                                      arg_2,
                                      arg_3,
                                      arg_4,
                                      arg_5,
                                      arg_6),
                                  as_async=True)


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified hosted service from Windows Azure.

        service_name:
            Name of the hosted service.
        complete:
            True if all OS/data disks and the source blobs for the disks should
            also be deleted from storage.
        '''

        _validate_not_none('service_name', arg_1)

        arg_3 = arg_0._get_hosted_service_path(arg_1)

        if arg_2 == True:
            arg_3 = arg_3 +'?comp=media'

        return arg_0._perform_delete(arg_3, as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3,
                          arg_4, arg_5, arg_6,
                          arg_7=False,
                          arg_8=False,
                          arg_9=None):
        '''
        Uploads a new service package and creates a new deployment on staging
        or production.

        service_name:
            Name of the hosted service.
        deployment_slot:
            The environment to which the hosted service is deployed. Valid
            values are: staging, production
        name:
            The name for the deployment. The deployment name must be unique
            among other deployments for the hosted service.
        package_url:
            A URL that refers to the location of the service package in the
            Blob service. The service package can be located either in a
            storage account beneath the same subscription or a Shared Access
            Signature (SAS) URI from any storage account.
        label:
            A name for the hosted service. The name can be up to 100 characters
            in length. It is recommended that the label be unique within the
            subscription. The name can be used to identify the hosted service
            for your tracking purposes.
        configuration:
            The base-64 encoded service configuration file for the deployment.
        start_deployment:
            Indicates whether to start the deployment immediately after it is
            created. If false, the service model is still deployed to the
            virtual machines but the code is not run immediately. Instead, the
            service is Suspended until you call Update Deployment Status and
            set the status to Running, at which time the service will be
            started. A deployed service still incurs charges, even if it is
            suspended.
        treat_warnings_as_error:
            Indicates whether to treat package validation warnings as errors.
            If set to true, the Created Deployment operation fails if there
            are validation warnings on the service package.
        extended_properties:
            Dictionary containing name/value pairs of storage account
            properties. You can have a maximum of 50 extended property
            name/value pairs. The maximum length of the Name element is 64
            characters, only alphanumeric characters and underscores are valid
            in the Name, and the name must start with a letter. The value has
            a maximum length of 255 characters.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_slot', arg_2)
        _validate_not_none('name', arg_3)
        _validate_not_none('package_url', arg_4)
        _validate_not_none('label', arg_5)
        _validate_not_none('configuration', arg_6)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_slot(
                arg_1, arg_2),
            _XmlSerializer.Func_to_xml(
                arg_3,
                arg_4,
                arg_5,
                arg_6,
                arg_7,
                arg_8,
                arg_9),
            as_async=True)


def Func(arg_0, arg_1, arg_2,arg_3=False):
        '''
        Deletes the specified deployment.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        arg_4= arg_0._get_deployment_path_using_name(arg_1, arg_2)
        if arg_3:
            arg_4 += '?comp=media'
        return arg_0._perform_delete(
                arg_4,
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Initiates a virtual IP swap between the staging and production
        deployment environments for a service. If the service is currently
        running in the staging environment, it will be swapped to the
        production environment. If it is running in the production
        environment, it will be swapped to staging.

        service_name:
            Name of the hosted service.
        production:
            The name of the production deployment.
        source_deployment:
            The name of the source deployment.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('production', arg_2)
        _validate_not_none('source_deployment', arg_3)
        return arg_0._perform_post(arg_0._get_hosted_service_path(arg_1),
                                  _XmlSerializer.Func_to_xml(
                                      arg_2, arg_3),
                                  as_async=True)


def Func(arg_0, arg_1, arg_2,
                                        arg_3,
                                        arg_4=False,
                                        arg_5='Auto', arg_6=None):
        '''
        Initiates a change to the deployment configuration.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        configuration:
            The base-64 encoded service configuration file for the deployment.
        treat_warnings_as_error:
            Indicates whether to treat package validation warnings as errors.
            If set to true, the Created Deployment operation fails if there
            are validation warnings on the service package.
        mode:
            If set to Manual, WalkUpgradeDomain must be called to apply the
            update. If set to Auto, the Windows Azure platform will
            automatically apply the update To each upgrade domain for the
            service. Possible values are: Auto, Manual
        extended_properties:
            Dictionary containing name/value pairs of storage account
            properties. You can have a maximum of 50 extended property
            name/value pairs. The maximum length of the Name element is 64
            characters, only alphanumeric characters and underscores are valid
            in the Name, and the name must start with a letter. The value has
            a maximum length of 255 characters.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('configuration', arg_3)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(
                arg_1, arg_2) + '/?comp=config',
            _XmlSerializer.change_deployment_to_xml(
                arg_3,
                arg_4,
                arg_5,
                arg_6),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Initiates a change in deployment status.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        status:
            The change to initiate to the deployment status. Possible values
            include:
                Running, Suspended
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('status', arg_3)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(
                arg_1, arg_2) + '/?comp=status',
            _XmlSerializer.Func_to_xml(
                arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2,
                            arg_3):
        '''
        Specifies the next upgrade domain to be walked during manual in-place
        upgrade or configuration change.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        upgrade_domain:
            An integer value that identifies the upgrade domain to walk.
            Upgrade domains are identified with a zero-based index: the first
            upgrade domain has an ID of 0, the second has an ID of 1, and so on.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('upgrade_domain', arg_3)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(
                arg_1, arg_2) + '/?comp=walkupgradedomain',
            _XmlSerializer.Func_to_xml(
                arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2,
                             arg_3):
        '''
        Reinstalls the operating system on instances of web roles or worker
        roles and initializes the storage resources that are used by them. If
        you do not want to initialize storage resources, you can use
        reimage_role_instance.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        role_instance_names:
            List of role instance names.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_instance_names', arg_3)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(
                arg_1, arg_2) + '/roleinstances/?comp=delete',
            _XmlSerializer.role_instances_to_xml(arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2,
                                   arg_3):
        '''
        Deletes a service certificate from the certificate store of a hosted
        service.

        service_name:
            Name of the hosted service.
        thumbalgorithm:
            The algorithm for the certificate's thumbprint.
        thumbprint:
            The hexadecimal representation of the thumbprint.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('thumbalgorithm', arg_2)
        _validate_not_none('thumbprint', arg_3)
        return arg_0._perform_delete(
            '/' + arg_0.subscription_id + '/services/hostedservices/' +
            _str(arg_1) + '/certificates/' +
            _str(arg_2) + '-' + _str(arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        The Add Management Certificate operation adds a certificate to the
        list of management certificates. Management certificates, which are
        also known as subscription certificates, authenticate clients
        attempting to connect to resources associated with your Windows Azure
        subscription.

        public_key:
            A base64 representation of the management certificate public key.
        thumbprint:
            The thumb print that uniquely identifies the management
            certificate.
        data:
            The certificate's raw data in base-64 encoded .cer format.
        '''
        _validate_not_none('public_key', arg_1)
        _validate_not_none('thumbprint', arg_2)
        _validate_not_none('data', arg_3)
        return arg_0._perform_post(
            '/' + arg_0.subscription_id + '/certificates',
            _XmlSerializer.subscription_certificate_to_xml(
                arg_1, arg_2, arg_3))


def Func(arg_0, arg_1):
        '''
        The Delete Management Certificate operation deletes a certificate from
        the list of management certificates. Management certificates, which
        are also known as subscription certificates, authenticate clients
        attempting to connect to resources associated with your Windows Azure
        subscription.

        thumbprint:
            The thumb print that uniquely identifies the management
            certificate.
        '''
        _validate_not_none('thumbprint', arg_1)
        return arg_0._perform_delete(
            '/' + arg_0.subscription_id + '/certificates/' + _str(arg_1))


def Func(arg_0, arg_1):
        '''
        Returns the system properties associated with the specified affinity
        group.

        affinity_group_name:
            The name of the affinity group.
        '''
        _validate_not_none('affinity_group_name', arg_1)
        return arg_0._perform_get(
            '/' + arg_0.subscription_id + '/affinitygroups/' +
            _str(arg_1) + '',
            AffinityGroup)


def Func(arg_0, arg_1):
        '''
        Deletes an affinity group in the specified subscription.

        affinity_group_name:
            The name of the affinity group.
        '''
        _validate_not_none('affinity_group_name', arg_1)
        return arg_0._perform_delete('/' + arg_0.subscription_id + \
                                    '/affinitygroups/' + \
                                    _str(arg_1))


def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                                     arg_4=None, arg_5=None):
        '''
        List subscription operations.

        start_time: Required. An ISO8601 date.
        end_time: Required. An ISO8601 date.
        object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
        operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
        continuation_token: Optional.
        More information at:
        https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
        '''
        arg_1 = ('StartTime=' + arg_1) if arg_1 else ''
        arg_2 = ('EndTime=' + arg_2) if arg_2 else ''
        arg_3 = ('ObjectIdFilter=' + arg_3) if arg_3 else ''
        arg_4 = ('OperationResultFilter=' + arg_4) if arg_4 else ''
        arg_5 = ('ContinuationToken=' + arg_5) if arg_5 else ''

        arg_6 = ('&'.join(v for v in (arg_1, arg_2, arg_3, arg_4, arg_5) if v))
        arg_6 = '?' + arg_6 if arg_6 else ''

        return arg_0._perform_get(arg_0._get_Func_path() + arg_6,
                                 SubscriptionOperationCollection)


def Func(arg_0, arg_1):
        '''
        Deletes a reserved IP address from the specified subscription.

        name:
            Required. Name of the reserved IP address.
        '''
        _validate_not_none('name', arg_1)
        return arg_0._perform_delete(arg_0._get_reserved_ip_path(arg_1),
                                    as_async=True)


def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4=None
    ):
        '''
        Disassociate an existing reservedIP from the given deployment.

        name:
            Required. Name of the reserved IP address.

        service_name:
            Required. Name of the hosted service.

        deployment_name:
            Required. Name of the deployment.

        virtual_ip_name:
            Optional. Name of the VirtualIP in case of multi Vip tenant.
            If this value is not specified default virtualIP is used
            for this operation.
        '''
        _validate_not_none('name', arg_1)
        _validate_not_none('service_name', arg_2)
        _validate_not_none('deployment_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_reserved_ip_path_for_disassociation(arg_1),
            _XmlSerializer.associate_reserved_ip_to_xml(
                arg_2, arg_3, arg_4
            ),
            as_async=True,
            x_ms_version='2015-02-01'
        )


def Func(arg_0, arg_1):
        '''
        Retrieves information about the specified reserved IP address.

        name:
            Required. Name of the reserved IP address.
        '''
        _validate_not_none('name', arg_1)
        return arg_0._perform_get(arg_0._get_reserved_ip_path(arg_1), ReservedIP)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Retrieves the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_get(
            arg_0._Func_path(arg_1, arg_2, arg_3),
            PersistentVMRole)


def Func(arg_0, arg_1, arg_2,
                                          arg_3, arg_4, arg_5,
                                          arg_6, arg_7,
                                          arg_8=None,
                                          arg_9=None,
                                          arg_10=None,
                                          arg_11=None,
                                          arg_12='PersistentVMRole',
                                          arg_13=None,
                                          arg_14=None,
                                          arg_15=None,
                                          arg_16=None,
                                          arg_17=None,
                                          arg_18=None,
                                          arg_19=None):
        '''
        Provisions a virtual machine based on the supplied configuration.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name for the deployment. The deployment name must be unique
            among other deployments for the hosted service.
        deployment_slot:
            The environment to which the hosted service is deployed. Valid
            values are: staging, production
        label:
            Specifies an identifier for the deployment. The label can be up to
            100 characters long. The label can be used for tracking purposes.
        role_name:
            The name of the role.
        system_config:
            Contains the metadata required to provision a virtual machine from
            a Windows or Linux OS image.  Use an instance of
            WindowsConfigurationSet or LinuxConfigurationSet.
        os_virtual_hard_disk:
            Contains the parameters Windows Azure uses to create the operating
            system disk for the virtual machine. If you are creating a Virtual
            Machine by using a VM Image, this parameter is not used.
        network_config:
            Encapsulates the metadata required to create the virtual network
            configuration for a virtual machine. If you do not include a
            network configuration set you will not be able to access the VM
            through VIPs over the internet. If your virtual machine belongs to
            a virtual network you can not specify which subnet address space
            it resides under. Use an instance of ConfigurationSet.
        availability_set_name:
            Specifies the name of an availability set to which to add the
            virtual machine. This value controls the virtual machine
            allocation in the Windows Azure environment. Virtual machines
            specified in the same availability set are allocated to different
            nodes to maximize availability.
        data_virtual_hard_disks:
            Contains the parameters Windows Azure uses to create a data disk
            for a virtual machine.
        role_size:
            The size of the virtual machine to allocate. The default value is
            Small. Possible values are: ExtraSmall,Small,Medium,Large,
            ExtraLarge,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,
            Basic_A4,Standard_D1,Standard_D2,Standard_D3,Standard_D4,
            Standard_D11,Standard_D12,Standard_D13,Standard_D14,Standard_G1,
            Standard_G2,Sandard_G3,Standard_G4,Standard_G5. The specified
            value must be compatible with the disk selected in the
            OSVirtualHardDisk values.
        role_type:
            The type of the role for the virtual machine. The only supported
            value is PersistentVMRole.
        virtual_network_name:
            Specifies the name of an existing virtual network to which the
            deployment will belong.
        resource_extension_references:
            Optional. Contains a collection of resource extensions that are to
            be installed on the Virtual Machine. This element is used if
            provision_guest_agent is set to True. Use an iterable of instances
            of ResourceExtensionReference.
        provision_guest_agent:
            Optional. Indicates whether the VM Agent is installed on the
            Virtual Machine. To run a resource extension in a Virtual Machine,
            this service must be installed.
        vm_image_name:
            Optional. Specifies the name of the VM Image that is to be used to
            create the Virtual Machine. If this is specified, the
            system_config and network_config parameters are not used.
        media_location:
            Optional. Required if the Virtual Machine is being created from a
            published VM Image. Specifies the location of the VHD file that is
            created when VMImageName specifies a published VM Image.
        dns_servers:
            Optional. List of DNS servers (use DnsServer class) to associate
            with the Virtual Machine.
        reserved_ip_name:
            Optional. Specifies the name of a reserved IP address that is to be
            assigned to the deployment. You must run create_reserved_ip_address
            before you can assign the address to the deployment using this
            element.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('deployment_slot', arg_3)
        _validate_not_none('label', arg_4)
        _validate_not_none('role_name', arg_5)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(arg_1),
            _XmlSerializer.virtual_machine_deployment_to_xml(
                arg_2,
                arg_3,
                arg_4,
                arg_5,
                arg_6,
                arg_7,
                arg_12,
                arg_8,
                arg_9,
                arg_10,
                arg_11,
                arg_13,
                arg_14,
                arg_15,
                arg_16,
                arg_17,
                arg_18,
                arg_19),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                 arg_5, arg_6=None,
                 arg_7=None, arg_8=None,
                 arg_9=None, arg_10='PersistentVMRole',
                 arg_11=None,
                 arg_12=None, arg_13=None,
                 arg_14=None):
        '''
        Adds a virtual machine to an existing deployment.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        system_config:
            Contains the metadata required to provision a virtual machine from
            a Windows or Linux OS image.  Use an instance of
            WindowsConfigurationSet or LinuxConfigurationSet.
        os_virtual_hard_disk:
            Contains the parameters Windows Azure uses to create the operating
            system disk for the virtual machine. If you are creating a Virtual
            Machine by using a VM Image, this parameter is not used.
        network_config:
            Encapsulates the metadata required to create the virtual network
            configuration for a virtual machine. If you do not include a
            network configuration set you will not be able to access the VM
            through VIPs over the internet. If your virtual machine belongs to
            a virtual network you can not specify which subnet address space
            it resides under.
        availability_set_name:
            Specifies the name of an availability set to which to add the
            virtual machine. This value controls the virtual machine allocation
            in the Windows Azure environment. Virtual machines specified in the
            same availability set are allocated to different nodes to maximize
            availability.
        data_virtual_hard_disks:
            Contains the parameters Windows Azure uses to create a data disk
            for a virtual machine.
        role_size:
            The size of the virtual machine to allocate. The default value is
            Small. Possible values are: ExtraSmall, Small, Medium, Large,
            ExtraLarge. The specified value must be compatible with the disk
            selected in the OSVirtualHardDisk values.
        role_type:
            The type of the role for the virtual machine. The only supported
            value is PersistentVMRole.
        resource_extension_references:
            Optional. Contains a collection of resource extensions that are to
            be installed on the Virtual Machine. This element is used if
            provision_guest_agent is set to True.
        provision_guest_agent:
            Optional. Indicates whether the VM Agent is installed on the
            Virtual Machine. To run a resource extension in a Virtual Machine,
            this service must be installed.
        vm_image_name:
            Optional. Specifies the name of the VM Image that is to be used to
            create the Virtual Machine. If this is specified, the
            system_config and network_config parameters are not used.
        media_location:
            Optional. Required if the Virtual Machine is being created from a
            published VM Image. Specifies the location of the VHD file that is
            created when VMImageName specifies a published VM Image.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_role_path(arg_1, arg_2),
            _XmlSerializer.Func_to_xml(
                arg_3,
                arg_4,
                arg_5,
                arg_10,
                arg_6,
                arg_7,
                arg_8,
                arg_9,
                arg_11,
                arg_12,
                arg_13,
                arg_14),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4 = False):
        '''
        Deletes the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        complete:
            True if all OS/data disks and the source blobs for the disks should
            also be deleted from storage.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)

        arg_5 = arg_0._get_role_path(arg_1, arg_2, arg_3)

        if arg_4 == True:
            arg_5 = arg_5 +'?comp=media'

        return arg_0._perform_delete(arg_5,
                                    as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3,
                     arg_4, arg_5,
                     arg_6, arg_7=None):
        '''
        The Capture Role operation captures a virtual machine image to your
        image gallery. From the captured image, you can create additional
        customized virtual machines.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        post_capture_action:
            Specifies the action after capture operation completes. Possible
            values are: Delete, Reprovision.
        target_image_name:
            Specifies the image name of the captured virtual machine.
        target_image_label:
            Specifies the friendly name of the captured virtual machine.
        provisioning_configuration:
            Use an instance of WindowsConfigurationSet or LinuxConfigurationSet.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('post_capture_action', arg_4)
        _validate_not_none('target_image_name', arg_5)
        _validate_not_none('target_image_label', arg_6)
        return arg_0._perform_post(
            arg_0._get_role_instance_operations_path(
                arg_1, arg_2, arg_3),
            _XmlSerializer.Func_to_xml(
                arg_4,
                arg_5,
                arg_6,
                arg_7),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Starts the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_role_instance_operations_path(
                arg_1, arg_2, arg_3),
            _XmlSerializer.Func_operation_to_xml(),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Starts the specified virtual machines.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_names:
            The names of the roles, as an enumerable of strings.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_names', arg_3)
        return arg_0._perform_post(
            arg_0._get_roles_operations_path(arg_1, arg_2),
            _XmlSerializer.Func_operation_to_xml(arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3,
                      arg_4='Stopped'):
        '''
        Shuts down the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        post_shutdown_action:
            Specifies how the Virtual Machine should be shut down. Values are:
                Stopped
                    Shuts down the Virtual Machine but retains the compute
                    resources. You will continue to be billed for the resources
                    that the stopped machine uses.
                StoppedDeallocated
                    Shuts down the Virtual Machine and releases the compute
                    resources. You are not billed for the compute resources that
                    this Virtual Machine uses. If a static Virtual Network IP
                    address is assigned to the Virtual Machine, it is reserved.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('post_shutdown_action', arg_4)
        return arg_0._perform_post(
            arg_0._get_role_instance_operations_path(
                arg_1, arg_2, arg_3),
            _XmlSerializer.Func_operation_to_xml(arg_4),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3,
                       arg_4='Stopped'):
        '''
        Shuts down the specified virtual machines.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_names:
            The names of the roles, as an enumerable of strings.
        post_shutdown_action:
            Specifies how the Virtual Machine should be shut down. Values are:
                Stopped
                    Shuts down the Virtual Machine but retains the compute
                    resources. You will continue to be billed for the resources
                    that the stopped machine uses.
                StoppedDeallocated
                    Shuts down the Virtual Machine and releases the compute
                    resources. You are not billed for the compute resources that
                    this Virtual Machine uses. If a static Virtual Network IP
                    address is assigned to the Virtual Machine, it is reserved.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_names', arg_3)
        _validate_not_none('post_shutdown_action', arg_4)
        return arg_0._perform_post(
            arg_0._get_roles_operations_path(arg_1, arg_2),
            _XmlSerializer.Func_operation_to_xml(
                arg_3, arg_4),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Adds a DNS server definition to an existing deployment.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        dns_server_name:
            Specifies the name of the DNS server.
        address:
            Specifies the IP address of the DNS server.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('dns_server_name', arg_3)
        _validate_not_none('address', arg_4)
        return arg_0._perform_post(
            arg_0._get_dns_server_path(arg_1, arg_2),
            _XmlSerializer.dns_server_to_xml(arg_3, arg_4),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Updates the ip address of a DNS server.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        dns_server_name:
            Specifies the name of the DNS server.
        address:
            Specifies the IP address of the DNS server.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('dns_server_name', arg_3)
        _validate_not_none('address', arg_4)
        return arg_0._perform_put(
            arg_0._get_dns_server_path(arg_1,
                                      arg_2,
                                      arg_3),
            _XmlSerializer.dns_server_to_xml(arg_3, arg_4),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Deletes a DNS server from a deployment.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        dns_server_name:
            Name of the DNS server that you want to delete.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('dns_server_name', arg_3)
        return arg_0._perform_delete(
            arg_0._get_dns_server_path(arg_1,
                                      arg_2,
                                      arg_3),
            as_async=True)


def Func(arg_0, arg_1, arg_2):
        '''
        Lists the versions of a resource extension that are available to add
        to a Virtual Machine.

        publisher_name:
            Name of the resource extension publisher.
        extension_name:
            Name of the resource extension.
        '''
        return arg_0._perform_get(arg_0._get_resource_extension_versions_path(
                                    arg_1, arg_2),
                                 ResourceExtensions)


def Func(arg_0, arg_1):
        '''
        Unreplicate a VM image from all regions This operation
        is only for publishers. You have to be registered as image publisher
        with Microsoft Azure to be able to call this

        vm_image_name:
            Specifies the name of the VM Image that is to be used for
            unreplication. The VM Image Name should be the user VM Image,
            not the published name of the VM Image.

        '''
        _validate_not_none('vm_image_name', arg_1)

        return arg_0._perform_put(
            arg_0._get_unreplication_path_using_vm_image_name(arg_1),
            None,
            as_async=True,
            x_ms_version='2015-04-01'
        )


def Func(arg_0, arg_1, arg_2):
        '''
        Share an already replicated OS image. This operation is only for
        publishers. You have to be registered as image publisher with Windows
        Azure to be able to call this.

        vm_image_name:
            The name of the virtual machine image to share
        permission:
            The sharing permission: public, msdn, or private
        '''
        _validate_not_none('vm_image_name', arg_1)
        _validate_not_none('permission', arg_2)

        arg_3 = arg_0._get_sharing_path_using_vm_image_name(arg_1)
        arg_4 = '&permission=' + arg_2
        arg_3 = arg_3 + '?' + arg_4.lstrip('&')

        return arg_0._perform_put(
            arg_3, None, as_async=True, x_ms_version='2015-04-01'
        )


def Func(arg_0, arg_1):
        '''
        Creates a VM Image in the image repository that is associated with the
        specified subscription using a specified set of virtual hard disks.

        vm_image:
            An instance of VMImage class.
        vm_image.name: Required. Specifies the name of the image.
        vm_image.label: Required. Specifies an identifier for the image.
        vm_image.description: Optional. Specifies the description of the image.
        vm_image.os_disk_configuration:
            Required. Specifies configuration information for the operating
            system disk that is associated with the image.
        vm_image.os_disk_configuration.host_caching:
            Optional. Specifies the caching behavior of the operating system disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.os_disk_configuration.os_state:
            Required. Specifies the state of the operating system in the image.
            Possible values are: Generalized, Specialized
            A Virtual Machine that is fully configured and running contains a
            Specialized operating system. A Virtual Machine on which the
            Sysprep command has been run with the generalize option contains a
            Generalized operating system.
        vm_image.os_disk_configuration.os:
            Required. Specifies the operating system type of the image.
        vm_image.os_disk_configuration.media_link:
            Required. Specifies the location of the blob in Windows Azure
            storage. The blob location belongs to a storage account in the
            subscription specified by the <subscription-id> value in the
            operation call.
        vm_image.data_disk_configurations:
            Optional. Specifies configuration information for the data disks
            that are associated with the image. A VM Image might not have data
            disks associated with it.
        vm_image.data_disk_configurations[].host_caching:
            Optional. Specifies the caching behavior of the data disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.data_disk_configurations[].lun:
            Optional if the lun for the disk is 0. Specifies the Logical Unit
            Number (LUN) for the data disk.
        vm_image.data_disk_configurations[].media_link:
            Required. Specifies the location of the blob in Windows Azure
            storage. The blob location belongs to a storage account in the
            subscription specified by the <subscription-id> value in the
            operation call.
        vm_image.data_disk_configurations[].logical_size_in_gb:
            Required. Specifies the size, in GB, of the data disk.
        vm_image.language: Optional. Specifies the language of the image.
        vm_image.image_family:
            Optional. Specifies a value that can be used to group VM Images.
        vm_image.recommended_vm_size:
            Optional. Specifies the size to use for the Virtual Machine that
            is created from the VM Image.
        vm_image.eula:
            Optional. Specifies the End User License Agreement that is
            associated with the image. The value for this element is a string,
            but it is recommended that the value be a URL that points to a EULA.
        vm_image.icon_uri:
            Optional. Specifies the URI to the icon that is displayed for the
            image in the Management Portal.
        vm_image.small_icon_uri:
            Optional. Specifies the URI to the small icon that is displayed for
            the image in the Management Portal.
        vm_image.privacy_uri:
            Optional. Specifies the URI that points to a document that contains
            the privacy policy related to the image.
        vm_image.published_date:
            Optional. Specifies the date when the image was added to the image
            repository.
        vm_image.show_in_gui:
            Optional. Indicates whether the VM Images should be listed in the
            portal.
        '''
        _validate_not_none('vm_image', arg_1)
        _validate_not_none('vm_image.name', arg_1.name)
        _validate_not_none('vm_image.label', arg_1.label)
        _validate_not_none('vm_image.os_disk_configuration.os_state',
                           arg_1.os_disk_configuration.os_state)
        _validate_not_none('vm_image.os_disk_configuration.os',
                           arg_1.os_disk_configuration.os)
        _validate_not_none('vm_image.os_disk_configuration.media_link',
                           arg_1.os_disk_configuration.media_link)
        return arg_0._perform_post(
            arg_0._get_vm_image_path(),
            _XmlSerializer.Func_to_xml(arg_1),
            as_async=True)


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified VM Image from the image repository that is
        associated with the specified subscription.

        vm_image_name:
            The name of the image.
        delete_vhd:
            Deletes the underlying vhd blob in Azure storage.
        '''
        _validate_not_none('vm_image_name', arg_1)
        arg_3 = arg_0._get_vm_image_path(arg_1)
        if arg_2:
            arg_3 += '?comp=media'
        return arg_0._perform_delete(arg_3, as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Adds an OS image that is currently stored in a storage account in your
        subscription to the image repository.

        label:
            Specifies the friendly name of the image.
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the image is located. The blob location must
            belong to a storage account in the subscription specified by the
            <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        name:
            Specifies a name for the OS image that Windows Azure uses to
            identify the image when creating one or more virtual machines.
        os:
            The operating system type of the OS image. Possible values are:
            Linux, Windows
        '''
        _validate_not_none('label', arg_1)
        _validate_not_none('media_link', arg_2)
        _validate_not_none('name', arg_3)
        _validate_not_none('os', arg_4)
        return arg_0._perform_post(arg_0._get_image_path(),
                                  _XmlSerializer.os_image_to_xml(
                                      arg_1, arg_2, arg_3, arg_4),
                                  as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        '''
        Updates an OS image that in your image repository.

        image_name:
            The name of the image to update.
        label:
            Specifies the friendly name of the image to be updated. You cannot
            use this operation to update images provided by the Windows Azure
            platform.
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the image is located. The blob location must
            belong to a storage account in the subscription specified by the
            <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        name:
            Specifies a name for the OS image that Windows Azure uses to
            identify the image when creating one or more VM Roles.
        os:
            The operating system type of the OS image. Possible values are:
            Linux, Windows
        '''
        _validate_not_none('image_name', arg_1)
        _validate_not_none('label', arg_2)
        _validate_not_none('media_link', arg_3)
        _validate_not_none('name', arg_4)
        _validate_not_none('os', arg_5)
        return arg_0._perform_put(arg_0._get_image_path(arg_1),
                                 _XmlSerializer.os_image_to_xml(
                                     arg_2, arg_3, arg_4, arg_5),
                                 as_async=True)


def Func(arg_0, arg_1, arg_2):
        '''
        Updates metadata elements from a given OS image reference.

        image_name:
            The name of the image to update.
        os_image:
            An instance of OSImage class.
        os_image.label: Optional. Specifies an identifier for the image.
        os_image.description: Optional. Specifies the description of the image.
        os_image.language: Optional. Specifies the language of the image.
        os_image.image_family:
            Optional. Specifies a value that can be used to group VM Images.
        os_image.recommended_vm_size:
            Optional. Specifies the size to use for the Virtual Machine that
            is created from the VM Image.
        os_image.eula:
            Optional. Specifies the End User License Agreement that is
            associated with the image. The value for this element is a string,
            but it is recommended that the value be a URL that points to a EULA.
        os_image.icon_uri:
            Optional. Specifies the URI to the icon that is displayed for the
            image in the Management Portal.
        os_image.small_icon_uri:
            Optional. Specifies the URI to the small icon that is displayed for
            the image in the Management Portal.
        os_image.privacy_uri:
            Optional. Specifies the URI that points to a document that contains
            the privacy policy related to the image.
        os_image.published_date:
            Optional. Specifies the date when the image was added to the image
            repository.
        os.image.media_link:
            Required: Specifies the location of the blob in Windows Azure
            blob store where the media for the image is located. The blob
            location must belong to a storage account in the subscription
            specified by the <subscription-id> value in the operation call.
            Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        os_image.name:
            Specifies a name for the OS image that Windows Azure uses to
            identify the image when creating one or more VM Roles.
        os_image.os:
            The operating system type of the OS image. Possible values are:
            Linux, Windows
        '''
        _validate_not_none('image_name', arg_1)
        _validate_not_none('os_image', arg_2)
        return arg_0._perform_put(arg_0._get_image_path(arg_1),
            _XmlSerializer.update_os_image_to_xml(arg_2), as_async=True
        )


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified OS image from your image repository.

        image_name:
            The name of the image.
        delete_vhd:
            Deletes the underlying vhd blob in Azure storage.
        '''
        _validate_not_none('image_name', arg_1)
        arg_3 = arg_0._get_image_path(arg_1)
        if arg_2:
            arg_3 += '?comp=media'
        return arg_0._perform_delete(arg_3, as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Retrieves the specified data disk from a virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            The Logical Unit Number (LUN) for the disk.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        return arg_0._perform_get(
            arg_0._Func_path(
                arg_1, arg_2, arg_3, arg_4),
            DataVirtualHardDisk)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      arg_5=None, arg_6=None, arg_7=None,
                      arg_8=None, arg_9=None,
                      arg_10=None):
        '''
        Adds a data disk to a virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through 15.
        host_caching:
            Specifies the platform caching behavior of data disk blob for
            read/write efficiency. The default vault is ReadOnly. Possible
            values are: None, ReadOnly, ReadWrite
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the disk is located. The blob location must
            belong to the storage account in the subscription specified by the
            <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        disk_label:
            Specifies the description of the data disk. When you attach a disk,
            either by directly referencing a media using the MediaLink element
            or specifying the target disk size, you can use the DiskLabel
            element to customize the name property of the target data disk.
        disk_name:
            Specifies the name of the disk. Windows Azure uses the specified
            disk to create the data disk for the machine and populates this
            field with the disk name.
        logical_disk_size_in_gb:
            Specifies the size, in GB, of an empty disk to be attached to the
            role. The disk can be created as part of disk attach or create VM
            role call by specifying the value for this property. Windows Azure
            creates the empty disk based on size preference and attaches the
            newly created disk to the Role.
        source_media_link:
            Specifies the location of a blob in account storage which is
            mounted as a data disk when the virtual machine is created.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        return arg_0._perform_post(
            arg_0._get_data_disk_path(arg_1, arg_2, arg_3),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                arg_5,
                arg_7,
                arg_8,
                arg_4,
                arg_9,
                arg_6,
                arg_10),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                         arg_5=None, arg_6=None, arg_7=None,
                         arg_8=None, arg_9=None,
                         arg_10=None):
        '''
        Updates the specified data disk attached to the specified virtual
        machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through
            15.
        host_caching:
            Specifies the platform caching behavior of data disk blob for
            read/write efficiency. The default vault is ReadOnly. Possible
            values are: None, ReadOnly, ReadWrite
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the disk is located. The blob location must
            belong to the storage account in the subscription specified by
            the <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        updated_lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through 15.
        disk_label:
            Specifies the description of the data disk. When you attach a disk,
            either by directly referencing a media using the MediaLink element
            or specifying the target disk size, you can use the DiskLabel
            element to customize the name property of the target data disk.
        disk_name:
            Specifies the name of the disk. Windows Azure uses the specified
            disk to create the data disk for the machine and populates this
            field with the disk name.
        logical_disk_size_in_gb:
            Specifies the size, in GB, of an empty disk to be attached to the
            role. The disk can be created as part of disk attach or create VM
            role call by specifying the value for this property. Windows Azure
            creates the empty disk based on size preference and attaches the
            newly created disk to the Role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        return arg_0._perform_put(
            arg_0._get_data_disk_path(
                arg_1, arg_2, arg_3, arg_4),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                arg_5,
                arg_8,
                arg_9,
                arg_7,
                arg_10,
                arg_6,
                None),
            as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=False):
        '''
        Removes the specified data disk from a virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            The Logical Unit Number (LUN) for the disk.
        delete_vhd:
            Deletes the underlying vhd blob in Azure storage.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        arg_6 = arg_0._get_data_disk_path(arg_1, arg_2, arg_3, arg_4)
        if arg_5:
            arg_6 += '?comp=media'
        return arg_0._perform_delete(arg_6, as_async=True)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        '''
        Adds a disk to the user image repository. The disk can be an OS disk
        or a data disk.

        has_operating_system:
            Deprecated.
        label:
            Specifies the description of the disk.
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the disk is located. The blob location must
            belong to the storage account in the current subscription specified
            by the <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        name:
            Specifies a name for the disk. Windows Azure uses the name to
            identify the disk when creating virtual machines from the disk.
        os:
            The OS type of the disk. Possible values are: Linux, Windows
        '''
        _validate_not_none('label', arg_2)
        _validate_not_none('media_link', arg_3)
        _validate_not_none('name', arg_4)
        _validate_not_none('os', arg_5)
        return arg_0._perform_post(arg_0._get_disk_path(),
                                  _XmlSerializer.disk_to_xml(
                                      arg_2,
                                      arg_3,
                                      arg_4,
                                      arg_5))


def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
                    arg_5=None, arg_6=None):
        '''
        Updates an existing disk in your image repository.

        disk_name:
            The name of the disk to update.
        has_operating_system:
            Deprecated.
        label:
            Specifies the description of the disk.
        media_link:
            Deprecated.
        name:
            Deprecated.
        os:
            Deprecated.
        '''
        _validate_not_none('disk_name', arg_1)
        _validate_not_none('label', arg_3)
        return arg_0._perform_put(arg_0._get_disk_path(arg_1),
                                 _XmlSerializer.disk_to_xml(
                                     arg_3,
                                     None,
                                     None,
                                     None))


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified data or operating system disk from your image
        repository.

        disk_name:
            The name of the disk to delete.
        delete_vhd:
            Deletes the underlying vhd blob in Azure storage.
        '''
        _validate_not_none('disk_name', arg_1)
        arg_3 = arg_0._get_disk_path(arg_1)
        if arg_2:
            arg_3 += '?comp=media'
        return arg_0._perform_delete(arg_3)


def Func(arg_0):
        """This is a temporary patch pending a fix in uAMQP."""
        # pylint: disable=protected-access
        arg_0._handler.message_handler = arg_0._handler.receiver_type(
            arg_0._handler._session,
            arg_0._handler._remote_address,
            arg_0._handler._name,
            on_message_received=arg_0._handler._message_received,
            name='receiver-link-{}'.format(uuid.uuid4()),
            debug=arg_0._handler._debug_trace,
            prefetch=arg_0._handler._prefetch,
            max_message_size=arg_0._handler._max_message_size,
            properties=arg_0._handler._link_properties,
            error_policy=arg_0._handler._error_policy,
            encoding=arg_0._handler._encoding)
        if arg_0.mode != ReceiveSettleMode.PeekLock:
            arg_0._handler.message_handler.send_settle_mode = constants.SenderSettleMode.Settled
            arg_0._handler.message_handler.receive_settle_mode = constants.ReceiverSettleMode.ReceiveAndDelete
            arg_0._handler.message_handler._settle_mode = constants.ReceiverSettleMode.ReceiveAndDelete
        arg_0._handler.message_handler.open()


def Func(arg_0, arg_1=None, arg_2=None):
        """Receive a batch of messages at once.

        This approach it optimal if you wish to process multiple messages simultaneously. Note that the
        number of messages retrieved in a single batch will be dependent on
        whether `prefetch` was set for the receiver. This call will prioritize returning
        quickly over meeting a specified batch size, and so will return as soon as at least
        one message is received and there is a gap in incoming messages regardless
        of the specified batch size.

        :param max_batch_size: Maximum number of messages in the batch. Actual number
         returned will depend on prefetch size and incoming stream rate.
        :type max_batch_size: int
        :param timeout: The time to wait in seconds for the first message to arrive.
         If no messages arrive, and no timeout is specified, this call will not return
         until the connection is closed. If specified, an no messages arrive within the
         timeout period, an empty list will be returned.
        :rtype: list[~azure.servicebus.common.message.Message]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func_messages]
                :end-before: [END Func_messages]
                :language: python
                :dedent: 4
                :caption: Get the messages in batch from the receiver

        """
        arg_0._can_run()
        arg_3 = []
        arg_1 = arg_1 or arg_0._handler._prefetch  # pylint: disable=protected-access
        try:
            arg_4 = 1000 * arg_2 if arg_2 else 0
            arg_5 = arg_0._handler.receive_message_batch(
                arg_1=arg_1,
                arg_2=arg_4)
            for arg_6 in arg_5:
                arg_7 = arg_0._build_message(arg_6)
                arg_3.append(arg_7)
        except Exception as e:  # pylint: disable=broad-except
            arg_0._handle_exception(e)
        return arg_3


def Func(arg_0):
        """Renew the session lock.

        This operation must be performed periodically in order to retain a lock on the
        session to continue message processing.
        Once the lock is lost the connection will be closed. This operation can
        also be performed as a threaded background task by registering the session
        with an `azure.servicebus.AutoLockRenew` instance.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func]
                :end-before: [END Func]
                :language: python
                :dedent: 4
                :caption: Renew the session lock before it expires

        """
        arg_0._can_run()
        arg_1 = arg_0._mgmt_request_response(
            REQUEST_RESPONSE_RENEW_SESSION_LOCK_OPERATION,
            {'session-id': arg_0.session_id},
            mgmt_handlers.default)
        arg_0.locked_until = datetime.datetime.fromtimestamp(arg_1[b'expiration']/1000.0)


def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=False, **arg_6):
        """Converts SinglePlacementGroup property to false for a existing virtual
        machine scale set.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param vm_scale_set_name: The name of the virtual machine scale set to
         create or update.
        :type vm_scale_set_name: str
        :param active_placement_group_id: Id of the placement group in which
         you want future virtual machine instances to be placed. To query
         placement group Id, please use Virtual Machine Scale Set VMs - Get
         API. If not provided, the platform will choose one with maximum number
         of virtual machine instances.
        :type active_placement_group_id: 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<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        arg_7 = models.VMScaleSetConvertToSinglePlacementGroupInput(arg_3=arg_3)

        # Construct URL
        arg_8 = arg_0.Func.metadata['url']
        arg_9 = {
            'resourceGroupName': arg_0._serialize.url("resource_group_name", arg_1, 'str'),
            'vmScaleSetName': arg_0._serialize.url("vm_scale_set_name", arg_2, 'str'),
            'subscriptionId': arg_0._serialize.url("self.config.subscription_id", arg_0.config.subscription_id, 'str')
        }
        arg_8 = arg_0._client.format_url(arg_8, **arg_9)

        # Construct parameters
        arg_10 = {}

        # Construct headers
        arg_11 = {}
        arg_11['Content-Type'] = 'application/json; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_11['x-ms-client-request-id'] = str(uuid.uuid1())
        if arg_4:
            arg_11.update(arg_4)
        if arg_0.config.accept_language is not None:
            arg_11['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

        # Construct body
        arg_12 = arg_0._serialize.body(arg_7, 'VMScaleSetConvertToSinglePlacementGroupInput')

        # Construct and send request
        arg_13 = arg_0._client.post(arg_8, arg_10, arg_11, arg_12)
        arg_14 = arg_0._client.send(arg_13, stream=False, **arg_6)

        if arg_14.status_code not in [200]:
            arg_15 = CloudError(arg_14)
            arg_15.request_id = arg_14.headers.get('x-ms-request-id')
            raise arg_15

        if arg_5:
            arg_17 = ClientRawResponse(None, arg_14)
            return arg_17


def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=False, **arg_9):
        """Imports an externally created key, stores it, and returns key
        parameters and attributes to the client.

        The import key operation may be used to import any key type into an
        Azure Key Vault. If the named key already exists, Azure Key Vault
        creates a new version of the key. This operation requires the
        keys/import permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param key_name: Name for the imported key.
        :type key_name: str
        :param key: The Json web key
        :type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
        :param hsm: Whether to import as a hardware key (HSM) or software key.
        :type hsm: bool
        :param key_attributes: The key management attributes.
        :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, 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<msrest:optionsforoperations>`.
        :return: KeyBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
        """
        arg_10 = models.KeyImportParameters(arg_4=arg_4, arg_3=arg_3, arg_5=arg_5, arg_6=arg_6)

        # Construct URL
        arg_11 = arg_0.Func.metadata['url']
        arg_12 = {
            'vaultBaseUrl': arg_0._serialize.url("vault_base_url", arg_1, 'str', skip_quote=True),
            'key-name': arg_0._serialize.url("key_name", arg_2, 'str', pattern=r'^[0-9a-zA-Z-]+$')
        }
        arg_11 = arg_0._client.format_url(arg_11, **arg_12)

        # Construct parameters
        arg_13 = {}
        arg_13['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

        # Construct headers
        arg_14 = {}
        arg_14['Content-Type'] = 'application/json; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_14['x-ms-client-request-id'] = str(uuid.uuid1())
        if arg_7:
            arg_14.update(arg_7)
        if arg_0.config.accept_language is not None:
            arg_14['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

        # Construct body
        arg_15 = arg_0._serialize.body(arg_10, 'KeyImportParameters')

        # Construct and send request
        arg_16 = arg_0._client.put(arg_11, arg_13)
        arg_17 = arg_0._client.send(
            arg_16, arg_14, arg_15, stream=False, **arg_9)

        if arg_17.status_code not in [200]:
            raise models.KeyVaultErrorException(arg_0._deserialize, arg_17)

        arg_18 = None

        if arg_17.status_code == 200:
            arg_18 = arg_0._deserialize('KeyBundle', arg_17)

        if arg_8:
            arg_19 = ClientRawResponse(arg_18, arg_17)
            return arg_19

        return arg_18


def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=False, **arg_9):
        """The update key operation changes specified attributes of a stored key
        and can be applied to any key type and key version stored in Azure Key
        Vault.

        In order to perform this operation, the key must already exist in the
        Key Vault. Note: The cryptographic material of a key itself cannot be
        changed. This operation requires the keys/update permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param key_name: The name of key to update.
        :type key_name: str
        :param key_version: The version of the key to update.
        :type key_version: str
        :param key_ops: Json web key operations. For more information on
         possible key operations, see JsonWebKeyOperation.
        :type key_ops: list[str or
         ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
        :param key_attributes:
        :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, 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<msrest:optionsforoperations>`.
        :return: KeyBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
        """
        arg_10 = models.KeyUpdateParameters(arg_4=arg_4, arg_5=arg_5, arg_6=arg_6)

        # Construct URL
        arg_11 = arg_0.Func.metadata['url']
        arg_12 = {
            'vaultBaseUrl': arg_0._serialize.url("vault_base_url", arg_1, 'str', skip_quote=True),
            'key-name': arg_0._serialize.url("key_name", arg_2, 'str'),
            'key-version': arg_0._serialize.url("key_version", arg_3, 'str')
        }
        arg_11 = arg_0._client.format_url(arg_11, **arg_12)

        # Construct parameters
        arg_13 = {}
        arg_13['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

        # Construct headers
        arg_14 = {}
        arg_14['Content-Type'] = 'application/json; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_14['x-ms-client-request-id'] = str(uuid.uuid1())
        if arg_7:
            arg_14.update(arg_7)
        if arg_0.config.accept_language is not None:
            arg_14['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

        # Construct body
        arg_15 = arg_0._serialize.body(arg_10, 'KeyUpdateParameters')

        # Construct and send request
        arg_16 = arg_0._client.patch(arg_11, arg_13)
        arg_17 = arg_0._client.send(
            arg_16, arg_14, arg_15, stream=False, **arg_9)

        if arg_17.status_code not in [200]:
            raise models.KeyVaultErrorException(arg_0._deserialize, arg_17)

        arg_18 = None

        if arg_17.status_code == 200:
            arg_18 = arg_0._deserialize('KeyBundle', arg_17)

        if arg_8:
            arg_19 = ClientRawResponse(arg_18, arg_17)
            return arg_19

        return arg_18


def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=False, **arg_9):
        """Sets a secret in a specified key vault.

        The SET operation adds a secret to the Azure Key Vault. If the named
        secret already exists, Azure Key Vault creates a new version of that
        secret. This operation requires the secrets/set permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param secret_name: The name of the secret.
        :type secret_name: str
        :param value: The value of the secret.
        :type value: str
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, str]
        :param content_type: Type of the secret value such as a password.
        :type content_type: str
        :param secret_attributes: The secret management attributes.
        :type secret_attributes:
         ~azure.keyvault.v2016_10_01.models.SecretAttributes
        :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<msrest:optionsforoperations>`.
        :return: SecretBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
        """
        arg_10 = models.SecretSetParameters(arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6)

        # Construct URL
        arg_11 = arg_0.Func.metadata['url']
        arg_12 = {
            'vaultBaseUrl': arg_0._serialize.url("vault_base_url", arg_1, 'str', skip_quote=True),
            'secret-name': arg_0._serialize.url("secret_name", arg_2, 'str', pattern=r'^[0-9a-zA-Z-]+$')
        }
        arg_11 = arg_0._client.format_url(arg_11, **arg_12)

        # Construct parameters
        arg_13 = {}
        arg_13['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

        # Construct headers
        arg_14 = {}
        arg_14['Content-Type'] = 'application/json; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_14['x-ms-client-request-id'] = str(uuid.uuid1())
        if arg_7:
            arg_14.update(arg_7)
        if arg_0.config.accept_language is not None:
            arg_14['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

        # Construct body
        arg_15 = arg_0._serialize.body(arg_10, 'SecretSetParameters')

        # Construct and send request
        arg_16 = arg_0._client.put(arg_11, arg_13)
        arg_17 = arg_0._client.send(
            arg_16, arg_14, arg_15, stream=False, **arg_9)

        if arg_17.status_code not in [200]:
            raise models.KeyVaultErrorException(arg_0._deserialize, arg_17)

        arg_18 = None

        if arg_17.status_code == 200:
            arg_18 = arg_0._deserialize('SecretBundle', arg_17)

        if arg_8:
            arg_19 = ClientRawResponse(arg_18, arg_17)
            return arg_19

        return arg_18


def Func(arg_0, arg_1, *, arg_2=None, **arg_3):
        """Create a Service Bus client from a connection string.

        :param conn_str: The connection string.
        :type conn_str: str

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START create_async_servicebus_client_connstr]
                :end-before: [END create_async_servicebus_client_connstr]
                :language: python
                :dedent: 4
                :caption: Create a ServiceBusClient via a connection string.

        """
        arg_4, arg_5, arg_6, arg_7 = parse_conn_str(arg_1)
        arg_8 = urlparse(arg_4)
        arg_9, arg_7, arg_10 = arg_8.hostname.partition('.')
        return arg_0(
            service_namespace=arg_9,
            shared_access_key_name=arg_5,
            shared_access_key_value=arg_6,
            host_base='.' + arg_10,
            arg_2=arg_2,
            **arg_3)


def Func(arg_0, arg_1, arg_2):
        """Get an async client for a subscription entity.

        :param topic_name: The name of the topic.
        :type topic_name: str
        :param subscription_name: The name of the subscription.
        :type subscription_name: str
        :rtype: ~azure.servicebus.aio.async_client.SubscriptionClient
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the subscription is not found.

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START get_async_subscription_client]
                :end-before: [END get_async_subscription_client]
                :language: python
                :dedent: 4
                :caption: Get a TopicClient for the specified topic.

        """
        try:
            arg_3 = arg_0.mgmt_client.Func(arg_1, arg_2)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except AzureServiceBusResourceNotFound:
            raise ServiceBusResourceNotFound("Specificed subscription does not exist.")
        return SubscriptionClient.from_entity(
            arg_0._get_host(), arg_1, arg_3,
            shared_access_key_name=arg_0.shared_access_key_name,
            shared_access_key_value=arg_0.shared_access_key_value,
            loop=arg_0.loop,
            debug=arg_0.debug)


def Func(arg_0, arg_1):
        """Get an async client for all subscription entities in the topic.

        :param topic_name: The topic to list subscriptions for.
        :type topic_name: str
        :rtype: list[~azure.servicebus.aio.async_client.SubscriptionClient]
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the topic is not found.
        """
        try:
            arg_2 = arg_0.mgmt_client.Func(arg_1)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except AzureServiceBusResourceNotFound:
            raise ServiceBusResourceNotFound("Specificed topic does not exist.")
        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(SubscriptionClient.from_entity(
                arg_0._get_host(), arg_1, arg_4,
                shared_access_key_name=arg_0.shared_access_key_name,
                shared_access_key_value=arg_0.shared_access_key_value,
                loop=arg_0.loop,
                debug=arg_0.debug))
        return arg_3


async def Func(arg_0, arg_1, arg_2=0, arg_3=None, **arg_4):
        """Send one or more messages to the current entity.

        This operation will open a single-use connection, Func the supplied messages, and close
        connection. If the entity requires sessions, a session ID must be either
        provided here, or set on each outgoing message.

        :param messages: One or more messages to be sent.
        :type messages: ~azure.servicebus.aio.async_message.Message or
         list[~azure.servicebus.aio.async_message.Message]
        :param message_timeout: The period in seconds during which the Message must be
         sent. If the Func is not completed in this time it will return a failure result.
        :type message_timeout: int
        :param session: An optional session ID. If supplied this session ID will be
         applied to every outgoing message sent with this Sender.
         If an individual message already has a session ID, that will be
         used instead. If no session ID is supplied here, nor set on an outgoing
         message, a ValueError will be raised if the entity is sessionful.
        :type session: str or ~uuid.Guid
        :raises: ~azure.servicebus.common.errors.MessageSendFailed
        :returns: A list of the Func results of all the messages. Each
         Func result is a tuple with two values. The first is a boolean, indicating `True`
         if the message sent, or `False` if it failed. The second is an error if the message
         failed, otherwise it will be `None`.
        :rtype: list[tuple[bool, ~azure.servicebus.common.errors.MessageSendFailed]]

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_Func]
                :end-before: [END queue_client_Func]
                :language: python
                :dedent: 4
                :caption: Send a single message.

            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_Func_multiple]
                :end-before: [END queue_client_Func_multiple]
                :language: python
                :dedent: 4
                :caption: Send multiple messages.

        """
        async with arg_0.get_Funcer(arg_2=arg_2, arg_3=arg_3, **arg_4) as Funcer:
            if isinstance(arg_1, Message):
                Funcer.queue_message(arg_1)
            else:
                try:
                    arg_1 = list(arg_1)
                except TypeError:
                    raise TypeError(
                        "Value of messages must be a 'Message' object or a synchronous iterable of 'Message' objects.")

                for arg_5 in arg_1:
                    if not isinstance(arg_5, Message):
                        raise TypeError("Item in iterator is not of type 'Message'.")
                    Funcer.queue_message(arg_5)

            return await Funcer.Func_pending_messages()


def Func(arg_0, arg_1=None, arg_2=0, arg_3=arg_4.PeekLock, arg_6=0, **arg_7):
        """Get a Receiver for the Service Bus endpoint.

        A Receiver represents a single open connection with which multiple receive operations can be made.

        :param session: A specific session from which to receive. This must be specified for a
         sessionful entity, otherwise it must be None. In order to receive the next available
         session, set this to NEXT_AVAILABLE.
        :type session: str or ~azure.servicebus.common.constants.NEXT_AVAILABLE
        :param prefetch: The maximum number of messages to cache with each request to the service.
         The default value is 0, meaning messages will be received from the service and processed
         one at a time. Increasing this value will improve message throughput performance but increase
         the chance that messages will expire while they are cached if they're not processed fast enough.
        :type prefetch: int
        :param mode: The mode with which messages will be retrieved from the entity. The two options
         are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
         lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
         will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
         the client fails to process the message. The default mode is PeekLock.
        :type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
        :param idle_timeout: The timeout in seconds between received messages after which the receiver will
         automatically shutdown. The default value is 0, meaning no timeout.
        :type idle_timeout: int
        :returns: A Receiver instance with an unopened connection.
        :rtype: ~azure.servicebus.aio.async_receive_handler.Receiver

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START open_close_receiver_context]
                :end-before: [END open_close_receiver_context]
                :language: python
                :dedent: 4
                :caption: Receive messages with a Receiver.

        """
        if arg_0.entity and not arg_0.requires_session and arg_1:
            raise ValueError("A session cannot be used with a non-sessionful entitiy.")
        if arg_0.entity and arg_0.requires_session and not arg_1:
            raise ValueError("This entity requires a session.")
        if int(arg_2) < 0 or int(arg_2) > 50000:
            raise ValueError("Prefetch must be an integer between 0 and 50000 inclusive.")

        arg_2 += 1
        arg_8 = str(uuid.uuid4())
        if arg_1:
            return SessionReceiver(
                arg_8,
                arg_0.entity_uri,
                arg_0.auth_config,
                arg_1=arg_1,
                loop=arg_0.loop,
                debug=arg_0.debug,
                timeout=int(arg_6 * 1000),
                arg_2=arg_2,
                arg_3=arg_3,
                **arg_7)
        return Receiver(
            arg_8,
            arg_0.entity_uri,
            arg_0.auth_config,
            loop=arg_0.loop,
            debug=arg_0.debug,
            timeout=int(arg_6 * 1000),
            arg_2=arg_2,
            arg_3=arg_3,
            **arg_7)


def Func(arg_0):
    ''' Extracts request id from response header. '''

    if arg_0 is None:
        return None

    arg_1 = AsynchronousOperationResult()
    if arg_0.headers:
        for arg_2, arg_3 in arg_0.headers:
            if arg_2.lower() == 'x-ms-request-id':
                arg_1.request_id = arg_3

    return arg_1


def Func(arg_0, arg_1):
        '''
        Returns the status of the specified operation. After calling an
        asynchronous operation, you can call Get Operation Status to determine
        whether the operation has succeeded, failed, or is still in progress.

        request_id:
            The request ID for the request you wish to track.
        '''
        _validate_not_none('request_id', arg_1)
        return arg_0._perform_get(
            '/' + arg_0.subscription_id + '/operations/' + _str(arg_1),
            Operation)


def Func(arg_0, arg_1, arg_2):
        ''' Add additional headers for management. '''

        if arg_1.method in ['PUT', 'POST', 'MERGE', 'DELETE']:
            arg_1.headers.append(('Content-Length', str(len(arg_1.body))))

        # append additional headers base on the service
        arg_1.headers.append(('x-ms-version', arg_2 or arg_0.x_ms_version))

        # if it is not GET or HEAD request, must set content-type.
        if not arg_1.method in ['GET', 'HEAD']:
            for arg_3, arg_4 in arg_1.headers:
                if 'content-type' == arg_3.lower():
                    break
            else:
                arg_1.headers.append(
                    ('Content-Type',
                     arg_0.content_type))

        return arg_1.headers


def Func():
    """Assumed called on Travis, to prepare a package to be deployed

    This method prints on stdout for Travis.
    Return is obj to pass to sys.exit() directly
    """

    arg_0 = os.environ.get('TRAVIS_TAG')
    if not arg_0:
        print("TRAVIS_TAG environment variable is not present")
        return "TRAVIS_TAG environment variable is not present"

    try:
        arg_1, arg_2 = arg_0.split("_")
    except ValueError:
        print("TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(arg_0))
        return "TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(arg_0)

    try:
        arg_2 = Version(arg_2)
    except InvalidVersion:
        print("Version must be a valid PEP440 version (version is: {})".format(arg_2))
        return "Version must be a valid PEP440 version (version is: {})".format(arg_2)

    if arg_1.lower() in OMITTED_RELEASE_PACKAGES:
        print("The input package {} has been disabled for release from Travis.CI.".format(arg_1))
        return

    arg_3 = Path(os.environ['TRAVIS_BUILD_DIR'], 'dist')
    create_package(arg_1, str(arg_3))

    print("Produced:\n{}".format(list(arg_3.glob('*'))))

    arg_4 = "*{}*".format(arg_2)
    arg_5 = list(arg_3.glob(arg_4))
    if not arg_5:
        return "Package version does not match tag {}, abort".format(arg_2)
    arg_6 = os.environ.get("PYPI_SERVER", "default PyPI server")
    print("Package created as expected and will be pushed to {}".format(arg_6))


def Func(
            arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=False, **arg_6):
        """List certificates in a specified key vault.

        The GetCertificates operation returns the set of certificates resources
        in the specified key vault. This operation requires the
        certificates/list permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param maxresults: Maximum number of results to return in a page. If
         not specified the service will return up to 25 results.
        :type maxresults: int
        :param include_pending: Specifies whether to include certificates
         which are not completely provisioned.
        :type include_pending: bool
        :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<msrest:optionsforoperations>`.
        :return: An iterator like instance of CertificateItem
        :rtype:
         ~azure.keyvault.v7_0.models.CertificateItemPaged[~azure.keyvault.v7_0.models.CertificateItem]
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v7_0.models.KeyVaultErrorException>`
        """
        def internal_paging(arg_7=None, arg_5=False):

            if not arg_7:
                # Construct URL
                arg_8 = arg_0.Func.metadata['url']
                arg_9 = {
                    'vaultBaseUrl': arg_0._serialize.url("vault_base_url", arg_1, 'str', skip_quote=True)
                }
                arg_8 = arg_0._client.format_url(arg_8, **arg_9)

                # Construct parameters
                arg_10 = {}
                if arg_2 is not None:
                    arg_10['maxresults'] = arg_0._serialize.query("maxresults", arg_2, 'int', maximum=25, minimum=1)
                if arg_3 is not None:
                    arg_10['includePending'] = arg_0._serialize.query("include_pending", arg_3, 'bool')
                arg_10['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

            else:
                arg_8 = arg_7
                arg_10 = {}

            # Construct headers
            arg_11 = {}
            arg_11['Content-Type'] = 'application/json; charset=utf-8'
            if arg_0.config.generate_client_request_id:
                arg_11['x-ms-client-request-id'] = str(uuid.uuid1())
            if arg_4:
                arg_11.update(arg_4)
            if arg_0.config.accept_language is not None:
                arg_11['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

            # Construct and send request
            arg_12 = arg_0._client.get(arg_8, arg_10)
            arg_13 = arg_0._client.send(
                arg_12, arg_11, stream=False, **arg_6)

            if arg_13.status_code not in [200]:
                raise models.KeyVaultErrorException(arg_0._deserialize, arg_13)

            return arg_13

        # Deserialize response
        arg_14 = models.CertificateItemPaged(internal_paging, arg_0._deserialize.dependencies)

        if arg_5:
            arg_15 = {}
            arg_16 = models.CertificateItemPaged(internal_paging, arg_0._deserialize.dependencies, arg_15)
            return arg_16

        return arg_14


def Func(arg_0):
        '''
        Get list of available service bus regions.
        '''
        arg_1 = arg_0._perform_get(
            arg_0._get_path('services/serviceBus/Regions/', None),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            arg_1,
            _ServiceBusManagementXmlSerializer.xml_to_region)


def Func(arg_0):
        '''
        List the service bus namespaces defined on the account.
        '''
        arg_1 = arg_0._perform_get(
            arg_0._get_path('services/serviceBus/Namespaces/', None),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            arg_1,
            _ServiceBusManagementXmlSerializer.xml_to_namespace)


def Func(arg_0, arg_1, arg_2):
        '''
        Create a new service bus namespace.

        name:
            Name of the service bus namespace to create.
        region:
            Region to create the namespace in.
        '''
        _validate_not_none('name', arg_1)

        return arg_0._perform_put(
            arg_0._get_path('services/serviceBus/Namespaces', arg_1),
            _ServiceBusManagementXmlSerializer.namespace_to_xml(arg_2))


def Func(arg_0, arg_1):
        '''
        Checks to see if the specified service bus namespace is available, or
        if it has already been taken.

        name:
            Name of the service bus namespace to validate.
        '''
        _validate_not_none('name', arg_1)

        arg_2 = arg_0._perform_get(
            arg_0._get_path('services/serviceBus/CheckNamespaceAvailability',
                           None) + '/?namespace=' + _str(arg_1), None)

        return _ServiceBusManagementXmlSerializer.xml_to_namespace_availability(
            arg_2.body)


def Func(arg_0, arg_1):
        '''
        Retrieves the topics in the service namespace.

        name:
            Name of the service bus namespace.
        '''
        arg_2 = arg_0._perform_get(
            arg_0._get_Func_path(arg_1),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            arg_2,
            partial(
                _MinidomXmlToObject.convert_xml_to_azure_object,
                azure_type=TopicDescription
            )
        )