updateapikey

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Updates attributes of an existing API key.

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 NewUpdateApiKey

type NewUpdateApiKey func(id string) *UpdateApiKey

NewUpdateApiKey type alias for index.

func NewUpdateApiKeyFunc

func NewUpdateApiKeyFunc(tp elastictransport.Interface) NewUpdateApiKey

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

type Request

type Request struct {

	// Metadata Arbitrary metadata that you want to associate with the API key. It supports
	// nested data structure. Within the metadata object, keys beginning with _ are
	// reserved for system usage.
	Metadata map[string]json.RawMessage `json:"metadata,omitempty"`
	// RoleDescriptors An array of role descriptors for this API key. This parameter is optional.
	// When it is not specified or is an empty array, then the API key will have a
	// point in time snapshot of permissions of the authenticated user. If you
	// supply role descriptors then the resultant permissions would be an
	// intersection of API keys permissions and authenticated user’s permissions
	// thereby limiting the access scope for API keys. The structure of role
	// descriptor is the same as the request for create role API. For more details,
	// see create or update roles API.
	RoleDescriptors map[string]types.RoleDescriptor `json:"role_descriptors,omitempty"`
}

Request holds the request body struct for the package updateapikey

https://github.com/elastic/elasticsearch-specification/blob/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/security/update_api_key/Request.ts#L25-L49

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

type Response

type Response struct {
	Updated bool `json:"updated"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

type UpdateApiKey

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

func (UpdateApiKey) Do

func (r UpdateApiKey) Do(ctx context.Context) (*Response, error)

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

func (*UpdateApiKey) Header

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

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

func (*UpdateApiKey) HttpRequest

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

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

func (*UpdateApiKey) Id

func (r *UpdateApiKey) Id(v string) *UpdateApiKey

Id The ID of the API key to update. API Name: id

func (UpdateApiKey) Perform

func (r UpdateApiKey) Perform(ctx context.Context) (*http.Response, error)

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

func (*UpdateApiKey) Raw

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

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

func (*UpdateApiKey) Request

func (r *UpdateApiKey) Request(req *Request) *UpdateApiKey

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

Jump to

Keyboard shortcuts

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