github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/identity/v3.0/security/GetLoginProtectionConfiguration.go (about)

     1  package security
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func GetLoginProtectionConfiguration(client *golangsdk.ServiceClient, id string) (*LoginProtectionConfig, error) {
     9  	// GET /v3.0/OS-USER/users/{user_id}/login-protect
    10  	raw, err := client.Get(client.ServiceURL("OS-USER", "users", id, "login-protect"), nil, nil)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  	var res LoginProtectionConfig
    15  	err = extract.IntoStructPtr(raw.Body, &res, "login_protect")
    16  	return &res, err
    17  }
    18  
    19  type LoginProtectionConfig struct {
    20  	// Indicates whether login protection has been enabled for a user. The value can be true or false.
    21  	Enabled *bool `json:"enabled"`
    22  	// User ID.
    23  	UserId string `json:"user_id"`
    24  	// Login authentication method of the user.
    25  	VerificationMethod string `json:"verification_method"`
    26  }