users

package
v0.0.0-...-a0f4175 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// Name is the name of the new user.
	Name string `json:"name" required:"true"`

	// DomainID is the ID of the domain the user belongs to.
	DomainID string `json:"domain_id" required:"true"`

	// Password is the password of the new user.
	Password string `json:"password,omitempty"`

	// Email address with a maximum of 255 characters
	Email string `json:"email,omitempty"`

	// AreaCode is a country code, must be used together with Phone.
	AreaCode string `json:"areacode,omitempty"`

	// Phone is a mobile number with a maximum of 32 digits, must be used together with AreaCode.
	Phone string `json:"phone,omitempty"`

	// Description is a description of the user.
	Description string `json:"description,omitempty"`

	// AccessMode is the access type for IAM user
	AccessMode string `json:"access_mode,omitempty"`

	// XUserID is the user ID in the external system, it must be used together with xuser_type.
	XUserID string `json:"xuser_id,omitempty"`

	// XUserType is the user type in the external system. Currently, it can only be "TenantIdp".
	XUserType string `json:"xuser_type,omitempty"`

	// Enabled sets the user status to enabled or disabled.
	Enabled *bool `json:"enabled,omitempty"`

	// PasswordReset Indicates whether password reset is required at the first login.
	// By default, password reset is true.
	PasswordReset *bool `json:"pwd_status,omitempty"`
}

CreateOpts provides options used to create a user.

func (CreateOpts) ToUserCreateMap

func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error)

ToUserCreateMap formats a CreateOpts into a create request.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToUserCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a User.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create creates a new User.

func (CreateResult) Extract

func (r CreateResult) Extract() (*User, error)

Extract interprets any user results as a User.

func (CreateResult) ExtractLoginProtect

func (r CreateResult) ExtractLoginProtect() (*LoginProtect, error)

ExtractLoginProtect interprets any user login protect results as a LoginProtect.

type GetLoginProtectResult

type GetLoginProtectResult struct {
	// contains filtered or unexported fields
}

GetLoginProtectResult is the response from a GetLoginProtect operation. Call its ExtractLoginProtect method to interpret it as a LoginProtect.

func GetLoginProtect

func GetLoginProtect(client *golangsdk.ServiceClient, id string) (r GetLoginProtectResult)

Get retrieves details on a single user login protect, by user ID.

func (GetLoginProtectResult) Extract

func (r GetLoginProtectResult) Extract() (*User, error)

Extract interprets any user results as a User.

func (GetLoginProtectResult) ExtractLoginProtect

func (r GetLoginProtectResult) ExtractLoginProtect() (*LoginProtect, error)

ExtractLoginProtect interprets any user login protect results as a LoginProtect.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult is the response from a Get operation. Call its Extract method to interpret it as a User.

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves details on a single user, by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*User, error)

Extract interprets any user results as a User.

func (GetResult) ExtractLoginProtect

func (r GetResult) ExtractLoginProtect() (*LoginProtect, error)

ExtractLoginProtect interprets any user login protect results as a LoginProtect.

type LoginProtect

type LoginProtect struct {
	Enabled            bool   `json:"enabled"`
	VerificationMethod string `json:"verification_method"`
}

LoginProtect represents a LoginProtect in the OpenStack Identity LoginProtect Service.

type UpdateLoginProtectOpts

type UpdateLoginProtectOpts struct {
	Enabled            *bool  `json:"enabled" required:"true"`
	VerificationMethod string `json:"verification_method" required:"true"`
}

UpdateLoginProtectOpts provides options for updating a user account login protect.

func (UpdateLoginProtectOpts) ToLoginProtectUpdateMap

func (opts UpdateLoginProtectOpts) ToLoginProtectUpdateMap() (map[string]interface{}, error)

ToLoginProtectUpdateMap formats a UpdateLoginProtectOpts into an update request.

type UpdateLoginProtectOptsBuilder

type UpdateLoginProtectOptsBuilder interface {
	ToLoginProtectUpdateMap() (map[string]interface{}, error)
}

UpdateLoginProtectOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateLoginProtectResult

type UpdateLoginProtectResult struct {
	// contains filtered or unexported fields
}

UpdateLoginProtectResult is the response from an UpdateLoginProtect operation. Call its ExtractLoginProtect method to interpret it as a LoginProtect.

func UpdateLoginProtect

func UpdateLoginProtect(client *golangsdk.ServiceClient, userID string,
	opts UpdateLoginProtectOpts) (r UpdateLoginProtectResult)

UpdateLoginProtect updates login protect for user account.

func (UpdateLoginProtectResult) Extract

func (r UpdateLoginProtectResult) Extract() (*User, error)

Extract interprets any user results as a User.

func (UpdateLoginProtectResult) ExtractLoginProtect

func (r UpdateLoginProtectResult) ExtractLoginProtect() (*LoginProtect, error)

ExtractLoginProtect interprets any user login protect results as a LoginProtect.

type UpdateOpts

type UpdateOpts struct {
	// Name is the name of the new user.
	Name string `json:"name,omitempty"`

	// Password is the password of the new user.
	Password string `json:"password,omitempty"`

	// Email address with a maximum of 255 characters
	Email string `json:"email,omitempty"`

	// AreaCode is a country code, must be used together with Phone.
	AreaCode string `json:"areacode,omitempty"`

	// Phone is a mobile number with a maximum of 32 digits. must be used together with AreaCode.
	Phone string `json:"phone,omitempty"`

	// Description is a description of the user.
	Description *string `json:"description,omitempty"`

	// AccessMode is the access type for IAM user
	AccessMode string `json:"access_mode,omitempty"`

	// XUserID is the user ID in the external system, it must be used together with xuser_type.
	XUserID *string `json:"xuser_id,omitempty"`

	// XUserType is the user type in the external system, currently, it can only be "TenantIdp".
	XUserType *string `json:"xuser_type,omitempty"`

	// Enabled sets the user status to enabled or disabled.
	Enabled *bool `json:"enabled,omitempty"`

	// PasswordReset Indicates whether password reset is required
	PasswordReset *bool `json:"pwd_status,omitempty"`
}

UpdateOpts provides options for updating a user account.

func (UpdateOpts) ToUserUpdateMap

func (opts UpdateOpts) ToUserUpdateMap() (map[string]interface{}, error)

ToUserUpdateMap formats a UpdateOpts into an update request.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToUserUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a User.

func Update

func Update(client *golangsdk.ServiceClient, userID string, opts UpdateOptsBuilder) (r UpdateResult)

Update updates an existing User.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*User, error)

Extract interprets any user results as a User.

func (UpdateResult) ExtractLoginProtect

func (r UpdateResult) ExtractLoginProtect() (*LoginProtect, error)

ExtractLoginProtect interprets any user login protect results as a LoginProtect.

type User

type User struct {
	ID               string `json:"id"`
	DomainID         string `json:"domain_id"`
	Name             string `json:"name"`
	Email            string `json:"email"`
	AreaCode         string `json:"areacode"`
	Phone            string `json:"phone"`
	Description      string `json:"description"`
	AccessMode       string `json:"access_mode"`
	Enabled          bool   `json:"enabled"`
	PasswordStatus   bool   `json:"pwd_status"`
	PasswordStrength string `json:"pwd_strength"`
	CreateAt         string `json:"create_time"`
	UpdateAt         string `json:"update_time"`
	LastLogin        string `json:"last_login_time"`
	XUserID          string `json:"xuser_id"`
	XUserType        string `json:"xuser_type"`

	// Links contains referencing links to the user.
	Links map[string]interface{} `json:"links"`
}

User represents a User in the OpenStack Identity Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL