Skip to content

Commit

Permalink
role mapping not rule mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Sheffield committed Feb 16, 2023
1 parent 60bb3f9 commit 37ba963
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 142 deletions.
20 changes: 10 additions & 10 deletions opensearchapi/api._.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ type Remote struct {

// Security contains the Security APIs
type Security struct {
Create CreateSecurityRuleMapping
Patch PatchSecurityRuleMapping
Delete DeleteSecurityRuleMapping
Get GetSecurityRuleMapping
List ListSecurityRuleMapping
Create CreateSecurityRoleMapping
Patch PatchSecurityRoleMapping
Delete DeleteSecurityRoleMapping
Get GetSecurityRoleMapping
List ListSecurityRoleMapping
}

// Snapshot contains the Snapshot APIs
Expand Down Expand Up @@ -380,11 +380,11 @@ func New(t Transport) *API {
},
Remote: &Remote{},
Security: &Security{
Create: newCreateSecurityRuleMappingFunc(t),
Patch: newPatchSecurityRuleMappingFunc(t),
Delete: newDeleteSecurityRuleMappingFunc(t),
Get: newGetSecurityRuleMappingFunc(t),
List: newListSecurityRuleMappingFunc(t),
Create: newCreateSecurityRoleMappingFunc(t),
Patch: newPatchSecurityRoleMappingFunc(t),
Delete: newDeleteSecurityRoleMappingFunc(t),
Get: newGetSecurityRoleMappingFunc(t),
List: newListSecurityRoleMappingFunc(t),
},
Snapshot: &Snapshot{
CleanupRepository: newSnapshotCleanupRepositoryFunc(t),
Expand Down
44 changes: 22 additions & 22 deletions opensearchapi/api.security.create.rule_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
)

func newCreateSecurityRuleMappingFunc(t Transport) CreateSecurityRuleMapping {
return func(name string, body io.Reader, o ...func(*CreateSecurityRuleMappingRequest)) (*Response, error) {
var r = CreateSecurityRuleMappingRequest{Name: name, Body: body}
func newCreateSecurityRoleMappingFunc(t Transport) CreateSecurityRoleMapping {
return func(name string, body io.Reader, o ...func(*CreateSecurityRoleMappingRequest)) (*Response, error) {
var r = CreateSecurityRoleMappingRequest{Name: name, Body: body}
for _, f := range o {
f(&r)
}
Expand All @@ -19,15 +19,15 @@ func newCreateSecurityRuleMappingFunc(t Transport) CreateSecurityRuleMapping {

// ----- API Definition -------------------------------------------------------

// CreateSecurityRuleMapping creates a role mapping
// CreateSecurityRoleMapping creates a role mapping
//
// To use this API, you must have at least the manage_security cluster privilege.
//
// https://opensearch.org/docs/2.3/security/access-control/api/#create-role-mapping
type CreateSecurityRuleMapping func(name string, body io.Reader, o ...func(*CreateSecurityRuleMappingRequest)) (*Response, error)
type CreateSecurityRoleMapping func(name string, body io.Reader, o ...func(*CreateSecurityRoleMappingRequest)) (*Response, error)

// CreateSecurityRuleMappingRequest configures the Create Security Rule Mapping API request.
type CreateSecurityRuleMappingRequest struct {
// CreateSecurityRoleMappingRequest configures the Create Security Rule Mapping API request.
type CreateSecurityRoleMappingRequest struct {
Name string

Body io.Reader
Expand All @@ -43,7 +43,7 @@ type CreateSecurityRuleMappingRequest struct {
}

// Do will execute the request and returns response or error.
func (r CreateSecurityRuleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
func (r CreateSecurityRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
var (
method string
path strings.Builder
Expand Down Expand Up @@ -117,43 +117,43 @@ func (r CreateSecurityRuleMappingRequest) Do(ctx context.Context, transport Tran
}

// WithContext sets the request context.
func (f CreateSecurityRuleMapping) WithContext(v context.Context) func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithContext(v context.Context) func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
r.ctx = v
}
}

// WithPretty makes the response body pretty-printed.
func (f CreateSecurityRuleMapping) WithPretty() func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithPretty() func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
r.Pretty = true
}
}

// WithHuman makes statistical values human-readable.
func (f CreateSecurityRuleMapping) WithHuman() func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithHuman() func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
r.Human = true
}
}

// WithErrorTrace includes the stack trace for errors in the response body.
func (f CreateSecurityRuleMapping) WithErrorTrace() func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithErrorTrace() func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
r.ErrorTrace = true
}
}

// WithFilterPath filters the properties of the response body.
func (f CreateSecurityRuleMapping) WithFilterPath(v ...string) func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithFilterPath(v ...string) func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
r.FilterPath = v
}
}

// WithHeader adds the headers to the HTTP request.
func (f CreateSecurityRuleMapping) WithHeader(h map[string]string) func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithHeader(h map[string]string) func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand All @@ -164,8 +164,8 @@ func (f CreateSecurityRuleMapping) WithHeader(h map[string]string) func(*CreateS
}

// WithOpaqueID adds the X-Opaque-Id header to the HTTP request.
func (f CreateSecurityRuleMapping) WithOpaqueID(s string) func(*CreateSecurityRuleMappingRequest) {
return func(r *CreateSecurityRuleMappingRequest) {
func (f CreateSecurityRoleMapping) WithOpaqueID(s string) func(*CreateSecurityRoleMappingRequest) {
return func(r *CreateSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand Down
44 changes: 22 additions & 22 deletions opensearchapi/api.security.delete.rule_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
)

func newDeleteSecurityRuleMappingFunc(t Transport) DeleteSecurityRuleMapping {
return func(name string, o ...func(*DeleteSecurityRuleMappingRequest)) (*Response, error) {
var r = DeleteSecurityRuleMappingRequest{Name: name}
func newDeleteSecurityRoleMappingFunc(t Transport) DeleteSecurityRoleMapping {
return func(name string, o ...func(*DeleteSecurityRoleMappingRequest)) (*Response, error) {
var r = DeleteSecurityRoleMappingRequest{Name: name}
for _, f := range o {
f(&r)
}
Expand All @@ -18,13 +18,13 @@ func newDeleteSecurityRuleMappingFunc(t Transport) DeleteSecurityRuleMapping {

// ----- API Definition -------------------------------------------------------

// DeleteSecurityRuleMapping Deletes a role mapping
// DeleteSecurityRoleMapping Deletes a role mapping
//
// To use this API, you must have at least the manage_security cluster privilege.
type DeleteSecurityRuleMapping func(name string, o ...func(*DeleteSecurityRuleMappingRequest)) (*Response, error)
type DeleteSecurityRoleMapping func(name string, o ...func(*DeleteSecurityRoleMappingRequest)) (*Response, error)

// DeleteSecurityRuleMappingRequest configures the Delete Security Rule Mapping API request.
type DeleteSecurityRuleMappingRequest struct {
// DeleteSecurityRoleMappingRequest configures the Delete Security Rule Mapping API request.
type DeleteSecurityRoleMappingRequest struct {
Name string

Pretty bool
Expand All @@ -38,7 +38,7 @@ type DeleteSecurityRuleMappingRequest struct {
}

// Do will execute the request and returns response or error.
func (r DeleteSecurityRuleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
func (r DeleteSecurityRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
var (
method string
path strings.Builder
Expand Down Expand Up @@ -112,43 +112,43 @@ func (r DeleteSecurityRuleMappingRequest) Do(ctx context.Context, transport Tran
}

// WithContext sets the request context.
func (f DeleteSecurityRuleMapping) WithContext(v context.Context) func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithContext(v context.Context) func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
r.ctx = v
}
}

// WithPretty makes the response body pretty-printed.
func (f DeleteSecurityRuleMapping) WithPretty() func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithPretty() func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
r.Pretty = true
}
}

// WithHuman makes statistical values human-readable.
func (f DeleteSecurityRuleMapping) WithHuman() func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithHuman() func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
r.Human = true
}
}

// WithErrorTrace includes the stack trace for errors in the response body.
func (f DeleteSecurityRuleMapping) WithErrorTrace() func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithErrorTrace() func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
r.ErrorTrace = true
}
}

// WithFilterPath filters the properties of the response body.
func (f DeleteSecurityRuleMapping) WithFilterPath(v ...string) func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithFilterPath(v ...string) func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
r.FilterPath = v
}
}

// WithHeader adds the headers to the HTTP request.
func (f DeleteSecurityRuleMapping) WithHeader(h map[string]string) func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithHeader(h map[string]string) func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand All @@ -159,8 +159,8 @@ func (f DeleteSecurityRuleMapping) WithHeader(h map[string]string) func(*DeleteS
}

// WithOpaqueID adds the X-Opaque-Id header to the HTTP request.
func (f DeleteSecurityRuleMapping) WithOpaqueID(s string) func(*DeleteSecurityRuleMappingRequest) {
return func(r *DeleteSecurityRuleMappingRequest) {
func (f DeleteSecurityRoleMapping) WithOpaqueID(s string) func(*DeleteSecurityRoleMappingRequest) {
return func(r *DeleteSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand Down
44 changes: 22 additions & 22 deletions opensearchapi/api.security.get.rule_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
)

func newGetSecurityRuleMappingFunc(t Transport) GetSecurityRuleMapping {
return func(name string, o ...func(*GetSecurityRuleMappingRequest)) (*Response, error) {
var r = GetSecurityRuleMappingRequest{Name: name}
func newGetSecurityRoleMappingFunc(t Transport) GetSecurityRoleMapping {
return func(name string, o ...func(*GetSecurityRoleMappingRequest)) (*Response, error) {
var r = GetSecurityRoleMappingRequest{Name: name}
for _, f := range o {
f(&r)
}
Expand All @@ -18,13 +18,13 @@ func newGetSecurityRuleMappingFunc(t Transport) GetSecurityRuleMapping {

// ----- API Definition -------------------------------------------------------

// GetSecurityRuleMapping Gets a role mapping
// GetSecurityRoleMapping Gets a role mapping
//
// To use this API, you must have at least the manage_security cluster privilege.
type GetSecurityRuleMapping func(name string, o ...func(*GetSecurityRuleMappingRequest)) (*Response, error)
type GetSecurityRoleMapping func(name string, o ...func(*GetSecurityRoleMappingRequest)) (*Response, error)

// GetSecurityRuleMappingRequest configures the Get Security Rule Mapping API request.
type GetSecurityRuleMappingRequest struct {
// GetSecurityRoleMappingRequest configures the Get Security Rule Mapping API request.
type GetSecurityRoleMappingRequest struct {
Name string

Pretty bool
Expand All @@ -38,7 +38,7 @@ type GetSecurityRuleMappingRequest struct {
}

// Do will execute the request and returns response or error.
func (r GetSecurityRuleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
func (r GetSecurityRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
var (
method string
path strings.Builder
Expand Down Expand Up @@ -112,43 +112,43 @@ func (r GetSecurityRuleMappingRequest) Do(ctx context.Context, transport Transpo
}

// WithContext sets the request context.
func (f GetSecurityRuleMapping) WithContext(v context.Context) func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithContext(v context.Context) func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
r.ctx = v
}
}

// WithPretty makes the response body pretty-printed.
func (f GetSecurityRuleMapping) WithPretty() func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithPretty() func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
r.Pretty = true
}
}

// WithHuman makes statistical values human-readable.
func (f GetSecurityRuleMapping) WithHuman() func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithHuman() func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
r.Human = true
}
}

// WithErrorTrace includes the stack trace for errors in the response body.
func (f GetSecurityRuleMapping) WithErrorTrace() func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithErrorTrace() func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
r.ErrorTrace = true
}
}

// WithFilterPath filters the properties of the response body.
func (f GetSecurityRuleMapping) WithFilterPath(v ...string) func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithFilterPath(v ...string) func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
r.FilterPath = v
}
}

// WithHeader adds the headers to the HTTP request.
func (f GetSecurityRuleMapping) WithHeader(h map[string]string) func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithHeader(h map[string]string) func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand All @@ -159,8 +159,8 @@ func (f GetSecurityRuleMapping) WithHeader(h map[string]string) func(*GetSecurit
}

// WithOpaqueID adds the X-Opaque-Id header to the HTTP request.
func (f GetSecurityRuleMapping) WithOpaqueID(s string) func(*GetSecurityRuleMappingRequest) {
return func(r *GetSecurityRuleMappingRequest) {
func (f GetSecurityRoleMapping) WithOpaqueID(s string) func(*GetSecurityRoleMappingRequest) {
return func(r *GetSecurityRoleMappingRequest) {
if r.Header == nil {
r.Header = make(http.Header)
}
Expand Down
Loading

0 comments on commit 37ba963

Please sign in to comment.