2023-05-09 12:03:54 -04:00
|
|
|
// Code generated by "make api"; DO NOT EDIT.
|
2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2020-09-02 12:31:30 -07:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-02-02 17:15:17 -08:00
|
|
|
|
2020-09-02 12:31:30 -07:00
|
|
|
package targets
|
|
|
|
|
|
|
|
|
|
import (
|
2021-01-25 19:37:40 -05:00
|
|
|
"strconv"
|
2021-02-22 13:31:17 -07:00
|
|
|
"strings"
|
2021-01-25 19:37:40 -05:00
|
|
|
|
2026-10-12 10:33:41 -07:00
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/api"
|
2020-09-02 12:31:30 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Option is a func that sets optional attributes for a call. This does not need
|
|
|
|
|
// to be used directly, but instead option arguments are built from the
|
|
|
|
|
// functions in this package. WithX options set a value to that given in the
|
|
|
|
|
// argument; DefaultX options indicate that the value should be set to its
|
2024-02-16 08:30:16 -05:00
|
|
|
// default. When an API call is made options are processed in the order they
|
2020-09-02 12:31:30 -07:00
|
|
|
// appear in the function call, so for a given argument X, a succession of WithX
|
|
|
|
|
// or DefaultX calls will result in the last call taking effect.
|
|
|
|
|
type Option func(*options)
|
|
|
|
|
|
|
|
|
|
type options struct {
|
2024-09-12 15:56:33 -04:00
|
|
|
postMap map[string]any
|
|
|
|
|
queryMap map[string]string
|
|
|
|
|
withAutomaticVersioning bool
|
|
|
|
|
withSkipCurlOutput bool
|
|
|
|
|
withFilter string
|
|
|
|
|
withListToken string
|
|
|
|
|
withClientDirectedPagination bool
|
|
|
|
|
withPageSize uint32
|
2024-09-13 15:59:49 -04:00
|
|
|
withResourcePathOverride string
|
2024-09-12 15:56:33 -04:00
|
|
|
withRecursive bool
|
2020-09-02 12:31:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getDefaultOptions() options {
|
|
|
|
|
return options{
|
2024-09-04 11:40:43 -04:00
|
|
|
postMap: make(map[string]any),
|
2020-09-02 12:31:30 -07:00
|
|
|
queryMap: make(map[string]string),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getOpts(opt ...Option) (options, []api.Option) {
|
|
|
|
|
opts := getDefaultOptions()
|
|
|
|
|
for _, o := range opt {
|
2021-04-08 20:54:32 -04:00
|
|
|
if o != nil {
|
|
|
|
|
o(&opts)
|
|
|
|
|
}
|
2020-09-02 12:31:30 -07:00
|
|
|
}
|
|
|
|
|
var apiOpts []api.Option
|
2021-01-08 17:30:41 -05:00
|
|
|
if opts.withSkipCurlOutput {
|
|
|
|
|
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
|
|
|
|
|
}
|
2021-02-22 13:31:17 -07:00
|
|
|
if opts.withFilter != "" {
|
|
|
|
|
opts.queryMap["filter"] = opts.withFilter
|
|
|
|
|
}
|
2023-11-24 19:24:31 -08:00
|
|
|
if opts.withListToken != "" {
|
|
|
|
|
opts.queryMap["list_token"] = opts.withListToken
|
2023-10-23 16:49:32 -07:00
|
|
|
}
|
2021-01-25 19:37:40 -05:00
|
|
|
if opts.withRecursive {
|
|
|
|
|
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
|
|
|
|
|
}
|
2024-09-12 15:56:33 -04:00
|
|
|
if opts.withPageSize != 0 {
|
|
|
|
|
opts.queryMap["page_size"] = strconv.FormatUint(uint64(opts.withPageSize), 10)
|
|
|
|
|
}
|
2020-09-02 12:31:30 -07:00
|
|
|
return opts, apiOpts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If set, and if the version is zero during an update, the API will perform a
|
|
|
|
|
// fetch to get the current version of the resource and populate it during the
|
|
|
|
|
// update call. This is convenient but opens up the possibility for subtle
|
|
|
|
|
// order-of-modification issues, so use carefully.
|
2020-09-08 13:27:51 -07:00
|
|
|
func WithAutomaticVersioning(enable bool) Option {
|
2020-09-02 12:31:30 -07:00
|
|
|
return func(o *options) {
|
2020-09-08 13:27:51 -07:00
|
|
|
o.withAutomaticVersioning = enable
|
2020-09-02 12:31:30 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-08 17:30:41 -05:00
|
|
|
// WithSkipCurlOutput tells the API to not use the current call for cURL output.
|
|
|
|
|
// Useful for when we need to look up versions.
|
|
|
|
|
func WithSkipCurlOutput(skip bool) Option {
|
|
|
|
|
return func(o *options) {
|
2024-09-04 11:40:43 -04:00
|
|
|
o.withSkipCurlOutput = skip
|
2021-01-08 17:30:41 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-24 19:24:31 -08:00
|
|
|
// WithListToken tells the API to use the provided list token
|
2023-10-23 16:49:32 -07:00
|
|
|
// for listing operations on this resource.
|
2023-11-24 19:24:31 -08:00
|
|
|
func WithListToken(listToken string) Option {
|
2023-10-23 16:49:32 -07:00
|
|
|
return func(o *options) {
|
2023-11-24 19:24:31 -08:00
|
|
|
o.withListToken = listToken
|
2023-10-23 16:49:32 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-22 13:31:17 -07:00
|
|
|
// WithFilter tells the API to filter the items returned using the provided
|
|
|
|
|
// filter term. The filter should be in a format supported by
|
|
|
|
|
// hashicorp/go-bexpr.
|
|
|
|
|
func WithFilter(filter string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.withFilter = strings.TrimSpace(filter)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-12 15:56:33 -04:00
|
|
|
// WithClientDirectedPagination tells the List function to return only the first
|
|
|
|
|
// page, if more pages are available
|
|
|
|
|
func WithClientDirectedPagination(with bool) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.withClientDirectedPagination = with
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// WithPageSize controls the size of pages used during List
|
|
|
|
|
func WithPageSize(with uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.withPageSize = with
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-13 15:59:49 -04:00
|
|
|
// WithResourcePathOverride tells the API to use the provided resource path
|
|
|
|
|
func WithResourcePathOverride(path string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.withResourcePathOverride = path
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-25 19:37:40 -05:00
|
|
|
// WithRecursive tells the API to use recursion for listing operations on this
|
|
|
|
|
// resource
|
|
|
|
|
func WithRecursive(recurse bool) Option {
|
|
|
|
|
return func(o *options) {
|
2024-09-04 11:40:43 -04:00
|
|
|
o.withRecursive = recurse
|
2021-01-25 19:37:40 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-11 13:48:18 +00:00
|
|
|
func WithAddress(inAddress string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["address"] = inAddress
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultAddress() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["address"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-12 13:57:47 -07:00
|
|
|
func WithAliases(inAliases []Alias) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["with_aliases"] = inAliases
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-15 15:20:49 -04:00
|
|
|
func WithAttributes(inAttributes map[string]interface{}) Option {
|
2020-09-02 12:31:30 -07:00
|
|
|
return func(o *options) {
|
2020-09-15 15:20:49 -04:00
|
|
|
o.postMap["attributes"] = inAttributes
|
2020-09-02 12:31:30 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-15 15:20:49 -04:00
|
|
|
func DefaultAttributes() Option {
|
2020-09-02 12:31:30 -07:00
|
|
|
return func(o *options) {
|
2020-09-15 15:20:49 -04:00
|
|
|
o.postMap["attributes"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 15:16:24 -07:00
|
|
|
func WithBrokeredCredentialSourceIds(inBrokeredCredentialSourceIds []string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["brokered_credential_source_ids"] = inBrokeredCredentialSourceIds
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultBrokeredCredentialSourceIds() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["brokered_credential_source_ids"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-20 09:28:58 -04:00
|
|
|
func WithRdpTargetDefaultClientPort(inDefaultClientPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["default_client_port"] = inDefaultClientPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultRdpTargetDefaultClientPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["default_client_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-21 06:50:53 -04:00
|
|
|
func WithSshTargetDefaultClientPort(inDefaultClientPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-04-21 06:50:53 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-04-21 06:50:53 -04:00
|
|
|
val["default_client_port"] = inDefaultClientPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultSshTargetDefaultClientPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-04-21 06:50:53 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-04-21 06:50:53 -04:00
|
|
|
val["default_client_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func WithTcpTargetDefaultClientPort(inDefaultClientPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-04-21 06:50:53 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-04-21 06:50:53 -04:00
|
|
|
val["default_client_port"] = inDefaultClientPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultTcpTargetDefaultClientPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-04-21 06:50:53 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-04-21 06:50:53 -04:00
|
|
|
val["default_client_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-20 09:28:58 -04:00
|
|
|
func WithRdpTargetDefaultPort(inDefaultPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["default_port"] = inDefaultPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultRdpTargetDefaultPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["default_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-18 14:17:18 -05:00
|
|
|
func WithSshTargetDefaultPort(inDefaultPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2021-11-18 14:17:18 -05:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2021-11-18 14:17:18 -05:00
|
|
|
val["default_port"] = inDefaultPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultSshTargetDefaultPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2021-11-18 14:17:18 -05:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2021-11-18 14:17:18 -05:00
|
|
|
val["default_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-15 15:20:49 -04:00
|
|
|
func WithTcpTargetDefaultPort(inDefaultPort uint32) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2020-09-15 15:20:49 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2020-09-15 15:20:49 -04:00
|
|
|
val["default_port"] = inDefaultPort
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultTcpTargetDefaultPort() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2020-09-15 15:20:49 -04:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2020-09-15 15:20:49 -04:00
|
|
|
val["default_port"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
2020-09-02 12:31:30 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func WithDescription(inDescription string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["description"] = inDescription
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultDescription() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["description"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-30 15:23:37 -05:00
|
|
|
func WithEgressWorkerFilter(inEgressWorkerFilter string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["egress_worker_filter"] = inEgressWorkerFilter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultEgressWorkerFilter() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["egress_worker_filter"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-08 06:12:34 -05:00
|
|
|
func WithRdpTargetEnableSessionRecording(inEnableSessionRecording bool) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["enable_session_recording"] = inEnableSessionRecording
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultRdpTargetEnableSessionRecording() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["enable_session_recording"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-03 15:54:33 -07:00
|
|
|
func WithSshTargetEnableSessionRecording(inEnableSessionRecording bool) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-05-03 15:54:33 -07:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-05-03 15:54:33 -07:00
|
|
|
val["enable_session_recording"] = inEnableSessionRecording
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-08 06:12:34 -05:00
|
|
|
func DefaultSshTargetEnableSessionRecording() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["enable_session_recording"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 15:16:24 -07:00
|
|
|
func WithHostId(inHostId string) Option {
|
2021-10-28 14:25:30 -04:00
|
|
|
return func(o *options) {
|
2022-07-19 15:16:24 -07:00
|
|
|
o.postMap["host_id"] = inHostId
|
2021-10-28 14:25:30 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-30 15:23:37 -05:00
|
|
|
func WithIngressWorkerFilter(inIngressWorkerFilter string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["ingress_worker_filter"] = inIngressWorkerFilter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultIngressWorkerFilter() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["ingress_worker_filter"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 15:16:24 -07:00
|
|
|
func WithInjectedApplicationCredentialSourceIds(inInjectedApplicationCredentialSourceIds []string) Option {
|
2021-10-28 14:25:30 -04:00
|
|
|
return func(o *options) {
|
2022-07-19 15:16:24 -07:00
|
|
|
o.postMap["injected_application_credential_source_ids"] = inInjectedApplicationCredentialSourceIds
|
2021-10-28 14:25:30 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 15:16:24 -07:00
|
|
|
func DefaultInjectedApplicationCredentialSourceIds() Option {
|
2020-09-19 00:18:17 -04:00
|
|
|
return func(o *options) {
|
2022-07-19 15:16:24 -07:00
|
|
|
o.postMap["injected_application_credential_source_ids"] = nil
|
2020-09-19 00:18:17 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 12:31:30 -07:00
|
|
|
func WithName(inName string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["name"] = inName
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultName() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["name"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-19 10:31:49 -04:00
|
|
|
|
2020-10-22 08:40:00 -04:00
|
|
|
func WithScopeId(inScopeId string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["scope_id"] = inScopeId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func WithScopeName(inScopeName string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["scope_name"] = inScopeName
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-20 15:53:49 -04:00
|
|
|
func WithSessionConnectionLimit(inSessionConnectionLimit int32) Option {
|
2020-09-19 10:31:49 -04:00
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["session_connection_limit"] = inSessionConnectionLimit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultSessionConnectionLimit() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["session_connection_limit"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-19 11:32:38 -04:00
|
|
|
func WithSessionMaxSeconds(inSessionMaxSeconds uint32) Option {
|
2020-09-19 10:31:49 -04:00
|
|
|
return func(o *options) {
|
2020-09-19 11:32:38 -04:00
|
|
|
o.postMap["session_max_seconds"] = inSessionMaxSeconds
|
2020-09-19 10:31:49 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-19 11:32:38 -04:00
|
|
|
func DefaultSessionMaxSeconds() Option {
|
2020-09-19 10:31:49 -04:00
|
|
|
return func(o *options) {
|
2020-09-19 11:32:38 -04:00
|
|
|
o.postMap["session_max_seconds"] = nil
|
2020-09-19 10:31:49 -04:00
|
|
|
}
|
|
|
|
|
}
|
2021-01-21 16:27:20 -05:00
|
|
|
|
2026-07-08 06:12:34 -05:00
|
|
|
func WithRdpTargetStorageBucketId(inStorageBucketId string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["storage_bucket_id"] = inStorageBucketId
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultRdpTargetStorageBucketId() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
|
|
|
|
raw = any(map[string]any{})
|
|
|
|
|
}
|
|
|
|
|
val := raw.(map[string]any)
|
|
|
|
|
val["storage_bucket_id"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-03 15:54:33 -07:00
|
|
|
func WithSshTargetStorageBucketId(inStorageBucketId string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-05-03 15:54:33 -07:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-05-03 15:54:33 -07:00
|
|
|
val["storage_bucket_id"] = inStorageBucketId
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultSshTargetStorageBucketId() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
raw, ok := o.postMap["attributes"]
|
|
|
|
|
if !ok {
|
2024-09-04 11:40:43 -04:00
|
|
|
raw = any(map[string]any{})
|
2023-05-03 15:54:33 -07:00
|
|
|
}
|
2024-09-04 11:40:43 -04:00
|
|
|
val := raw.(map[string]any)
|
2023-05-03 15:54:33 -07:00
|
|
|
val["storage_bucket_id"] = nil
|
|
|
|
|
o.postMap["attributes"] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 16:27:20 -05:00
|
|
|
func WithWorkerFilter(inWorkerFilter string) Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["worker_filter"] = inWorkerFilter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultWorkerFilter() Option {
|
|
|
|
|
return func(o *options) {
|
|
|
|
|
o.postMap["worker_filter"] = nil
|
|
|
|
|
}
|
|
|
|
|
}
|