putuser

package
v8.14.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Adds and updates users in the native realm. These users are commonly referred to as native users.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type NewPutUser

type NewPutUser func(username string) *PutUser

NewPutUser type alias for index.

func NewPutUserFunc

func NewPutUserFunc(tp elastictransport.Interface) NewPutUser

NewPutUserFunc returns a new instance of PutUser with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type PutUser

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

func New

Adds and updates users in the native realm. These users are commonly referred to as native users.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html

func (PutUser) Do

func (r PutUser) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a putuser.Response

func (*PutUser) Email

func (r *PutUser) Email(email string) *PutUser

API name: email

func (*PutUser) Enabled

func (r *PutUser) Enabled(enabled bool) *PutUser

API name: enabled

func (*PutUser) FullName

func (r *PutUser) FullName(fullname string) *PutUser

API name: full_name

func (*PutUser) Header

func (r *PutUser) Header(key, value string) *PutUser

Header set a key, value pair in the PutUser headers map.

func (*PutUser) HttpRequest

func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*PutUser) Metadata

func (r *PutUser) Metadata(metadata types.Metadata) *PutUser

API name: metadata

func (*PutUser) Password

func (r *PutUser) Password(password string) *PutUser

API name: password

func (*PutUser) PasswordHash

func (r *PutUser) PasswordHash(passwordhash string) *PutUser

API name: password_hash

func (PutUser) Perform

func (r PutUser) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*PutUser) Raw

func (r *PutUser) Raw(raw io.Reader) *PutUser

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*PutUser) Refresh

func (r *PutUser) Refresh(refresh refresh.Refresh) *PutUser

Refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. API name: refresh

func (*PutUser) Request

func (r *PutUser) Request(req *Request) *PutUser

Request allows to set the request property with the appropriate payload.

func (*PutUser) Roles

func (r *PutUser) Roles(roles ...string) *PutUser

API name: roles

type Request

type Request struct {
	Email        string         `json:"email,omitempty"`
	Enabled      *bool          `json:"enabled,omitempty"`
	FullName     string         `json:"full_name,omitempty"`
	Metadata     types.Metadata `json:"metadata,omitempty"`
	Password     *string        `json:"password,omitempty"`
	PasswordHash *string        `json:"password_hash,omitempty"`
	Roles        []string       `json:"roles,omitempty"`
	Username     *string        `json:"username,omitempty"`
}

Request holds the request body struct for the package putuser

https://github.com/elastic/elasticsearch-specification/blob/5fb8f1ce9c4605abcaa44aa0f17dbfc60497a757/specification/security/put_user/SecurityPutUserRequest.ts#L23-L44

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON

func (s *Request) UnmarshalJSON(data []byte) error

type Response

type Response struct {
	Created bool `json:"created"`
}

Response holds the response body struct for the package putuser

https://github.com/elastic/elasticsearch-specification/blob/5fb8f1ce9c4605abcaa44aa0f17dbfc60497a757/specification/security/put_user/SecurityPutUserResponse.ts#L20-L22

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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