:doc:`CodeArtifact <../../codeartifact>` / Client / update_package_versions_status

******************************
update_package_versions_status
******************************



.. py:method:: CodeArtifact.Client.update_package_versions_status(**kwargs)

  

  Updates the status of one or more versions of a package. Using ``UpdatePackageVersionsStatus``, you can update the status of package versions to ``Archived``, ``Published``, or ``Unlisted``. To set the status of a package version to ``Disposed``, use `DisposePackageVersions <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisposePackageVersions.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codeartifact-2018-09-22/UpdatePackageVersionsStatus>`_  


  **Request Syntax**
  ::

    response = client.update_package_versions_status(
        domain='string',
        domainOwner='string',
        repository='string',
        format='npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
        namespace='string',
        package='string',
        versions=[
            'string',
        ],
        versionRevisions={
            'string': 'string'
        },
        expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted',
        targetStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
    )
    
  :type domain: string
  :param domain: **[REQUIRED]** 

    The name of the domain that contains the repository that contains the package versions with a status to be updated.

    

  
  :type domainOwner: string
  :param domainOwner: 

    The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

    

  
  :type repository: string
  :param repository: **[REQUIRED]** 

    The repository that contains the package versions with the status you want to update.

    

  
  :type format: string
  :param format: **[REQUIRED]** 

    A format that specifies the type of the package with the statuses to update.

    

  
  :type namespace: string
  :param namespace: 

    The namespace of the package version to be updated. The package component that specifies its namespace depends on its type. For example:

     

    
    * The namespace of a Maven package version is its ``groupId``.
     
    * The namespace of an npm or Swift package version is its ``scope``.
     
    * The namespace of a generic package is its ``namespace``.
     
    * Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
    

    

  
  :type package: string
  :param package: **[REQUIRED]** 

    The name of the package with the version statuses to update.

    

  
  :type versions: list
  :param versions: **[REQUIRED]** 

    An array of strings that specify the versions of the package with the statuses to update.

    

  
    - *(string) --* 

    

  :type versionRevisions: dict
  :param versionRevisions: 

    A map of package versions and package version revisions. The map ``key`` is the package version (for example, ``3.5.2``), and the map ``value`` is the package version revision.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type expectedStatus: string
  :param expectedStatus: 

    The package version’s expected status before it is updated. If ``expectedStatus`` is provided, the package version's status is updated only if its status at the time ``UpdatePackageVersionsStatus`` is called matches ``expectedStatus``.

    

  
  :type targetStatus: string
  :param targetStatus: **[REQUIRED]** 

    The status you want to change the package version status to.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'successfulVersions': {
              'string': {
                  'revision': 'string',
                  'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
              }
          },
          'failedVersions': {
              'string': {
                  'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
                  'errorMessage': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **successfulVersions** *(dict) --* 

        A list of ``PackageVersionError`` objects, one for each package version with a status that failed to update.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            Contains the revision and status of a package version.

            
            

            - **revision** *(string) --* 

              The revision of a package version.

              
            

            - **status** *(string) --* 

              The status of a package version.

              
        
    
  
      

      - **failedVersions** *(dict) --* 

        A list of ``SuccessfulPackageVersionInfo`` objects, one for each package version with a status that successfully updated.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            l An error associated with package.

            
            

            - **errorCode** *(string) --* 

              The error code associated with the error. Valid error codes are:

               

              
              * ``ALREADY_EXISTS``
               
              * ``MISMATCHED_REVISION``
               
              * ``MISMATCHED_STATUS``
               
              * ``NOT_ALLOWED``
               
              * ``NOT_FOUND``
               
              * ``SKIPPED``
              

              
            

            - **errorMessage** *(string) --* 

              The error message associated with the error.

              
        
    
  
  
  **Exceptions**
  
  *   :py:class:`CodeArtifact.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ConflictException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.InternalServerException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ValidationException`

  