code: def list_memberships(self, subject_descriptor, direction=None, depth=None):
          
          route_values = {}
          if subject_descriptor is not None:
              route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str')
          query_parameters = {}
          if direction is not None:
              query_parameters['direction'] = self._serialize.query('direction', direction, 'str')
          if depth is not None:
              query_parameters['depth'] = self._serialize.query('depth', depth, 'int')
          response = self._send(http_method='GET',
                                location_id='e34b6394-6b30-4435-94a9-409a5eef3e31',
                                version='5.1-preview.1',
                                route_values=route_values,
                                query_parameters=query_parameters)
          return self._deserialize('[GraphMembership]', self._unwrap_collection(response))
docs: ListMemberships.
          [Preview API] Get all the memberships where this descriptor is a member in the relationship.
          :param str subject_descriptor: Fetch all direct memberships of this descriptor.
          :param str direction: Defaults to Up.
          :param int depth: The maximum number of edges to traverse up or down the membership tree. Currently the only supported value is '1'.
          :rtype: [GraphMembership]