code: def GetResourceIdOrFullNameFromLink(resource_link):
      
      # For named based, the resource link is the full name
      if IsNameBased(resource_link):
          return TrimBeginningAndEndingSlashes(resource_link)
      
      # Padding the resource link with leading and trailing slashes if not already
      if resource_link[-1] != '/':
          resource_link = resource_link + '/'
  
      if resource_link[0] != '/':
          resource_link = '/' + resource_link
  
      # The path will be in the form of 
      # /[resourceType]/[resourceId]/ .... /[resourceType]/[resourceId]/ or
      # /[resourceType]/[resourceId]/ .... /[resourceType]/
      # The result of split will be in the form of
      # ["", [resourceType], [resourceId] ... ,[resourceType], [resourceId], ""]
      # In the first case, to extract the resourceId it will the element
      # before last ( at length -2 ) and the the type will before it
      # ( at length -3 )
      # In the second case, to extract the resource type it will the element
      # before last ( at length -2 )
      path_parts = resource_link.split("/")
      if len(path_parts) % 2 == 0:
          # request in form
          # /[resourceType]/[resourceId]/ .... /[resourceType]/[resourceId]/.
          return str(path_parts[-2])
      return None
docs: Gets resource id or full name from resource link.
  
      :param str resource_link:
  
      :return:
          The resource id or full name from the resource link.
      :rtype: str