github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/eps/v1/enterpriseprojects/results.go (about)

     1  package enterpriseprojects
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  type Project struct {
     6  	ID          string `json:"id"`
     7  	Name        string `json:"name"`
     8  	Description string `json:"description"`
     9  	Status      int    `json:"status"`
    10  	CreatedAt   string `json:"created_at"`
    11  	UpdatedAt   string `json:"updated_at"`
    12  	Type        string `json:"type"`
    13  }
    14  
    15  type Projects struct {
    16  	EnterpriseProjects []Project `json:"enterprise_projects"`
    17  	TotalCount         int       `json:"total_count"`
    18  }
    19  
    20  type ListResult struct {
    21  	golangsdk.Result
    22  }
    23  
    24  func (r ListResult) Extract() ([]Project, error) {
    25  	var a struct {
    26  		EnterpriseProjects []Project `json:"enterprise_projects"`
    27  	}
    28  	err := r.Result.ExtractInto(&a)
    29  	return a.EnterpriseProjects, err
    30  }