github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/imageservice/v2/imageimport/results.go (about)

     1  package imageimport
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  type commonResult struct {
     6  	golangsdk.Result
     7  }
     8  
     9  // GetResult represents the result of a get operation. Call its Extract method
    10  // to interpret it as ImportInfo.
    11  type GetResult struct {
    12  	commonResult
    13  }
    14  
    15  // ImportInfo represents information data for the Import API.
    16  type ImportInfo struct {
    17  	ImportMethods ImportMethods `json:"import-methods"`
    18  }
    19  
    20  // ImportMethods contains information about available Import API methods.
    21  type ImportMethods struct {
    22  	Description string   `json:"description"`
    23  	Type        string   `json:"type"`
    24  	Value       []string `json:"value"`
    25  }
    26  
    27  // Extract is a function that accepts a result and extracts ImportInfo.
    28  func (r commonResult) Extract() (*ImportInfo, error) {
    29  	var s *ImportInfo
    30  	err := r.ExtractInto(&s)
    31  	return s, err
    32  }