code: func (i *IAMPolicyDocument) UnmarshalJSON(data []byte) error {
  	// Handle single statement policy documents
  	var v iamPolicyDocumentSingleStatement
  	err := json.Unmarshal(data, &v)
  	if err == nil {
  		i.Version = v.Version
  		i.Statement = []IAMPolicyStatement{v.Statement}
  		return nil
  	}
  
  	// Handle multiple statements
  	var v2 iamPolicyDocumentCopy
  	err = json.Unmarshal(data, &v2)
  	if err != nil {
  		return err
  	}
  
  	i.Version = v2.Version
  	i.Statement = v2.Statement
  
  	return nil
  }
docs: // UnmarshalJSON sets the object from the provided JSON representation. This has
  // been added to handle the special case of a single statement versus an array.