huskar_api/api/webhook.py
def put(self, webhook_id):
        """To update subscription settings of an application

        Request body schema same to ``POST`` method.

        :param application_name: The name of application.
        :param webhook_id: The id of webhook.
        :param webhoo_type: default 0, set universal with 1
        :status 200: thr request is successful.
        :status 404: The application or webhoook not found.
        """
        webhook = self._get_webhook_or_404(webhook_id)
        self._check_authority(webhook)

        data = request.get_json() or {}
        validate_fields(webhook_schema, data, partial=False)
        if not webhook.is_normal:
            webhook.update_url(data['webhook_url'])
            return api_response()

        application_name = request.args['application_name']
        application = Application.get_by_name(application_name)
        webhook.batch_unsubscribe(application.id)
        webhook.update_url(data['webhook_url'])
        for action_name in data.get('event_list', []):
            action_type = getattr(action_types, action_name)
            webhook.subscribe(application.id, action_type)
        return api_response()
To update subscription settings of an application

        Request body schema same to ``POST`` method.

        :param application_name: The name of application.
        :param webhook_id: The id of webhook.
        :param webhoo_type: default 0, set universal with 1
        :status 200: thr request is successful.
        :status 404: The application or webhoook not found.
        
To update subscription settings of an application
Request body schema same to ``POST`` method.
To update subscription settings of an application Request body schema same to ` ` POST ` ` method .
def put(self, webhook_id):
        webhook = self._get_webhook_or_404(webhook_id)
        self._check_authority(webhook)
        data = request.get_json() or {}
        validate_fields(webhook_schema, data, partial=False)
        if not webhook.is_normal:
            webhook.update_url(data['webhook_url'])
            return api_response()
        application_name = request.args['application_name']
        application = Application.get_by_name(application_name)
        webhook.batch_unsubscribe(application.id)
        webhook.update_url(data['webhook_url'])
        for action_name in data.get('event_list', []):
            action_type = getattr(action_types, action_name)
            webhook.subscribe(application.id, action_type)
        return api_response()
def put ( self , webhook_id ) : webhook = self . _get_webhook_or_404 ( webhook_id ) self . _check_authority ( webhook ) data = request . get_json ( ) or { } validate_fields ( webhook_schema , data , partial = False ) if not webhook . is_normal : webhook . update_url ( data [ 'webhook_url' ] ) return api_response ( ) application_name = request . args [ 'application_name' ] application = Application . get_by_name ( application_name ) webhook . batch_unsubscribe ( application . id ) webhook . update_url ( data [ 'webhook_url' ] ) for action_name in data . get ( 'event_list' , [ ] ) : action_type = getattr ( action_types , action_name ) webhook . subscribe ( application . id , action_type ) return api_response ( )
To update subscription settings of an application
Request body schema same to ``POST`` method.
To update subscription settings of an application Request body schema same to ` ` POST ` ` method .
"""To update subscription settings of an application

        Request body schema same to ``POST`` method.

        :param application_name: The name of application.
        :param webhook_id: The id of webhook.
        :param webhoo_type: default 0, set universal with 1
        :status 200: thr request is successful.
        :status 404: The application or webhoook not found.
        """
self
webhook_id
The id of webhook.
The id of webhook .
application_name
The name of application.
The name of application .
webhoo_type
default 0, set universal with 1
default 0 set universal with 1
status
thr request is successful.
thr request is successful .
status
The application or webhoook not found.
The application or webhoook not found .