:doc:`CloudDirectory <../../clouddirectory>` / Client / update_facet

************
update_facet
************



.. py:method:: CloudDirectory.Client.update_facet(**kwargs)

  

  Does the following:

   

   
  * Adds new ``Attributes``, ``Rules``, or ``ObjectTypes``.
   
  * Updates existing ``Attributes``, ``Rules``, or ``ObjectTypes``.
   
  * Deletes existing ``Attributes``, ``Rules``, or ``ObjectTypes``.
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/clouddirectory-2017-01-11/UpdateFacet>`_  


  **Request Syntax**
  ::

    response = client.update_facet(
        SchemaArn='string',
        Name='string',
        AttributeUpdates=[
            {
                'Attribute': {
                    'Name': 'string',
                    'AttributeDefinition': {
                        'Type': 'STRING'|'BINARY'|'BOOLEAN'|'NUMBER'|'DATETIME'|'VARIANT',
                        'DefaultValue': {
                            'StringValue': 'string',
                            'BinaryValue': b'bytes',
                            'BooleanValue': True|False,
                            'NumberValue': 'string',
                            'DatetimeValue': datetime(2015, 1, 1)
                        },
                        'IsImmutable': True|False,
                        'Rules': {
                            'string': {
                                'Type': 'BINARY_LENGTH'|'NUMBER_COMPARISON'|'STRING_FROM_SET'|'STRING_LENGTH',
                                'Parameters': {
                                    'string': 'string'
                                }
                            }
                        }
                    },
                    'AttributeReference': {
                        'TargetFacetName': 'string',
                        'TargetAttributeName': 'string'
                    },
                    'RequiredBehavior': 'REQUIRED_ALWAYS'|'NOT_REQUIRED'
                },
                'Action': 'CREATE_OR_UPDATE'|'DELETE'
            },
        ],
        ObjectType='NODE'|'LEAF_NODE'|'POLICY'|'INDEX'
    )
    
  :type SchemaArn: string
  :param SchemaArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) that is associated with the  Facet. For more information, see  arns.

    

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

    The name of the facet.

    

  
  :type AttributeUpdates: list
  :param AttributeUpdates: 

    List of attributes that need to be updated in a given schema  Facet. Each attribute is followed by ``AttributeAction``, which specifies the type of update operation to perform.

    

  
    - *(dict) --* 

      A structure that contains information used to update an attribute.

      

    
      - **Attribute** *(dict) --* 

        The attribute to update.

        

      
        - **Name** *(string) --* **[REQUIRED]** 

          The name of the facet attribute.

          

        
        - **AttributeDefinition** *(dict) --* 

          A facet attribute consists of either a definition or a reference. This structure contains the attribute definition. See `Attribute References <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/schemas_attributereferences.html>`__ for more information.

          

        
          - **Type** *(string) --* **[REQUIRED]** 

            The type of the attribute.

            

          
          - **DefaultValue** *(dict) --* 

            The default value of the attribute (if configured).

            

          
            - **StringValue** *(string) --* 

              A string data value.

              

            
            - **BinaryValue** *(bytes) --* 

              A binary data value.

              

            
            - **BooleanValue** *(boolean) --* 

              A Boolean data value.

              

            
            - **NumberValue** *(string) --* 

              A number data value.

              

            
            - **DatetimeValue** *(datetime) --* 

              A date and time value.

              

            
          
          - **IsImmutable** *(boolean) --* 

            Whether the attribute is mutable or not.

            

          
          - **Rules** *(dict) --* 

            Validation rules attached to the attribute definition.

            

          
            - *(string) --* 

            
              - *(dict) --* 

                Contains an Amazon Resource Name (ARN) and parameters that are associated with the rule.

                

              
                - **Type** *(string) --* 

                  The type of attribute validation rule.

                  

                
                - **Parameters** *(dict) --* 

                  The minimum and maximum parameters that are associated with the rule.

                  

                
                  - *(string) --* 

                  
                    - *(string) --* 

                    
              
            
              
        
      
        
        - **AttributeReference** *(dict) --* 

          An attribute reference that is associated with the attribute. See `Attribute References <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/schemas_attributereferences.html>`__ for more information.

          

        
          - **TargetFacetName** *(string) --* **[REQUIRED]** 

            The target facet name that is associated with the facet reference. See `Attribute References <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/schemas_attributereferences.html>`__ for more information.

            

          
          - **TargetAttributeName** *(string) --* **[REQUIRED]** 

            The target attribute name that is associated with the facet reference. See `Attribute References <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/schemas_attributereferences.html>`__ for more information.

            

          
        
        - **RequiredBehavior** *(string) --* 

          The required behavior of the ``FacetAttribute``.

          

        
      
      - **Action** *(string) --* 

        The action to perform when updating the attribute.

        

      
    

  :type ObjectType: string
  :param ObjectType: 

    The object type that is associated with the facet. See  CreateFacetRequest$ObjectType for more details.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`CloudDirectory.Client.exceptions.InternalServiceException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.InvalidArnException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.RetryableConflictException`

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

  
  *   :py:class:`CloudDirectory.Client.exceptions.LimitExceededException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.InvalidFacetUpdateException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.FacetValidationException`

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

  
  *   :py:class:`CloudDirectory.Client.exceptions.FacetNotFoundException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.InvalidRuleException`

  