AI-generated Key Takeaways
- 
          
The AdUnitHierarchyError is caused by creating an AdUnit object with an invalid hierarchy within the InventoryService.
 - 
          
This error inherits from ApiError and includes specific fields like fieldPath, fieldPathElements, trigger, and errorString.
 - 
          
The AdUnitHierarchyError has a 'reason' field which can indicate an INVALID_DEPTH if the ad unit hierarchy is too deep or an INVALID_PARENT if the parent ad unit is invalid for the account type.
 - 
          
The maximum allowed depth for ad units is two below the effective root for Ad Manager 360 accounts and one level for Ad Manager accounts.
 - 
          
The only valid parent for an Ad Manager account is the Network.effectiveRootAdUnitId.
 
Caused by creating an AdUnit object with an invalid hierarchy.
- Namespace
 - 
               
https://www.google.com/apis/ads/publisher/v202508 
                        Field | 
                  |
|---|---|
                        
                           ApiError (inherited)
                      | 
                  |
                        
                           
                      | 
                     
                         
                            The OGNL field path to identify cause of error.  | 
                  
                        
                           
                      | 
                     
                        
                         A parsed copy of the field path. For example, the field path "operations[1].operand" corresponds to this list: {FieldPathElement(field = "operations", index = 1), FieldPathElement(field = "operand", index = null)}.  | 
                  
                        
                           
                      | 
                     
                         
                            The data that caused the error.  | 
                  
                        
                           
                      | 
                     
                         
                            A simple string representation of the error and reason.  | 
                  
                        
                           AdUnitHierarchyError
                        
                      | 
                  |
                        
                           
                      | 
                     
                        
                         
 Enumerations 
  |