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

     1  package environments
     2  
     3  import "github.com/chnsz/golangsdk/pagination"
     4  
     5  // Environment is the structure that represents the detail of the ServiceStage environment.
     6  type Environment struct {
     7  	// The environment ID.
     8  	ID string `json:"id"`
     9  	// The environment name.
    10  	Name string `json:"name"`
    11  	// The environment alias
    12  	Alias string `json:"alias"`
    13  	// The environment description.
    14  	Description string `json:"description"`
    15  	// The project ID.
    16  	ProjectId string `json:"project_id"`
    17  	// The enterprise project ID.
    18  	EnterpriseProjectId string `json:"enterprise_project_id"`
    19  	// The charging mode.
    20  	ChargeMode string `json:"charge_mode"`
    21  	// The VPC ID.
    22  	VpcId string `json:"vpc_id"`
    23  	// The basic resources.
    24  	BaseResources []Resource `json:"base_resources"`
    25  	// The optional resources.
    26  	OptionalResources []Resource `json:"optional_resources"`
    27  	// The Creator.
    28  	Creator string `json:"creator"`
    29  	// The creation time.
    30  	CreatedAt int `json:"create_time"`
    31  	// The update time.
    32  	UpdatedAt int `json:"update_time"`
    33  }
    34  
    35  // EnvironmentPage is a single page maximum result representing a query by offset page.
    36  type EnvironmentPage struct {
    37  	pagination.OffsetPageBase
    38  }
    39  
    40  // ExtractEnvironments is a method to extract the list of environment details for ServiceStage service.
    41  func ExtractEnvironments(r pagination.Page) ([]Environment, error) {
    42  	var s []Environment
    43  	r.(EnvironmentPage).Result.ExtractIntoSlicePtr(&s, "environments")
    44  	return s, nil
    45  }