github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/mrs/v2/clusters/results.go (about)

     1  package clusters
     2  
     3  import (
     4  	"github.com/chnsz/golangsdk"
     5  )
     6  
     7  // Cluster is a struct that represents the result of Create methods.
     8  type Cluster struct {
     9  	ID     string `json:"cluster_id"`
    10  	OrdeId string `json:"order_id"`
    11  }
    12  
    13  // CreateResult represents a result of the Create method.
    14  type CreateResult struct {
    15  	golangsdk.Result
    16  }
    17  
    18  // Extract is a method which to extract a cluster response.
    19  func (r CreateResult) Extract() (*Cluster, error) {
    20  	var s Cluster
    21  	err := r.ExtractInto(&s)
    22  	return &s, err
    23  }