<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ReplaceTrigger(self, trigger_link, trigger, options=None):
 """Replaces a trigger and returns it. :param str trigger_link: The link to the trigger. :param dict trigger: :param dict options: The request options for the request. :return: The replaced Trigger. :rtype: dict """

        if options is None:
            options = {}

        CosmosClient.__ValidateResource(trigger)
        trigger = trigger.copy()
        if trigger.get('serverScript'):
            trigger['body'] = str(trigger['serverScript'])
        elif trigger.get('body'):
            trigger['body'] = str(trigger['body'])

        path = base.GetPathFromLink(trigger_link)
        trigger_id = base.GetResourceIdOrFullNameFromLink(trigger_link)
        return self.Replace(trigger,
                            path,
                            'triggers',
                            trigger_id,
                            None,
                            options)