github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/identity/v3.0/users/results.go (about)

     1  package users
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // User represents a User in the OpenStack Identity Service.
     8  type User struct {
     9  	ID               string `json:"id"`
    10  	DomainID         string `json:"domain_id"`
    11  	Name             string `json:"name"`
    12  	Email            string `json:"email"`
    13  	AreaCode         string `json:"areacode"`
    14  	Phone            string `json:"phone"`
    15  	Description      string `json:"description"`
    16  	AccessMode       string `json:"access_mode"`
    17  	Enabled          bool   `json:"enabled"`
    18  	PasswordStatus   bool   `json:"pwd_status"`
    19  	PasswordStrength string `json:"pwd_strength"`
    20  	CreateAt         string `json:"create_time"`
    21  	UpdateAt         string `json:"update_time"`
    22  	LastLogin        string `json:"last_login_time"`
    23  	XuserID          string `json:"xuser_id"`
    24  	XuserType        string `json:"xuser_type"`
    25  
    26  	// Links contains referencing links to the user.
    27  	Links map[string]interface{} `json:"links"`
    28  }
    29  
    30  type userResult struct {
    31  	golangsdk.Result
    32  }
    33  
    34  // GetResult is the response from a Get operation. Call its Extract method
    35  // to interpret it as a User.
    36  type GetResult struct {
    37  	userResult
    38  }
    39  
    40  // CreateResult is the response from a Create operation. Call its Extract method
    41  // to interpret it as a User.
    42  type CreateResult struct {
    43  	userResult
    44  }
    45  
    46  // UpdateResult is the response from an Update operation. Call its Extract
    47  // method to interpret it as a User.
    48  type UpdateResult struct {
    49  	userResult
    50  }
    51  
    52  // Extract interprets any user results as a User.
    53  func (r userResult) Extract() (*User, error) {
    54  	var s struct {
    55  		User *User `json:"user"`
    56  	}
    57  	err := r.ExtractInto(&s)
    58  	return s.User, err
    59  }