code: def set_session_persistence(self, loadbalancer, val):
          
          val = val.upper()
          uri = "/loadbalancers/%s/sessionpersistence" % utils.get_id(loadbalancer)
          req_body = {"sessionPersistence": {
                  "persistenceType": val,
                  }}
          resp, body = self.api.method_put(uri, body=req_body)
          return body
docs: Sets the session persistence for the given load balancer.