docstr: Shares a dataset with a list of users.
  
  This method overwrites the list of users that have had access to the dataset
  before. If you want to add someone new to the list, make sure you first fetch
  the list of users with access and include them in the `user_emails`
  parameter.
  
  Args:
      dataset_id:
          ID of the dataset to be shared.
      user_emails:
          List of email addresses of users who will get access to the dataset.
  
  Examples:
    >>> # share a dataset with a user
    >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
    >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=["user@something.com"])
    >>>
    >>> # share dataset with a user while keep sharing it with previous users
    >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
    >>> user_emails = client.get_shared_users(dataset_id="MY_DATASET_ID")
    >>> user_emails.append("additional_user2@something.com")
    >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=user_emails)
    >>>
    >>> # revoke access to all users
    >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
    >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=[])
docstr_tok: ["Shares","a","dataset","with","a","list","of","users",".","This","method","overwrites","the","list","of","users","that","have","had","access","to","the","dataset","before",".","If","you","want","to","add","someone","new","to","the","list",",","make","sure","you","first","fetch","the","list","of","users","with","access","and","include","them","in","the","`","user_emails","`","parameter",".","Args",":","dataset_id",":","ID","of","the","dataset","to","be","shared",".","user_emails",":","List","of","email","addresses","of","users","who","will","get","access","to","the","dataset",".","Examples",":",">",">",">","#","share","a","dataset","with","a","user",">",">",">","client","=","ApiWorkflowClient","(","token=","''","MY_AWESOME_TOKEN","''",")",">",">",">","client.share_dataset_only_with","(","dataset_id=","''","MY_DATASET_ID","''",",","user_emails=","[","``","user","@","something.com","''","]",")",">",">",">",">",">",">","#","share","dataset","with","a","user","while","keep","sharing","it","with","previous","users",">",">",">","client","=","ApiWorkflowClient","(","token=","''","MY_AWESOME_TOKEN","''",")",">",">",">","user_emails","=","client.get_shared_users","(","dataset_id=","''","MY_DATASET_ID","''",")",">",">",">","user_emails.append","(","``","additional_user2","@","something.com","''",")",">",">",">","client.share_dataset_only_with","(","dataset_id=","''","MY_DATASET_ID","''",",","user_emails=user_emails",")",">",">",">",">",">",">","#","revoke","access","to","all","users",">",">",">","client","=","ApiWorkflowClient","(","token=","''","MY_AWESOME_TOKEN","''",")",">",">",">","client.share_dataset_only_with","(","dataset_id=","''","MY_DATASET_ID","''",",","user_emails=","[","]",")"]
code: def share_dataset_only_with(
      self, dataset_id: str, user_emails: List[str]
  ) -> None:
      """Shares a dataset with a list of users.
  
      This method overwrites the list of users that have had access to the dataset
      before. If you want to add someone new to the list, make sure you first fetch
      the list of users with access and include them in the `user_emails`
      parameter.
  
      Args:
          dataset_id:
              ID of the dataset to be shared.
          user_emails:
              List of email addresses of users who will get access to the dataset.
  
      Examples:
        >>> # share a dataset with a user
        >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
        >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=["user@something.com"])
        >>>
        >>> # share dataset with a user while keep sharing it with previous users
        >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
        >>> user_emails = client.get_shared_users(dataset_id="MY_DATASET_ID")
        >>> user_emails.append("additional_user2@something.com")
        >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=user_emails)
        >>>
        >>> # revoke access to all users
        >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
        >>> client.share_dataset_only_with(dataset_id="MY_DATASET_ID", user_emails=[])
      """
      body = SharedAccessConfigCreateRequest(
          access_type=SharedAccessType.WRITE,
          users=user_emails,
          creator=self._creator,
      )
      self._collaboration_api.create_or_update_shared_access_config_by_dataset_id(
          shared_access_config_create_request=body,
          dataset_id=dataset_id,
      )
  
imports: from typing import List
  from lightly.openapi_generated.swagger_client.models import SharedAccessConfigCreateRequest, SharedAccessConfigData, SharedAccessType
label_desc: Use image node_id 1 for calling the _CollaborationMixin obj's underlying member method code with example usage: obj.share_dataset_only_with(dataset_id, user_emails) without return types