users

package
v0.0.0-...-2804b72 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List enumerates the Users to which the current token has access.

Types

type CreateOpts

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

	// DefaultProjectID is the ID of the default project of the user.
	DefaultProjectID string `json:"default_project_id,omitempty"`

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

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

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

	// Extra is free-form extra key/value pairs to describe the user.
	Extra map[string]interface{} `json:"-"`

	// Options are defined options in the API to enable certain features.
	Options map[Option]interface{} `json:"options,omitempty"`

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

CreateOpts implements CreateOptsBuilder

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 temporarily contains the response from the Create call.

func Create

func Create(client *gophercloud.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.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult temporarily contains the response from the Delete call.

func Delete

func Delete(client *gophercloud.ServiceClient, userID string) (r DeleteResult)

Delete deletes a user.

type GetResult

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

GetResult temporarily contains the response from the Get call.

func Get

func Get(client *gophercloud.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.

type ListOpts

type ListOpts struct {
	// DomainID filters the response by a domain ID.
	DomainID string `q:"domain_id"`

	// Enabled filters the response by enabled users.
	Enabled *bool `q:"enabled"`

	// IdpID filters the response by an Identity Provider ID.
	IdPID string `q:"idp_id"`

	// Name filters the response by username.
	Name string `q:"name"`

	// PasswordExpiresAt filters the response based on expiring passwords.
	PasswordExpiresAt string `q:"password_expires_at"`

	// ProtocolID filters the response by protocol ID.
	ProtocolID string `q:"protocol_id"`

	// UniqueID filters the response by unique ID.
	UniqueID string `q:"unique_id"`
}

ListOpts allows you to query the List method.

func (ListOpts) ToUserListQuery

func (opts ListOpts) ToUserListQuery() (string, error)

ToUserListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToUserListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request

type Option

type Option string

Option is a specific option defined at the API to enable features on a user account.

const (
	IgnoreChangePasswordUponFirstUse Option = "ignore_change_password_upon_first_use"
	IgnorePasswordExpiry             Option = "ignore_password_expiry"
	IgnoreLockoutFailureAttempts     Option = "ignore_lockout_failure_attempts"
	MultiFactorAuthRules             Option = "multi_factor_auth_rules"
	MultiFactorAuthEnabled           Option = "multi_factor_auth_enabled"
)

type UpdateOpts

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

	// DefaultProjectID is the ID of the default project of the user.
	DefaultProjectID string `json:"default_project_id,omitempty"`

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

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

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

	// Extra is free-form extra key/value pairs to describe the user.
	Extra map[string]interface{} `json:"-"`

	// Options are defined options in the API to enable certain features.
	Options map[Option]interface{} `json:"options,omitempty"`

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

UpdateOpts implements UpdateOptsBuilder

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 temporarily contains the response from the Update call.

func Update

func Update(client *gophercloud.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.

type User

type User struct {
	// DefaultProjectID is the ID of the default project of the user.
	DefaultProjectID string `json:"default_project_id"`

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

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

	// Enabled is whether or not the user is enabled.
	Enabled bool `json:"enabled"`

	// Extra is a collection of miscellaneous key/values.
	Extra map[string]interface{} `json:"-"`

	// ID is the unique ID of the user.
	ID string `json:"id"`

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

	// Name is the name of the user.
	Name string `json:"name"`

	// Options are a set of defined options of the user.
	Options map[string]interface{} `json:"options"`

	// PasswordExpiresAt is the timestamp when the user's password expires.
	PasswordExpiresAt time.Time `json:"-"`
}

User is a base unit of ownership.

func ExtractUsers

func ExtractUsers(r pagination.Page) ([]User, error)

ExtractUsers returns a slice of Users contained in a single page of results.

func (*User) UnmarshalJSON

func (r *User) UnmarshalJSON(b []byte) error

type UserPage

type UserPage struct {
	pagination.LinkedPageBase
}

UserPage is a single page of User results.

func (UserPage) IsEmpty

func (r UserPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Users contains any results.

func (UserPage) NextPageURL

func (r UserPage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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