Add handler and API support for alias creation with target (#4508)

* Add handler and API support for alias creation with target
This commit is contained in:
Todd authored and GitHub committed 2024-03-12 13:57:47 -07:00
1 parent 8d5ec21d73
commit 868228847d
15 files changed
+1116 -484

No files matched your search

+4 -2
View File
@@ -5,6 +5,8 @@
package targets
type Alias struct {
Id string `json:"id,omitempty"`
Value string `json:"value,omitempty"`
Id string `json:"id,omitempty"`
Value string `json:"value,omitempty"`
ScopeId string `json:"scope_id,omitempty"`
Attributes *TargetAliasAttributes `json:"attributes,omitempty"`
}
@@ -0,0 +1,9 @@
// Code generated by "make api"; DO NOT EDIT.
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package targets
type AuthorizeSessionArguments struct {
HostId string `json:"host_id,omitempty"`
}
+6
View File
@@ -115,6 +115,12 @@ func DefaultAddress() Option {
}
}
func WithAliases(inAliases []Alias) Option {
return func(o *options) {
o.postMap["with_aliases"] = inAliases
}
}
func WithAttributes(inAttributes map[string]interface{}) Option {
return func(o *options) {
o.postMap["attributes"] = inAttributes
+1
View File
@@ -42,6 +42,7 @@ type Target struct {
AuthorizedActions []string `json:"authorized_actions,omitempty"`
Address string `json:"address,omitempty"`
Aliases []*Alias `json:"aliases,omitempty"`
WithAliases []*Alias `json:"with_aliases,omitempty"`
response *api.Response
}
@@ -0,0 +1,9 @@
// Code generated by "make api"; DO NOT EDIT.
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package targets
type TargetAliasAttributes struct {
AuthorizeSessionArguments *AuthorizeSessionArguments `json:"authorize_session_arguments,omitempty"`
}