def sync(self, sync_item, client=None, clientId=None):
if not client and not clientId:<EOL><INDENT>clientId = X_PLEX_IDENTIFIER<EOL><DEDENT>if not client:<EOL><INDENT>for device in self.devices():<EOL><INDENT>if device.clientIdentifier == clientId:<EOL><INDENT>client = device<EOL>break<EOL><DEDENT><DEDENT>if not client:<EOL><INDENT>raise BadRequest('<STR_LIT>', clientId)<EOL><DEDENT><DEDENT>if '<STR_LIT>' not in client.provides:<EOL><INDENT>raise BadRequest('<STR_LIT>')<EOL><DEDENT>params = {<EOL>'<STR_LIT>': sync_item.title,<EOL>'<STR_LIT>': sync_item.rootTitle,<EOL>'<STR_LIT>': sync_item.metadataType,<EOL>'<STR_LIT>': sync_item.machineIdentifier,<EOL>'<STR_LIT>': sync_item.contentType,<EOL>'<STR_LIT>': sync_item.policy.scope,<EOL>'<STR_LIT>': str(int(sync_item.policy.unwatched)),<EOL>'<STR_LIT>': str(sync_item.policy.value if hasattr(sync_item.policy, '<STR_LIT:value>') else <NUM_LIT:0>),<EOL>'<STR_LIT>': sync_item.location,<EOL>'<STR_LIT>': str(sync_item.mediaSettings.audioBoost),<EOL>'<STR_LIT>': str(sync_item.mediaSettings.maxVideoBitrate),<EOL>'<STR_LIT>': str(sync_item.mediaSettings.musicBitrate),<EOL>'<STR_LIT>': str(sync_item.mediaSettings.photoQuality),<EOL>'<STR_LIT>': sync_item.mediaSettings.photoResolution,<EOL>'<STR_LIT>': str(sync_item.mediaSettings.subtitleSize),<EOL>'<STR_LIT>': str(sync_item.mediaSettings.videoQuality),<EOL>'<STR_LIT>': sync_item.mediaSettings.videoResolution,<EOL>}<EOL>url = SyncList.key.format(clientId=client.clientIdentifier)<EOL>data = self.query(url, method=self._session.post, headers={<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}, params=params)<EOL>return SyncItem(self, data, None, clientIdentifier=client.clientIdentifier)<EOL>
Adds specified sync item for the client. It's always easier to use methods defined directly in the media
            objects, e.g. :func:`plexapi.video.Video.sync`, :func:`plexapi.audio.Audio.sync`.

            Parameters:
                client (:class:`~plexapi.myplex.MyPlexDevice`): a client for which you need to add SyncItem to.
                clientId (str): an identifier of a client for which you need to add SyncItem to.
                sync_item (:class:`plexapi.sync.SyncItem`): prepared SyncItem object with all fields set.

            If both `client` and `clientId` provided the client would be preferred.
            If neither `client` nor `clientId` provided the clientId would be set to current clients`s identifier.

            Returns:
                :class:`plexapi.sync.SyncItem`: an instance of created syncItem.

            Raises:
                :class:`plexapi.exceptions.BadRequest`: when client with provided clientId wasn`t found.
                :class:`plexapi.exceptions.BadRequest`: provided client doesn`t provides `sync-target`.