def addItem(self,
                itemParameters,
                filePath=None,
                overwrite=False,
                folder=None,
                dataURL=None,
                url=None,
                text=None,
                relationshipType=None,
                originItemId=None,
                destinationItemId=None,
                serviceProxyParams=None,
                metadata=None,
                multipart=False):
        """
        Adds an item to ArcGIS Online or Portal.
        Te Add Item operation (POST only) is used to upload an item file,
        submit text content, or submit the item URL to the specified user
        folder depending on documented items and item types. This operation
        is available only to the specified user.

        Inputs:
           itemParameters - required except for when multipart = True or SD
                            file. This contains all the information
                            regarding type, tags, etc...
           filePath - if updating the item's content
           overwrite - if the item exists, it overwrites it
           folder - id of the folder to place the item
           dataURL - The URL where the item can be downloaded. The resource
                     will be downloaded and stored as a file type. Similar
                     to uploading a file to be added, but instead of
                     transferring the contents of the file, the URL of the
                     data file is referenced and creates a file item.
           url - The URL of the item to be submitted. The URL can be a URL
                 to a service, a web mapping application, or any other
                 content available at that URL.
           text - The text content for the item to be submitted.
           relationshipType - The type of relationship between the two
                              items. See Relationship types for a complete
                              listing of types.
           originItemId - The item ID of the origin item of the
                          relationship
           destinationItemId - item ID of the destination item of the
                               relationship.
           serviceProxyParams -  JSON object that provides rate limiting
                                 and referrer checks when accessing secured
                                 services.
           metadata - XML meta data file.
           multipart - If true, the file is uploaded in multiple parts. Used
                       for files over 100 MBs in size.
        """
        params = {
            "f" : "json"
        }
        res = ""
        if itemParameters is not None:
            for k,v in itemParameters.value.items():
                if isinstance(v, bool):
                    params[k] = json.dumps(v)
                else:
                    params[k] = v
        if itemParameters.overwrite is not None:
            params['overwrite'] = json.dumps(overwrite)
        if itemParameters.overwrite != overwrite:
            params['overwrite'] = json.dumps(overwrite)
        if dataURL is not None:
            params['dataURL'] = dataURL
        if url is not None:
            params['url'] = url
        if text is not None:
            params['text'] = text
        if relationshipType is not None:
            params['relationshipType'] = relationshipType
        if originItemId is not None:
            params['originItemId'] = originItemId
        if destinationItemId is not None:
            params['destinationItemId'] = destinationItemId
        if serviceProxyParams is not None:
            params['serviceProxyParams'] = serviceProxyParams
        url = "%s/addItem" % self.location
        files = {}
        if multipart:
            res = self._addItemMultiPart(
                itemParameters=itemParameters,
                filePath=filePath)
        else:
            if filePath is not None and os.path.isfile(filePath):
                files['file'] = filePath
                params["filename"] = os.path.basename(filePath)
            elif filePath is not None and multipart:
                params["filename"] = os.path.basename(filePath)
            elif filePath is not None and not os.path.isfile(filePath):
                print ("{0} not found".format(filePath))
            if 'thumbnail' in params:
                v = params['thumbnail']
                del params['thumbnail']
                files['thumbnail'] = v
            if metadata is not None and os.path.isfile(metadata):
                files['metadata'] = metadata
            if len(files) < 1:
                res = self._post(url,
                                 param_dict=params,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port)
            else:
                params['itemType'] = 'file'
                params['async'] = False
                res = self._post(url=url,
                                 param_dict=params,
                                 files=files,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port)
        if (isinstance(res, dict) and \
           "id" not in res):
            raise Exception("Cannot add the item: %s" % res)
        elif (isinstance(res, (UserItem, Item)) and \
              res.id is None):
            raise Exception("Cannot add the item: %s" % str(res))
        elif isinstance(res, (UserItem, Item)):
            return res
        else:
            itemId = res['id']
            return UserItem(url="%s/items/%s" % (self.location, itemId),
                            securityHandler=self._securityHandler,
                        proxy_url=self._proxy_url,
                        proxy_port=self._proxy_port)
Adds an item to ArcGIS Online or Portal.
        Te Add Item operation (POST only) is used to upload an item file,
        submit text content, or submit the item URL to the specified user
        folder depending on documented items and item types. This operation
        is available only to the specified user.

        Inputs:
           itemParameters - required except for when multipart = True or SD
                            file. This contains all the information
                            regarding type, tags, etc...
           filePath - if updating the item's content
           overwrite - if the item exists, it overwrites it
           folder - id of the folder to place the item
           dataURL - The URL where the item can be downloaded. The resource
                     will be downloaded and stored as a file type. Similar
                     to uploading a file to be added, but instead of
                     transferring the contents of the file, the URL of the
                     data file is referenced and creates a file item.
           url - The URL of the item to be submitted. The URL can be a URL
                 to a service, a web mapping application, or any other
                 content available at that URL.
           text - The text content for the item to be submitted.
           relationshipType - The type of relationship between the two
                              items. See Relationship types for a complete
                              listing of types.
           originItemId - The item ID of the origin item of the
                          relationship
           destinationItemId - item ID of the destination item of the
                               relationship.
           serviceProxyParams -  JSON object that provides rate limiting
                                 and referrer checks when accessing secured
                                 services.
           metadata - XML meta data file.
           multipart - If true, the file is uploaded in multiple parts. Used
                       for files over 100 MBs in size.